OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
swl0_struc.h
Go to the documentation of this file.
1 #ifndef _SWL0_STRUC_H
2 #define _SWL0_STRUC_H
3 
4 #include <stdio.h>
5 #include "swl0_parms.h"
6 #include "swl0_types.h"
7 
8 typedef struct swl0ctl_struct {
16  char *progname;
17 } swl0ctl;
18 
19 typedef struct swl0hdr_struct {
20  BYTE id[5]; /* Should be ascii CWIF\0 */
21  BYTE type; /* 0 = LAC/GAC, 1 = HRPT */
22  BYTE fill1[310]; /* Not used */
23  INT32 numbits; /* Number of sync bits checked by formatter */
24  INT32 errbits; /* Number of error bits counted by formatter */
25  BYTE fill2[8]; /* Not used */
26  INT32 startTime; /* Time of AOS in seconds since 1/1/70 00:00 */
27  INT32 stopTime; /* Time of LOS in seconds since 1/1/70 00:00 */
28  INT32 numlines; /* Number of frames captured by formatter */
29  BYTE fill3[168]; /* Not used */
30 } swl0hdr;
31 
32 typedef struct frameqc_struct {
33  FLOAT64 time; /* Minor frame time (secs since 1/1/70 00:00)*/
34  FLOAT64 timeShift; /* Minor frame time shift (secs) */
35  BYTE mnftype; /* Minor frame type (0-4,15) */
36  BYTE mnfnum; /* Minor frame number (1-3) */
37  BYTE tRanError; /* 1 => time out of range */
38  BYTE tSeqError; /* 1 => time not increasing with frame type */
39  BYTE tDifError; /* 1 => time difference not expected multiple*/
40  BYTE tShfError; /* 1 => time shifted relative to multiple */
41  BYTE scidError; /* 1 => mnfnum or mnftype out of range */
42  BYTE sgaError; /* 1 => bit errors in sga header */
43  BYTE sacError; /* 1 => bit errors in sac header */
44  BYTE saaError; /* 1 => bit errors in saa header */
45  BYTE bitError; /* 1 => bit errors in sync or image bits */
46  INT16 numBits; /* number of bits checked */
47  INT16 errBits; /* number of bit errors found */
48  BYTE maxErrBits; /* 1 => max bit errors exceeded */
49  INT32 pixVariance; /* total of pix-to-pix differences, absolute */
50 } frameqc;
51 
52 typedef struct swl0indx_struct {
53  char l0file[FILENAME_MAX]; /* Full path name of L0 file */
54  BYTE type; /* File type (HRPT=1, LAC/GAC=0) */
55  INT16 nrecs; /* Total number of records in L0 file */
56  INT16 srec; /* First valid frame */
57  INT16 erec; /* Last valid frame */
58  INT16 ngac; /* Number of GAC records */
59  INT16 nlac; /* Number of GAC records */
60  INT16 nlun; /* Number of lunar cal records */
61  INT16 nsol; /* Number of solar cal records */
62  INT16 nigc; /* Number of intergain cal records */
63  INT16 ntdi; /* Number of TDI cal records */
64  INT16 nund; /* Number frames with undefined typecode */
65  INT16 timeError; /* Number of Timing Errors */
66  INT16 scidError; /* Number of SCID errors */
67  INT16 sohError; /* Number of SOH header errors */
68  FLOAT64 bitRateRep; /* Bit rate reported by frame formatter */
69  FLOAT64 bitRateComp; /* Bit rate computed from image start pixel */
70  INT32 timeAOS; /* Time of AOS in seconds since 1/1/70 00:00 */
71  INT32 timeLOS; /* Time of LOS in seconds since 1/1/70 00:00 */
72  FLOAT64 timeFirst; /* Time of first valid scanline */
73  FLOAT64 timeLast; /* Time of last valid scanline */
74  frameqc *rec; /* Frame-by-frame quality info */
75 } swl0indx;
76 
77 typedef struct swl0scene_struct {
78  char l0file[FILENAME_MAX]; /* Full path name of L0 file */
79  BYTE type; /* File type (HRPT=1, LAC/GAC=0) */
80  BYTE mnftype; /* Minor frame type (LAC=0, SOL=2, GAC=15) */
81  INT16 nrec; /* Number of frames in scene */
82  INT16 nscan; /* Number of scans in scene */
83  INT16 srec; /* First L0 frame number of scene */
84  INT16 crec; /* Central L0 frame number of scene */
85  INT16 erec; /* Last L0 frame number of scene */
86  FLOAT64 stime; /* Start time in secs since 1/1/70 00:00 */
87  FLOAT64 ctime; /* Central time in secs since 1/1/70 00:00 */
88  FLOAT64 etime; /* End time in secs since 1/1/70 00:00 */
89  INT32 orbnum; /* Orbit number at center of scene */
90  INT16 indx[MAXFRAMES]; /* L0 file frame numbers for this scene*/
91  INT16 qual[MAXFRAMES]; /* Quality index per scene frame */
92  /* */
93  /* The rest of this stuff can only be filled after navigation */
94  /* */
95  INT32 center_scan_line; /* Scene center-most scan w valid nav */
96  FLOAT32 node_lon; /* Longitude of dsc node crossing (deg) */
97  FLOAT64 node_time; /* Time of dsc node xing in secs since 1/1/70*/
98  INT32 ntilts; /* Number of tilt states in scene */
99  INT16 tilt_flags[MAXTILTS]; /* 2=aft, 3=changing, 1=fwd */
100  INT16 tilt_ranges[MAXTILTS][2]; /* Scan num range per state */
101  FLOAT32 tilt_lons[MAXTILTS][2][2]; /* Lon of tilt period corners */
102  FLOAT32 tilt_lats[MAXTILTS][2][2]; /* Lat of tilt period corners */
122  char start_node[11];
123  char end_node[11];
124 
125 } swl0scene;
126 
127 typedef struct time_table_struct {
128  char time1[17];
129  char time2[17];
133 } timeTab;
134 
135 typedef struct swl0mindx_struct {
136  char filename[FILENAME_MAX];
139  frameqc *qual;
140 } swl0mindx;
141 
142 
143 #endif
FLOAT64 bitRateComp
Definition: swl0_struc.h:69
double FLOAT64
Definition: elements.h:8
FLOAT64 timeShift
Definition: swl0_struc.h:34
char start_node[11]
Definition: swl0_struc.h:122
char l0file[FILENAME_MAX]
Definition: swl0_struc.h:78
FLOAT64 timeFirst
Definition: swl0_struc.h:72
FLOAT32 upper_left_lon
Definition: swl0_struc.h:107
#define MAXTILTS
Definition: swl0_parms.h:11
FLOAT32 lower_right_lon
Definition: swl0_struc.h:113
frameqc * qual
Definition: swl0_struc.h:139
FLOAT32 start_center_lon
Definition: swl0_struc.h:119
FLOAT64 time
Definition: swl0_struc.h:33
FLOAT32 eastern_lon
Definition: swl0_struc.h:117
int32_t INT32
Definition: elements.h:6
#define MAXFRAMES
Definition: swl0_parms.h:9
INT16 maxBitErrors
Definition: swl0_struc.h:11
FLOAT32 center_lat
Definition: swl0_struc.h:103
INT32 stopTime
Definition: swl0_struc.h:27
INT16 timerangeFactor
Definition: swl0_struc.h:10
INT32 center_scan_line
Definition: swl0_struc.h:95
FLOAT32 center_solz
Definition: swl0_struc.h:105
FLOAT32 southern_lat
Definition: swl0_struc.h:115
BYTE fill3[168]
Definition: swl0_struc.h:29
FLOAT32 center_lon
Definition: swl0_struc.h:104
unsigned char BYTE
Definition: elements.h:4
INT16 indx[MAXFRAMES]
Definition: swl0_struc.h:90
short int INT16
Definition: elements.h:5
FLOAT32 tilt_lats[MAXTILTS][2][2]
Definition: swl0_struc.h:102
BYTE fill2[8]
Definition: swl0_struc.h:25
FLOAT32 end_center_lon
Definition: swl0_struc.h:121
FLOAT32 western_lon
Definition: swl0_struc.h:116
INT32 numlines
Definition: swl0_struc.h:28
FLOAT64 node_time
Definition: swl0_struc.h:97
FLOAT32 northern_lat
Definition: swl0_struc.h:114
char l0file[FILENAME_MAX]
Definition: swl0_struc.h:53
char filename[FILENAME_MAX]
Definition: swl0_struc.h:136
FLOAT32 node_lon
Definition: swl0_struc.h:96
FLOAT32 lower_left_lon
Definition: swl0_struc.h:111
float FLOAT32
Definition: elements.h:7
char * progname
Definition: swl0_struc.h:16
FLOAT64 timeLast
Definition: swl0_struc.h:73
INT16 fileType
Definition: swl0_struc.h:9
FLOAT32 end_center_lat
Definition: swl0_struc.h:120
FLOAT32 upper_right_lat
Definition: swl0_struc.h:108
FLOAT32 tilt_lons[MAXTILTS][2][2]
Definition: swl0_struc.h:101
FLOAT64 bitRateRep
Definition: swl0_struc.h:68
INT32 pixVariance
Definition: swl0_struc.h:49
INT16 tilt_ranges[MAXTILTS][2]
Definition: swl0_struc.h:100
INT16 stopTimeDelta
Definition: swl0_struc.h:13
INT32 startTime
Definition: swl0_struc.h:26
FLOAT32 lower_right_lat
Definition: swl0_struc.h:112
FLOAT32 lower_left_lat
Definition: swl0_struc.h:110
FLOAT32 start_center_lat
Definition: swl0_struc.h:118
FLOAT32 upper_right_lon
Definition: swl0_struc.h:109
FLOAT32 upper_left_lat
Definition: swl0_struc.h:106
char * stationInfoFile
Definition: swl0_struc.h:15
frameqc * rec
Definition: swl0_struc.h:74
INT16 gainSetting
Definition: swl0_struc.h:12
INT16 qual[MAXFRAMES]
Definition: swl0_struc.h:91
BYTE fill1[310]
Definition: swl0_struc.h:22
char end_node[11]
Definition: swl0_struc.h:123
INT16 tilt_flags[MAXTILTS]
Definition: swl0_struc.h:99