OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
calib_l1a.h
Go to the documentation of this file.
1 /*
2 
3 $Header: /app/shared/RCS/irix-5.2/seawifsd/src/hdfio/L1A.V4.4/l1a.h,v 4.15 1995/12/07 19:17:36 seawifsd Exp seawifsd $
4 $Log: l1a.h,v $
5 Revision 4.15 1995/12/07 19:17:36 seawifsd
6 added snode,enode,startclat,startclon,endclat,endclon and
7 made it IO_SPEC_V4.4 and PROD_SPEC_V2.8 compliant.
8 
9 Revision 4.14 1995/05/12 13:53:27 seawifsd
10 1. code conformed to specifications IO_SPEC_V43, PROD_SPEC_V27,
11 and NONPROD_SPEC_V12(no funtionality changes, just eliminate
12 code related to versions before IO_SPEC_V42)
13 
14 Revision 4.13 1995/04/03 16:05:59 seawifsd
15 fixed typo(GENERA -> GENERAL).
16 
17 Revision 4.12 1995/02/15 18:45:01 seawifsd
18 modified definition of the structures meta_l1a and rec_l1a to
19 add scsol_z, entry_year, entry_day, and csol_z.
20 rename macro LAKSHMI to EXTRA_FOR_BROWSE.
21 
22 Revision 4.11 1995/01/27 18:20:47 seawifsd
23 changed the order of mirror from mirror[bands][sides] to mirror[sides][bands]
24 
25 Revision 4.10 1995/01/17 20:03:19 seawifsd
26 Jan. 17, 1994 V4.1
27 
28 Revision 4.1 1995/01/17 14:15:38 seawifsd
29 Jan. 9, 1994, 4.0
30 
31 Revision 3.4 1994/12/15 16:02:14 seawifsd
32 cleanup code that was IO_SPEC_V10 specific.
33 
34 Revision 3.3 1994/11/08 18:45:56 seawifsd
35 Nov. 8, 1994, 3.3a3
36 
37 Revision 3.3 1994/11/08 15:03:54 seawifsd
38 Nov. 8, 1994, 3.3a2
39 
40 Revision 1.1.1.2 1994/11/01 15:58:49 frank
41 added 'infiles' in the default meta_l1a structure because the requirement
42 of L1A browse routines.
43 
44 Revision 1.1.1.1 1994/10/05 20:08:10 frank
45 modified to fit the I/O spec v 3.3 and product spec. 1.0.
46 
47 Revision 1.2 1994/05/10 18:44:42 seawifst
48 May 6, 1994 version 1.2
49 
50 Revision 1.1 1994/04/19 13:23:43 seawifst
51 Initial revision
52 
53 Removed all code that was only compiled when GENERAL was defined.
54 Norman Kuring 6-Nov-1996
55 
56 Added Calibration Vgroup members to struct meta_l2Struct.
57 Norman Kuring 6-Nov-1996
58 
59 Removed all code that was only compiled when EVERYTHING was defined.
60 Norman Kuring 7-Nov-1996
61 
62 Put back all the GENERAL and EVERYTHING code. Heavy sigh.
63 Norman Kuring 25-Nov-1996
64 
65 W. Robinson, GSC, 22 Apr 97 add the cal_mod_struc definition
66  */
67 
68 
69 #ifndef L1A_H
70 #define L1A_H
71 
72 #ifdef GENERAL
73 #define get_l1a_open get_l1a_open_all
74 #define get_l1a_record get_l1a_record_all
75 #define get_l1a_close get_l1a_close_all
76 #define put_l1a_open put_l1a_open_all
77 #define put_l1a_record put_l1a_record_all
78 #define put_l1a_close put_l1a_close_all
79 #define set_l1aget_buffer_blksize set_l1aget_buffer_blksize_all
80 #define set_l1aput_buffer_blksize set_l1aput_buffer_blksize_all
81 #endif /* GENERAL */
82 
83 #include "navigation.h"
84 #include "level_1a_index.h"
85 
86 #ifndef MAX_HDF
87 #define MAX_HDF 16
88 #endif
89 
90 #ifndef MAX_HDF_L1AGET
91 #define MAX_HDF_L1AGET 4
92 #endif
93 
94 typedef struct meta_l1aStruct {
95  char *product_name; /* ATTR Product name(file name) */
96 #ifdef GENERAL
97  char *title; /* ATTR title */
98 #endif /* GENERAL */
99  char *data_center; /* ATTR data_center, processing center */
100  char *station; /* ATTR station */
101  float station_lat; /* ATTR station latitude */
102  float station_lon; /* ATTR station longitude */
103  char *mission; /* ATTR mission */
104  char *mission_char; /* ATTR Mission Characteristics */
105  char *sensor; /* ATTR sensor */
106  char *sensor_char; /* ATTR instrumentInformation */
107 #ifdef EVERYTHING
108  char *dtype; /* ATTR Data type */
109 #endif /* EVERYTHING */
110 #ifdef GENERAL
111  char *replace; /* ATTR Replacement flag (""/fname) */
112 #endif /* GENERAL */
113 #define ISSUE "this might need to be changed to GENERAL or EVERYTHING"
114  char *sw_id; /* ATTR Software ID */
115 #ifdef GENERAL
116  char *ptime; /* ATTR Processing time */
117 #endif /* GENERAL */
118  char *infiles; /* ATTR Input files */
119 #ifdef GENERAL
120  char *proc_con; /* ATTR Processing control */
121  char *proc_log; /* ATTR Processing log */
122 #endif /* GENERAL */
123  char *stime; /* ATTR Start time */
124  char *etime; /* ATTR End time */
125  char *ctime; /* ATTR scene center time */
126  char *ntime; /* ATTR Node crossing time */
127 #ifdef EVERYTHING
128  short syear; /* ATTR Start year */
129  short sday; /* ATTR Start day */
130  int smsec; /* ATTR Start millisec */
131  short eyear; /* ATTR End year */
132  short eday; /* ATTR End day */
133  int emsec; /* ATTR End millisec */
134 #endif /* EVERYTHING */
135  char *snode; /* ATTR Start Node */
136  char *enode; /* ATTR End Node */
137  int orbnum; /* ATTR orbit number */
138  char *norad1; /* ATTR NORAD elements, first line */
139  char *norad2; /* ATTR NORAD elements, second line */
140 #ifdef EVERYTHING
141  int nsamp; /* ATTR pixel per scan line */
142  int nrec; /* ATTR Number of scan line */
143 #endif /* EVERYTHING */
144  int pix_start; /* ATTR LAC Pixel Start Number */
145  int pix_sub; /* ATTR LAC Pixel Subsampling */
146  int ncrec; /* ATTR scene center scan line */
147  int nfrec; /* ATTR number of filled scan line */
148  int ff_mis; /* ATTR FF missing frames */
149  int sd_mis; /* ATTR SDPS missing frames */
150 #ifdef GENERAL
151  /* ATTR Gain 1 saturated pixels */
152  int satg1[BANDS_DIMS_1A];
153  /* ATTR Gain 2 saturated pixels */
154  int satg2[BANDS_DIMS_1A];
155  /* ATTR Gain 1 non-saturated pixels */
156  int nsatg1[BANDS_DIMS_1A];
157  /* ATTR Gain 2 non-saturated pixels */
158  int nsatg2[BANDS_DIMS_1A];
159  /* ATTR Zero pixels */
160  int zeroes[BANDS_DIMS_1A];
161  /* ATTR Mean gain 1 radiance */
162  float meanr1[BANDS_DIMS_1A];
163  /* ATTR Mean gain 2 radiance */
164  float meanr2[BANDS_DIMS_1A];
165 #endif /* GENERAL */
166  char *lat_units; /* ATTR Latitude units */
167  char *lon_units; /* ATTR Longitude units */
168  float northlat; /* ATTR Northernmost latitude */
169  float southlat; /* ATTR Southernmost latitude */
170  float westlon; /* ATTR Westernmost longitude */
171  float eastlon; /* ATTR Easternmost longitude */
172  float startclat; /* ATTR Start Center Latitude */
173  float startclon; /* ATTR Start Center Longtitude */
174  float endclat; /* ATTR End Center Latitude */
175  float endclon; /* ATTR End Center Longtitude */
176  float nodel; /* ATTR Orbit node longitude */
177  int ntilts; /* MFSD Sensor Tilt */
178  /* MFSD tilt indicators */
180  /* MFSD scan-line range of scene tilt */
182  /* MFSD lat of tilt-range scan-line end pt */
184  /* MFSD lon of tilt-range scan-line end pt */
186  /* Calibration Vgroup */
187  short entry_year;
188  short entry_day;
189  short ref_year;
190  short ref_day;
191  short ref_minute;
199 } meta_l1aType;
200 
201 typedef struct rec_l1aStruct {
202 #ifdef EVERYTHING
203  int *msec; /* MFSD scan-line time, msec */
204  unsigned char *eng_qual; /* MFSD engr data quality flags */
205  unsigned char *s_flags; /* MFSD scan-line quality flags */
206 #endif /* EVERYTHING */
207 #ifdef GENERAL
208  short int *s_satp; /* MFSD saturated pixels per band*/
209  short int *s_zerop; /* MFSD zero pixels per band */
210 #endif /* GENERAL */
211  float *slat; /* MFSD Scan start pixel latitude*/
212  float *slon; /* MFSD Scan start pixel longitude*/
213  float *clat; /* MFSD Scan center pixel lat */
214  float *clon; /* MFSD Scan center pixel lon */
215  float *csol_z; /* MFSD Scan center solar zenith*/
216  float *elat; /* MFSD Scan end pixel latitude */
217  float *elon; /* MFSD Scan end pixel longitude*/
218  float *tilt; /* MFSD tilt angle for scan line*/
219 #ifdef GENERAL
220  short int *sc_id; /* MFSD Spacecraft ID */
221  short int *sc_ttag; /* MFSD Spacecraft time tag */
222  unsigned char *sc_soh; /* MFSD spacecraft SOH data */
223  short int *inst_tlm; /* MFSD SeaWiFS instrument Telemetry*/
224 #endif /* GENERAL */
225 #ifdef EVERYTHING
226  short int *l1a_data; /* MFSD scan-line data */
227 #endif /* EVERYTHING */
228 #ifdef GENERAL
229  short int *start_syn; /* MFSD Start synch pixel */
230  short int *stop_syn; /* MFSD Stop sync pixel */
231 #endif /* GENERAL */
232  short int *dark_rest; /* MFSD Dark restore pixel */
233  short int *gain; /* MFSD Band gain */
234  short int *tdi; /* MFSD Band TDI */
235  float *inst_ana; /* MFSD Inst analog telemetry */
236  unsigned char *inst_dis; /* MFSD Inst discrete telemetry */
237 #ifdef GENERAL
238  float *sc_ana; /* MFSD Spacecraft analog tlm */
239  unsigned char *sc_dis; /* MFSD Spacecraft discrete tlm */
240 #endif /* GENERAL */
241  short *scan_temp; /* MFSD digitized scan temp. */
242  short *side; /* MFSD mirror side */
243  navblockType nav;
244 } rec_l1aType;
245 
246 /* out of band correction */
247 #define OOB_OFF 0
248 #define OOB_DEFAULT_METHOD 1
249 #define OXYGEN_CORR_FACTOR 1.12f
250 extern int out_band_corr(float *radiances, float oxygen_factor, int nsample);
251 
252 /* calibration modification structure definition */
253 typedef struct cal_mod_def {
254  int flag; /* use flag: 0 - use cal file values
255  1 - use input gain, cal file offset
256  2 - use cal file gain, input offset
257  3 - use input gain and cal */
258  double gain[8]; /* calibration gain */
259  double offset[8]; /* calibration offset */
260 } cal_mod_struc;
261 
262 #endif /* L1A_H */
char * sensor_char
Definition: calib_l1a.h:106
float counts[BANDS_DIMS_1A][GAINS_DIMS_1A][KNEES_DIMS_1A]
Definition: calib_l1a.h:197
int16 eday
Definition: l1_czcs_hdf.c:17
short int * gain
Definition: calib_l1a.h:233
double t_const[BANDS_DIMS_1A]
Definition: calib_l1a.h:193
float * clon
Definition: calib_l1a.h:214
float tilt_lats[MTILT_DIMS_1A][LTILT_DIMS_1A][PTILT_DIMS_1A]
Definition: calib_l1a.h:183
short ref_year
Definition: calib_l1a.h:189
#define GAINS_DIMS_1A
char * lon_units
Definition: calib_l1a.h:167
char * snode
Definition: calib_l1a.h:135
int16_t * l1a_data
Definition: l1a_seawifs.c:84
int32 * msec
Definition: l1_czcs_hdf.c:31
int16 eyear
Definition: l1_czcs_hdf.c:17
short int * dark_rest
Definition: calib_l1a.h:232
int syear
Definition: l1_czcs_hdf.c:15
char * lat_units
Definition: calib_l1a.h:166
char * mission_char
Definition: calib_l1a.h:104
double offset[8]
Definition: calib_cal_l1a.h:16
int32 smsec
Definition: l1_czcs_hdf.c:16
short ref_minute
Definition: calib_l1a.h:191
int sday
Definition: l1_czcs_hdf.c:15
char * sensor
Definition: calib_l1a.h:105
float rads[BANDS_DIMS_1A][GAINS_DIMS_1A][KNEES_DIMS_1A]
Definition: calib_l1a.h:198
short int * tdi
Definition: calib_l1a.h:234
short * scan_temp
Definition: calib_l1a.h:241
char * infiles
Definition: calib_l1a.h:118
float startclat
Definition: calib_l1a.h:172
float * inst_ana
Definition: calib_l1a.h:235
short * side
Definition: calib_l1a.h:242
float * csol_z
Definition: calib_l1a.h:215
#define BANDS_DIMS_1A
Definition: level_1a_index.h:8
char * norad1
Definition: calib_l1a.h:138
char * product_name
Definition: calib_l1a.h:95
float * clat
Definition: calib_l1a.h:213
char * etime
Definition: calib_l1a.h:124
short tilt_ranges[MTILT_DIMS_1A][LTILT_DIMS_1A]
Definition: calib_l1a.h:181
char * station
Definition: calib_l1a.h:100
double gain[8]
Definition: calib_cal_l1a.h:15
float tilt_lons[MTILT_DIMS_1A][LTILT_DIMS_1A][PTILT_DIMS_1A]
Definition: calib_l1a.h:185
float * slat
Definition: calib_l1a.h:211
float station_lat
Definition: calib_l1a.h:101
char * ntime
Definition: calib_l1a.h:126
char * norad2
Definition: calib_l1a.h:139
char * stime
Definition: calib_l1a.h:123
double t_quadratic[BANDS_DIMS_1A]
Definition: calib_l1a.h:195
float northlat
Definition: calib_l1a.h:168
#define LTILT_DIMS_1A
float * slon
Definition: calib_l1a.h:212
short entry_year
Definition: calib_l1a.h:187
int32 emsec
Definition: l1_czcs_hdf.c:18
float * tilt
Definition: calib_l1a.h:218
float cal_offs[BANDS_DIMS_1A]
Definition: calib_l1a.h:196
char * data_center
Definition: calib_l1a.h:99
dtype
Definition: DDataset.hpp:31
char * mission
Definition: calib_l1a.h:103
#define PTILT_DIMS_1A
#define MTILT_DIMS_1A
Definition: level_1a_index.h:9
char * ctime
Definition: calib_l1a.h:125
short tilt_flags[MTILT_DIMS_1A]
Definition: calib_l1a.h:179
char * enode
Definition: calib_l1a.h:136
int out_band_corr(float *radiances, float oxygen_factor, int nsample)
char * sw_id
Definition: calib_l1a.h:114
float station_lon
Definition: calib_l1a.h:102
float * elat
Definition: calib_l1a.h:216
float * elon
Definition: calib_l1a.h:217
float mirror[SIDES_DIMS_1A][BANDS_DIMS_1A]
Definition: calib_l1a.h:192
#define KNEES_DIMS_1A
navblockType nav
Definition: calib_l1a.h:243
float southlat
Definition: calib_l1a.h:169
unsigned char * inst_dis
Definition: calib_l1a.h:236
#define SIDES_DIMS_1A
double t_linear[BANDS_DIMS_1A]
Definition: calib_l1a.h:194
short entry_day
Definition: calib_l1a.h:188
float startclon
Definition: calib_l1a.h:173