OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
geonav.f
Go to the documentation of this file.
1  subroutine geonav(pos,rm,coef,sun,nsta,ninc,npix,
2  * xlat,xlon,solz,sola,senz,sena)
3 
4 c this subroutine performs navigation of a scanning sensor on the
5 c surface of an ellipsoid based on an input orbit position vector and
6 c sensor orientation matrix. it uses a closed-form algorithm for
7 c determining points on the ellipsoidal surface which involves
8 c determining the intersection of the scan plan with the ellipsoid.
9 c the scan angle values are based on the seawifs lac scan parameters,
10 c i.e., 1285 pixels centered at nadir and 1.5835 milliradians per
11 c pixel. the scan angles navigated are determined by the scan
12 c parameters passed to the routine, i.e., the start pixel, the number
13 c of pixels and the increment. (for gac data these values are 147,
14 c 248 and 4, respectively.) the reference ellipsoid is set according
15 c to the scan intersection coefficients in the calling sequence; a
16 c useful model is an equatorial radius of 6378.137 km. and a
17 c flattening factor of 1/298.257, used by both the geodetic reference
18 c system(grs) 1980 and the world geodetic system(wgs) 1984.
19 c
20 c it then computes geometric parameters using the pixel locations on
21 c the earth, the spaecraft position vector and the unit sun vector in
22 c the geocentric rotating reference frame. the outputs are arrays of
23 c geodetic latitude and longitude, solar zenith and azimuth and sensor
24 c zenith and azimuth. the azimuth angles are measured from local
25 c north toward east. flag values of 999. are returned for any pixels
26 c whose scan angle is past the earth's horizon.
27 
28 c Calling Arguments
29 
30 c Name Type I/O Description
31 c
32 c pos(3) R*4 I Orbit Position Vector (km)
33 c rm(3,3) R*4 I Sensor Orientation Matrix
34 c coef(6) R*4 I Scan path coefficients
35 c sun(3) R*4 I Sun unit vector in geocentric rotating
36 c reference frame
37 c nsta I*4 I Scan start pixel number
38 c SeaWifs LAC: 1
39 c SeaWifs GAC: 147
40 c ninc R*4 I Pixel number increment
41 c SeaWifs LAC: 1
42 c SeaWifs GAC: 4
43 c npix I*4 I Pixels per scan (maximum value of 1285)
44 c SeaWiFS LAC: 1285
45 c SeaWiFS GAC: 248
46 c xlat(*) R*4 O Pixel geodetic latitudes
47 c xlon(*) R*4 O Pixel geodetic longitudes
48 c solz(*) R*4 O Pixel solar zenith angles
49 c sola(*) R*4 O Pixel solar azimuth angles
50 c senz(*) R*4 O Pixel sensor zenith angles
51 c sena(*) R*4 O Pixel sensor azimuth angles
52 
53 c Subprograms Called:
54 
55 c CROSSP Compute cross product of two vectors
56 
57 
58 c Program written by: Frederick S. Patt
59 c General Sciences Corporation
60 c October 20, 1992
61 c
62 c Modification History:
63 c Modified to correspond to paper: "Exact closed-form geolocation
64 c algorithm for Earth survey sensors", International Journal of
65 c Remote Sensing, Patt and Gregg 1993, by W. Gregg, 4/5/93.
66 c
67 c Corrected sinc (radians per pixel) to 0.0015897 correspond to measured
68 c value from SBRS data book. F. S. Patt, 9/22/97
69 c
70 c Added out-of-plane correction to look vector (first-order approximation)
71 c and updated radians per pixel value based on navigation assessment
72 c results. F. S. Patt, GSC, 12/8/97
73 
74  real pos(3),coef(6),rm(3,3),sun(3)
75  real xlat(1),xlon(1),solz(1),sola(1),senz(1),sena(1)
76  real geovec(3),no(3),up(3),ea(3),rmtq(3)
77  real*8 pi,radeg,re,rem,f,omf2,omegae
78  real*8 sinc,elev,sinl,cosl,h
79  logical first/.true./
80  common /navicom/sina(1285),cosa(1285),sinl,cosl
81  common /gconst/pi,radeg,re,rem,f,omf2,omegae
82  data sinc/0.0015911d0/
83  data ea/0.0,0.0,0.0/
84 
85 c If first call, store array of sines and cosines of scan angles for
86 c future use
87  if (first) then
88  first = .false.
89  call cdata
90 
91 c Compute elevation (out-of-plane) angle
92  elev = sinc*1.2
93  sinl = sin(elev)
94  cosl = cos(elev)
95  do i=1,1285
96  sina(i) = sin((i-643)*sinc)*cosl
97  cosa(i) = cos((i-643)*sinc)*cosl
98  end do
99  end if
100 
101 c Compute correction factor for out-of-plane angle
102  h = (rm(2,1)*pos(1)+rm(2,2)*pos(2)+rm(2,3)*pos(3)/omf2)*2.d0
103 
104 c Compute sensor-to-surface vectors for all scan angles
105  do i=1,npix
106  in = ninc*(i-1) + nsta
107  a = coef(1)*cosa(in)*cosa(in)+coef(2)*cosa(in)*sina(in)
108  * +coef(3)*sina(in)*sina(in)
109  b = coef(4)*cosa(in)+coef(5)*sina(in)
110  c = coef(6)
111  r = b*b-4.d0*c*a !begin solve quadratic equation
112 
113 c Check for scan past edge of Earth
114 .lt. if (r0.) then
115  xlat(i) = 999.
116  xlon(i) = 999.
117  solz(i) = 999.
118  sola(i) = 999.
119  senz(i) = 999.
120  sena(i) = 999.
121  else
122 c Solve for magnitude of sensor-to-pixel vector and compute components
123  q = (-b-sqrt(r))/(2.d0*a)
124 
125 c Add out-of-plane correction
126  q = q*(1.d0 + sinl*h/sqrt(r))
127 
128  Qx = q*cosa(in)
129  Qy = q*sinl
130  Qz = q*sina(in)
131 
132 c Transform vector from sensor to geocentric frame
133  do j=1,3
134  rmtq(j) = Qx*rm(1,j) + Qy*rm(2,j) + Qz*rm(3,j)
135  geovec(j) = rmtq(j) + pos(j)
136  end do
137 
138 c Compute geodetic latitude and longitude
139  tmp = sqrt(geovec(1)*geovec(1)+geovec(2)*geovec(2))*omf2
140  xlat(i) = radeg*atan2(geovec(3),tmp)
141  xlon(i) = radeg*atan2(geovec(2),geovec(1))
142 
143 c Compute the local vertical, East and North unit vectors
144  uxy = geovec(1)*geovec(1)+geovec(2)*geovec(2)
145  temp = sqrt(geovec(3)*geovec(3) + omf2*omf2*uxy)
146  up(1) = omf2*geovec(1)/temp
147  up(2) = omf2*geovec(2)/temp
148  up(3) = geovec(3)/temp
149  upxy = sqrt(up(1)*up(1)+up(2)*up(2))
150  ea(1) = -up(2)/upxy
151  ea(2) = up(1)/upxy
152  call crossp(up,ea,no)
153 
154 c Compute components of spacecraft and sun vector in the
155 c vertical (up), North (no), and East (ea) vectors
156 c frame
157  sv = 0.0
158  sn = 0.0
159  se = 0.0
160  sunv = 0.0
161  sunn = 0.0
162  sune = 0.0
163  do j=1,3
164  s = -rmtq(j)
165  sv = sv + s*up(j)
166  sn = sn + s*no(j)
167  se = se + s*ea(j)
168  sunv = sunv + sun(j)*up(j)
169  sunn = sunn + sun(j)*no(j)
170  sune = sune + sun(j)*ea(j)
171  enddo
172 
173 c Compute the sensor zenith and azimuth
174  senz(i)=radeg*atan2(sqrt(sn*sn+se*se),sv)
175 c Check for zenith close to zero
176 .gt. if (senz(i)0.05d0) then
177  sena(i) = radeg*atan2(se,sn)
178  else
179  sena(i) = 0.0d0
180  end if
181 .lt. if (sena(i)0.d0) sena(i) = sena(i) + 360.0d0
182  endif
183 c
184 c Compute the solar zenith and azimuth
185  solz(i)=radeg*atan2(sqrt(sunn*sunn+sune*sune),sunv)
186 c Check for zenith close to zero
187 .gt. if (solz(i)0.05d0) then
188  sola(i) = radeg*atan2(sune,sunn)
189  else
190  sola(i) = 0.0d0
191  end if
192 .lt. if (sola(i)0.d0) sola(i) = sola(i) + 360.0d0
193 
194  end do
195 
196  return
197  end
int navigation(int32_t fileID)
Definition: l1_octs_hdf.c:696
float * vector(long nl, long nh)
Definition: nrutil.c:15
#define flattening
Definition: vincenty.c:24
subroutine earth(pos, vel, widphse1, widphfl1, widphse2,
Definition: earth.f:2
float ** matrix(long nrl, long nrh, long ncl, long nch)
Definition: nrutil.c:60
===========================================================================V5.0.48(Terra) 03/20/2015 Changes shown below are differences from MOD_PR02 V5.0.46(Terra)============================================================================Changes noted for V6.1.20(Terra) below were also instituted for this version.============================================================================V6.1.20(Terra) 03/12/2015 Changes shown below are differences from MOD_PR02 V6.1.18(Terra)============================================================================Changes from v6.1.18 which may affect scientific output:A situation can occur in which a scan which contains sector rotated data has a telemetry value indicating the completeness of the sector rotation. This issue is caused by the timing of the instrument command to perform the sector rotation and the recording of the telemetry point that reports the status of sector rotation. In this case a scan is considered valid by L1B and pass through the calibration - reporting extremely high radiances. Operationally the TEB calibration uses a 40 scan average coefficient, so the 20 scans(one mirror side) after the sector rotation are contaminated with anomalously high radiance values. A similar timing issue appeared before the sector rotation was fixed in V6.1.2. Our analysis indicates the ‘SET_FR_ENC_DELTA’ telemetry correlates well with the sector rotation encoder position. The use of this telemetry point to determine scans that are sector rotated should fix the anomaly occured before and after the sector rotation(usually due to the lunar roll maneuver). The fix related to the sector rotation in V6.1.2 is removed in this version.============================================================================V6.1.18(Terra) 10/01/2014 Changes shown below are differences from MOD_PR02 V6.1.16(Terra)============================================================================Added doi attributes to NRT(Near-Real-Time) product.============================================================================V6.1.16(Terra) 01/27/2014 Changes shown below are differences from MOD_PR02 V6.1.14(Terra)============================================================================Migrate to SDP Toolkit 5.2.17============================================================================V6.1.14(Terra) 06/26/2012 Changes shown below are differences from MOD_PR02 V6.1.12(Terra)============================================================================Added the doi metadata to L1B product============================================================================V6.1.12(Terra) 04/25/2011 Changes shown below are differences from MOD_PR02 V6.1.8(Terra)============================================================================1. The algorithm to calculate uncertainties for reflective solar bands(RSB) is updated. The current uncertainty in L1B code includes 9 terms from prelaunch analysis. The new algorithm regroups them with the new added contributions into 5 terms:u1:the common term(AOI and time independent) and
Definition: HISTORY.txt:126
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DWITH_MPI") target_link_libraries(afrt_nc4 $
Definition: CMakeLists.txt:16
for(i=0;i< NROOTS;i++) s[i]
Definition: decode_rs.h:85
void radius(double A)
Definition: proj_report.c:132
this program makes no use of any feature of the SDP Toolkit that could generate such a then geolocation is calculated at that and then aggregated up to Resolved feature request Bug by adding three new int8 SDSs for each high resolution offsets between the high resolution geolocation and a bi linear interpolation extrapolation of the positions This can be used to reconstruct the high resolution geolocation Resolved Bug by delaying cumulation of gflags until after validation of derived products Resolved Bug by setting Latitude and Longitude to the correct fill resolving to support Near Real Time because they may be unnecessary if use of entrained ephemeris and attitude data is turned on(as it will be in Near-Real-Time processing).
algorithm
Definition: DDProcess.h:25