OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
l1stat.h
Go to the documentation of this file.
1 /*
2  * W. Robinson, SAIC, 26 Oct 2001 have defs for all data types
3  * to replace the string defines
4  * 24 Jul 2002 W. Robinson add time range checking to 3 check types
5  * in thr_ctl structure
6  */
7 #include <stdio.h>
8 #include <stdlib.h>
9 #include <string.h>
10 #include <math.h>
11 #include "hdf.h"
12 #include "mfhdf.h"
13 
14 #define BAND1 0
15 #define BAND2 1
16 #define BAND3 2
17 #define BAND4 3
18 #define BAND5 4
19 #define BAND6 5
20 #define BAND7 6
21 #define BAND8 7
22 
23 #define NSAMP "Pixels per Scan Line"
24 #define NSCANS "Number of Scan Lines"
25 #define TITLE "Title"
26 #define DTYPE "Data Type"
27 #define GN1SAT "Gain 1 Saturated Pixels"
28 #define GN2SAT "Gain 2 Saturated Pixels"
29 #define GN1UNSAT "Gain 1 Non-Saturated Pixels"
30 #define GN2UNSAT "Gain 2 Non-Saturated Pixels"
31 #define ZEROPIX "Zero Pixels"
32 
33 #define GAC 0
34 #define LAC 1
35 #define HRPT 2
36 #define LUN 3
37 #define SOL 4
38 #define IGC 5
39 #define TDI 6
40 
41 /* define label for l1a_data sds */
42 #define L1ADATA "l1a_data"
43 
44 /* define labels for tilt datasets */
45 #define NTILTS "ntilts"
46 #define TILT_RANGES "tilt_ranges"
47 #define TILT_FLAGS "tilt_flags"
48 
49 /* define labels for navigation datasets */
50 #define ORBVEC "orb_vec"
51 #define SENMAT "sen_mat"
52 #define SCANELL "scan_ell"
53 #define SUNREF "sun_ref"
54 #define NFLAG "nflag"
55 
56 /* gain_struct has all the information about controls for checking
57  * gain1 and gain2 data
58  */
59 
60 typedef struct cntl1_struct {
61  int32 band;
62  float32 threshold;
63 } cntl1_str;
64 
65 typedef struct cntl2_struct {
66  int32 band;
67  float32 err_thresh;
68  float32 cnt_thresh;
69 } cntl2_str;
70 
71 /* WDR new structure for some of the controls */
72 typedef struct thr_ctl_struct {
73  /* for doing the time range check */
74  int16 trng_chk_do; /* check file for being in possible bad time range */
75  /* instrument analog telem info */
76  int16 rpt_inst_ana; /* 1 to report failure for inst_ana checks */
77  int16 inst_ana_do[32]; /* perform this check - the control is there */
78  float32 inst_ana_lo[32]; /* low threshold */
79  float32 inst_ana_hi[32]; /* high threshold */
80  float32 inst_ana_pct[32]; /* % acceptable outside thresholds */
81  /* Gain check info */
82  int16 rpt_gainv_chk; /* 1 to report failure for gainv checks */
83  int16 gainv_chk_do[8]; /* check the gain value for GAC, LAC, SOL, LUN */
84  float32 gainv_chk_pct[8]; /* % not at right gain acceptable */
85  /* TDI check info */
86  int16 rpt_tdi_vchk; /* 1 to report failure for tdi checks */
87  int16 tdiv_chk_do[8]; /* check the tdi for GAC, LAC, SOL, LUN */
88  float32 tdiv_chk_pct[8]; /* % not at right tdi setting that is acceptable */
89 } thr_ctl_def;
90 
91 /* WDR have a convinent container for nav and time info */
92 typedef struct nav_t_struct {
93  float32 *orb_vec;
94  float32 *sun_ref;
95  float32 *sen_mat;
96  float32 *scal_ell;
97  int32_t *msec;
98  int32 *nflag;
99 } nav_t_str;
100 
101 #define fltabs(x) (x>=0 ? x : -(x))
float32 tdiv_chk_pct[8]
Definition: l1stat.h:88
integer, parameter int16
Definition: cubeio.f90:3
int16 gainv_chk_do[8]
Definition: l1stat.h:83
int16 tdiv_chk_do[8]
Definition: l1stat.h:87
int16 trng_chk_do
Definition: l1stat.h:74
int16 rpt_tdi_vchk
Definition: l1stat.h:86
float32 * orb_vec
Definition: l1stat.h:93
int32 * nflag
Definition: l1stat.h:98
float32 inst_ana_pct[32]
Definition: l1stat.h:80
float32 * sun_ref
Definition: l1stat.h:94
int32 band
Definition: l1stat.h:61
float32 err_thresh
Definition: l1stat.h:67
float32 inst_ana_hi[32]
Definition: l1stat.h:79
float32 threshold
Definition: l1stat.h:62
int16 rpt_inst_ana
Definition: l1stat.h:76
float32 * scal_ell
Definition: l1stat.h:96
float32 * sen_mat
Definition: l1stat.h:95
int32 band
Definition: l1stat.h:66
float32 cnt_thresh
Definition: l1stat.h:68
float32 gainv_chk_pct[8]
Definition: l1stat.h:84
int32_t * msec
Definition: l1stat.h:97
int16 rpt_gainv_chk
Definition: l1stat.h:82
int16 inst_ana_do[32]
Definition: l1stat.h:77
float32 inst_ana_lo[32]
Definition: l1stat.h:78