OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
sunwgt.f
Go to the documentation of this file.
1  subroutine sunwgt(sun_bod,procrng,sunproc,nlines,wsun,wsunfl)
2 c
3 c sunwgt(sun_bod,procrng,sunproc,nlines,wsun,wsunfl)
4 c
5 c purpose: blend or weight the sun vector from the 3 sensors
6 c into one consistent set
7 c
8 c calling arguments:
9 c
10 c name Type i/o description
11 c -------- ---- --- -----------
12 c sun_bod r*4 i size 3 by 3 sensor by nlines sun vector
13 c data
14 c procrng i*4 i size 2 by 3 sensors low and high active
15 c ranges for each sensor
16 c sunproc struct i contains flags for the sensor and line,
17 c 0 = good, 1 = bad
18 c nlines i*4 i number of lines of data
19 c wsun r*4 o size 3 by nlines weighted sun vector data
20 c wsunfl i*4 o size nlines flags for the weighted sun vectors
21 c
22 c by: w. robinson, gsc, 6 apr 93
23 c
24 c notes:
25 c
26 c modification history:
27 c
28 c march 30, 1995: modified weighting scheme to account for sun sensor
29 c data as tangents of angles and to allow for possible swapping of axes.
30 c frederick s. patt, gsc
31 c
32 c october 16, 1997. modified the maximum sensor value to correspond to
33 c a restricted range of useful sensor data (tangent value of +/- 1.9).
34 c frederick s. patt, gsc
35 
36  implicit none
37 c
38 #include "nav_cnst.fin"
39 #include "sunpr_s.fin"
40 c
41  type(sunproc_struct) :: sunproc(3)
42 c
43  integer*4 procrng(2,3), nlines, wsunfl(nlines)
44  real*4 sun_bod(3,3,nlines), wsun(3,nlines), sumwgt
45 c
46  integer*4 ivec, ilin, isens
47  real*4 weight,sunmax
48  data sunmax/1.9/
49 c
50 c
51 c start, loop through the lines
52 c
53  do ilin = 1, nlines
54 c
55 c initialize weight, final sun vectors and set final flag to bad
56 c
57  sumwgt = 0
58  wsunfl(ilin) = 0
59  do ivec = 1, 3
60  wsun(ivec,ilin) = 0
61  end do
62 c
63 c loop over each sensor
64 c
65  do isens = 1, 3
66 c
67 c compute the weight for this sensor and line as
68 c the position from the end of the sensor range
69 
70  if( sunproc(isens)%flag(ilin) .eq. 0 ) then
71 
72  weight = sunmax - sqrt(sunproc(isens)%ang(1,ilin)**2 +
73  * sunproc(isens)%ang(2,ilin)**2)
74 c
75 c get the sum of the weights, and weight * vector
76 c
77  sumwgt = sumwgt + weight
78  do ivec = 1, 3
79  wsun(ivec,ilin) = wsun(ivec,ilin) +
80  1 sun_bod(ivec,isens,ilin) * weight
81  end do
82  wsunfl(ilin) = 0
83 c
84  end if
85  end do
86 c
87 c divide the sum by the weight
88 c
89  if( sumwgt .gt. 0 ) then
90  do ivec = 1, 3
91  wsun(ivec,ilin) = wsun(ivec,ilin) / sumwgt
92  end do
93  else
94  wsunfl(ilin) = 1
95  end if
96 c
97  end do
98 c
99  return
100  end
float * vector(long nl, long nh)
Definition: nrutil.c:15
void initialize(int pixref_flag, int blkref_flag)
Definition: Usds.c:1371
#define real
Definition: DbAlgOcean.cpp:26
subroutine sunwgt(sun_bod, procrng, sunproc, nlines, wsun, wsunfl)
Definition: sunwgt.f:2
===========================================================================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
flags
Definition: DDAlgorithm.h:22