OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
suncomp.f
Go to the documentation of this file.
1  subroutine suncomp(tlm, time, nlines, gaclac, navqc,
2  1 navctl, sun_bod, sunbodfl )
3 c
4 c suncomp(tlm, time, nlines, gaclac, navqc,
5 c navctl, sun_bod, sunbodfl )
6 c
7 c purpose: create one set of sun vectors from the raw sun sensor data
8 c
9 c calling arguments:
10 c
11 c name Type i/o description
12 c -------- ---- --- -----------
13 c tlm struct i telemetry containing the sun sensor
14 c data
15 c time r*8 i size nlines time of each line in seconds
16 c past the reference time
17 c nlines i*4 i number of lines in this segment
18 c gaclac i*4 i flag for gac or lac data type,
19 c 1 = gac, 0 = lac
20 c navqc struct i quality controls including sun angle
21 c and sun angle rate change tolerences
22 c navctl struct i navigation controls including sun-sensor
23 c to spacrcraft transform matricies
24 c sun_bod r*4 o size 3 by nlines weighted sun vectors
25 c in s/c frame
26 c sunbodfl i*4 o quality flags for sun_bod vectors, 0 = good
27 c
28 c by: w. robinson, gsc, 6 apr 93
29 c
30 c notes: this routine takes the 2 sun angle measurements from each
31 c of the 3 sun sensors for each telemetry record, performs
32 c quality control on the angles, converts the angles into vectors
33 c in the spacecraft coordinate system and merges the 3 sensor
34 c sets into one consistent set of sun vectors.
35 c
36 c modification history:
37 c
38 c modified logic to set larger smoothing interval for lac and hrpt data.
39 c f. s. patt, saic gsc, december 24, 1997.
40 c
41 c removed check for end of valid data within 3 frames of end of interval,
42 c since this occasionally caused problems and is no longer needed with the
43 c kalman filter attitude algorithm. f. s. patt, saic gsc, august 6, 1998
44 
45  implicit none
46 c
47 #include "tlm_str.fin"
48 #include "navqc_s.fin"
49 #include "navctl_s.fin"
50 c
51  type(tlm_struct) :: tlm
52  type(navqc_struct) :: navqc
53  type(navctl_struct) :: navctl
54  integer*4 nlines, gaclac, sunbodfl(maxlin)
55  real*8 time(nlines)
56  real*4 sun_bod(3,maxlin)
57 c
58 #include "sunpr_s.fin"
59  type(sunproc_struct) :: sunproc(3)
60  integer*4 sunrng(2,3), nper, numact, iret, procrng(2,3)
61  integer*4 isens, i, k, nfpts, nskip
62  real*4 measlcl(2,maxlin), sun_bod3(3,3,maxlin)
63 c
64 c initially set all output flags
65  do isens = 1,3
66  do i = 1, nlines
67  sunproc(isens)%flag(i) = 1
68  end do
69  end do
70 c
71 c
72 c start, determine the active ranges for each sensor
73 c(assume 1 quasi-contiguous range)
74 c
75  do isens = 1, 3
76  call actrng( tlm%ntlm, tlm%sun(isens)%active, sunrng(1,isens) )
77  end do
78 c
79 c for the active ranges, check the 2 angles to be within tolerence
80 c
81  call suntol( tlm%sun, navqc, sunrng )
82 c
83 c check the remaining unflagged angles for consistency
84 c
85  call suncnst( gaclac, navqc, sunrng, tlm%sun )
86 
87 c
88 c perform a running 3rd order polynomial fit over the active ranges
89 c
90  nfpts = navctl%nsfpts
91  nskip = navctl%nsskip
92  if( gaclac .eq. 1 ) then
93  nper = 5
94  else
95  nper = 1
96  nfpts = nfpts*20
97  nskip = nskip*20
98  end if
99 c
100  do isens = 1, 3
101  if( sunrng(1,isens) .gt. 0 ) then
102  if (sunrng(1,isens) .le. 3) sunrng(1,isens) = 1
103  numact = sunrng(2,isens) - sunrng(1,isens) + 1
104 c
105  procrng(1,isens) = ( sunrng(1,isens) - 1 ) * nper + 1
106  procrng(2,isens) = sunrng(2,isens) * nper
107 c
108  call runfit3t( nfpts, nskip, measlcl,
109  1 tlm%sun(isens)%ang(1,sunrng(1,isens)), numact,
110  1 2, tlm%sun(isens)%flag(sunrng(1,isens)),
111  1 nper, time(procrng(1,isens)),
112  1 tlm%sun(isens)%deltim(sunrng(1,isens)),
113  1 sunproc(isens)%ang(1,procrng(1,isens)),
114  1 sunproc(isens)%flag(procrng(1,isens)), iret )
115 c
116  else
117  procrng(1,isens) = -1
118  end if
119  end do
120 c
121 c
122 c the sensor data is now checked and fitted to every data line.
123 c now, convert the data to the spacecraft ref frame
124 c
125 c convert the angles to vectors in the spacecraft frame
126 c
127  call sunvec( procrng, sunproc, navctl, sun_bod3 )
128 
129  if (navctl%lvdbug .gt. 2) then
130  do i=1,nlines
131  do isens=1,3
132  write (67,*) i,(sun_bod3(k,isens,i),k=1,3)
133  end do
134  end do
135  end if
136 c
137 c blend the vectors from the 3 sensors into 1 list of vectors
138 c
139  call sunwgt( sun_bod3, procrng, sunproc, nlines,
140  1 sun_bod, sunbodfl )
141 c
142 c and end
143 c
144  return
145  end
int navigation(int32_t fileID)
Definition: l1_octs_hdf.c:696
list(APPEND LIBS ${PGSTK_LIBRARIES}) add_executable(atteph_info_modis atteph_info_modis.c) target_link_libraries(atteph_info_modis $
Definition: CMakeLists.txt:7
subroutine suncomp(tlm, time, nlines, gaclac, navqc,
Definition: suncomp.f:2
subroutine sunvec(procrng, sunproc, navctl, sun_bod)
Definition: sunvec.f:2
subroutine actrng(nitem, active, irange)
Definition: actrng.f:2
void fit(float x[], float y[], int ndata, float sig[], int mwt, float *a, float *b, float *siga, float *sigb, float *chi2, float *q)
#define real
Definition: DbAlgOcean.cpp:26
subroutine sunwgt(sun_bod, procrng, sunproc, nlines, wsun, wsunfl)
Definition: sunwgt.f:2
subroutine suncnst(gaclac, navqc, sunrng, sun)
Definition: suncnst.f:2
float rd(float x, float y, float z)
===========================================================================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
void filter(fctlstr *fctl, l1qstr *l1que, l1str *l1rec, int32_t dscan)
Definition: filter.c:1396
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DWITH_MPI") target_link_libraries(afrt_nc4 $
Definition: CMakeLists.txt:16
subroutine runfit3t(nfpts, nskip, measlcl, meas, nmeas, nquant, flag, nper, time, timdif, measout, flgout, iret)
Definition: runfit3t.f:3
flags
Definition: DDAlgorithm.h:22
subroutine suntol(sun, navqc, sunrng)
Definition: suntol.f:2
#define f
Definition: l1_czcs_hdf.c:702
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