OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
orb_interp.f
Go to the documentation of this file.
1  subroutine orb_interp(orbit,nlines,timref,time,posi,veli,orbfl)
2 c
3 c prolog(orbit,timref,time,posi,veli)
4 c
5 c purpose: interpolate orbit position and velocity vectors to scan line times
6 c
7 c
8 c calling arguments:
9 c
10 c name Type i/o description
11 c -------- ---- --- -----------
12 c orbit struct i input structure of filtered orbit data
13 c nlines i*4 i number of scan line times
14 c timref r*8 i Size 3 reference time at start line
15 c of data: year, day, sec
16 c time r*8 i array of time in seconds relative to
17 c timref for every scan line
18 c posi r*4 o Size 3 by nlines interpolated position
19 c veli r*4 o Size 3 by nlines interpolated velocity
20 c orbfl i*4 o Size nlines orbit vector flags(0=good)
21 c
22 c
23 c by: frederick s. patt, gsc, august 10, 1993
24 c
25 c notes: method uses cubic polynomial to match positions and velocities
26 c at input data points.
27 c
28 c modification history:
29 c
30 c added check for array index exceeded number of scan lines in check for
31 c scan lines preceding first scan line. f.s. patt, saic gsc, may 23, 2000.
32 c
33  implicit none
34 #include "nav_cnst.fin"
35 #include "orbit_s.fin"
36  type(orbit_struct) :: orbit
37 c
38  integer*4 ind, i, j, i1, nlines, iy, id, jd
39  real*8 timref(3), time(nlines)
40  real*8 a0(3),a1(3),a2(3),a3(3), t, dt, x, x2, x3, ddifs
41  real*4 posi(3,nlines), veli(3,nlines)
42  integer*4 orbfl(nlines)
43  logical first
44 
45  ind = 1
46  i1 = 1
47  first = .true.
48 c make sure that orbit vector precedes first scan line
49  iy = timref(1)
50  id = timref(2)
51  ddifs = (jd(iy,1,id) - jd(orbit%iyr,1,orbit%iday))*864.d2
52  t = ddifs + timref(3)+time(i1)
53  dowhile((t.lt.orbit%torb(ind)).and.(i1.le.nlines))
54  do j=1,3
55  posi(j,i1) = 0.0
56  veli(j,i1) = 0.0
57  end do
58  orbfl(i1) = 1
59  print *, 'Scan line times before available orbit data'
60  i1 = i1 + 1
61  t = ddifs + timref(3)+time(i1)
62  end do
63 
64  do i=i1,nlines
65  t = ddifs + timref(3)+time(i)
66  if ((t.gt.orbit%torb(ind+1)).or.first) then
67  dowhile(t.gt.orbit%torb(ind+1))
68  ind = ind + 1
69  if (ind.gt.orbit%nvec) then
70  i1 = 1
71  go to 990
72  end if
73  end do
74  first = .false.
75 c set up cubic interpolation
76  dt = orbit%torb(ind+1) - orbit%torb(ind)
77  do j=1,3
78  a0(j) = orbit%pos(j,ind)
79  a1(j) = orbit%vel(j,ind)*dt
80  a2(j) = 3.d0*orbit%pos(j,ind+1) - 3.d0*orbit%pos(j,ind)
81  * - 2.d0*orbit%vel(j,ind)*dt - orbit%vel(j,ind+1)*dt
82  a3(j) = 2.d0*orbit%pos(j,ind) - 2.d0*orbit%pos(j,ind+1)
83  * + orbit%vel(j,ind)*dt + orbit%vel(j,ind+1)*dt
84  end do
85  end if
86 
87 c interpolate orbit position and velocity components to scan line time
88  x = (t - orbit%torb(ind))/dt
89  x2 = x*x
90  x3 = x2*x
91  do j=1,3
92  posi(j,i) = a0(j) + a1(j)*x + a2(j)*x2 + a3(j)*x3
93  veli(j,i) = (a1(j) + 2.*a2(j)*x + 3.*a3(j)*x2)/dt
94  end do
95  orbfl(i) = 0
96 
97  end do
98  return
99 
100 990 print *, 'Scan line times after available orbit data'
101  do i=i1,nlines
102  do j=1,3
103  posi(j,i) = 0.0
104  veli(j,i) = 0.0
105  end do
106  orbfl(i) = 1
107  end do
108  return
109 
110  end
an array had not been initialized Several spelling and grammar corrections were which is read from the appropriate MCF the above metadata values were hard coded A problem calculating the average background DN for SWIR bands when the moon is in the space view port was corrected The new algorithm used to calculate the average background DN for all reflective bands when the moon is in the space view port is now the same as the algorithm employed by the thermal bands For non SWIR changes in the averages are typically less than Also for non SWIR the black body DNs remain a backup in case the SV DNs are not available For SWIR the changes in computed averages were larger because the old which used the black body suffered from contamination by the micron leak As a consequence of the if SV DNs are not available for the SWIR the EV pixels will not be the granule time is used to identify the appropriate tables within the set given for one LUT the first two or last two tables respectively will be used for the interpolation If there is only one LUT in the set of it will be treated as a constant LUT The manner in which Earth View data is checked for saturation was changed Previously the raw Earth View DNs and Space View DNs were checked against the lookup table values contained in the table dn_sat The change made is to check the raw Earth and Space View DNs to be sure they are less than the maximum saturation value and to check the Space View subtracted Earth View dns against a set of values contained in the new lookup table dn_sat_ev The metadata configuration and ASSOCIATEDINSTRUMENTSHORTNAME from the MOD02HKM product The same metatdata with extensions and were removed from the MOD021KM and MOD02OBC products ASSOCIATEDSENSORSHORTNAME was set to MODIS in all products These changes are reflected in new File Specification which users may consult for exact the pow functions were eliminated in Emissive_Cal and Emissive bands replaced by more efficient code Other calculations throughout the code were also made more efficient Aside from a few round off there was no difference to the product The CPU time decreased by about for a day case and for a night case A minor bug in calculating the uncertainty index for emissive bands was corrected The frame index(0-based) was previously being used the frame number(1-based) should have been used. There were only a few minor changes to the uncertainty index(maximum of 1 digit). 3. Some inefficient arrays(Sigma_RVS_norm_sq) were eliminated and some code lines in Preprocess_L1A_Data were moved into Process_OBCEng_Emiss. There were no changes to the product. Required RAM was reduced by 20 MB. Now
float * vector(long nl, long nh)
Definition: nrutil.c:15
#define real
Definition: DbAlgOcean.cpp:26
void interpolate(int16_t PA_flag, int16_t parm_flag, double DT1, double DT2, float in_lat, float in_lon, float *lat_list, float *lon_list, void *data_p1, void *data_p2, int8_t *qc1, int8_t *qc2, float *intpdata, float *anc_unc, int32_t *int_qc)
Definition: getanc.c:1314
Definition: jd.py:1
===========================================================================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
bool match(char *first, char *second)
Definition: l2qc_viirs.cpp:45
flags
Definition: DDAlgorithm.h:22
#define f
Definition: l1_czcs_hdf.c:702