ocssw V2020
l1_struc.h
Go to the documentation of this file.
1 #ifndef _L1_STRUC_H
2 #define _L1_STRUC_H
3 
4 #include <stdbool.h>
5 #include <stdint.h>
6 
7 #include "l12_parms.h"
8 #include "input_struc.h"
9 #include "filehandle.h"
10 
11 /* Notice: any changes to this structure may require modifications to the */
12 
13 /* following routines: alloc_l1.c, cpl1rec.c, l1subpix.c. */
14 
15 typedef struct geom_struc_def {
16  float *senz;
17  float *sena;
18  float *csenz;
19  float *solz;
20  float *sola;
21  float *csolz;
22  float *delphi;
23  float *scattang;
24 } geom_struc;
25 
26 typedef struct anc_add_struc_def {
27  int32_t nlvl; /* number of profile levels */
28  float *prof_temp;
29  float *prof_rh;
30  float *prof_height;
31  float *prof_q;
32 } anc_struc;
33 
34 // ancillary aerosol from GMAO MERRA model
35 typedef struct anc_aer_struc_def {
38  float *dust_ext;
39  float *dust_scat;
40  float *sea_salt_ext;
41  float *sea_salt_scat;
42  float *sulphur_ext;
43  float *sulphur_scat;
48 } anc_aer_struc;
49 
50 typedef struct l1_struct {
51  int32_t length; /* number of bytes allocated to data block */
52  int32_t npix;
53 
54  int32_t iscan;
55  int32_t detnum;
56  int32_t mside;
57 
58  /* scan-time-specific data */
59  double scantime;
60  double fsol;
61 
62  bool is_l2;
64  /* scan attributes */
65 
66  float tilt;
67  float alt; //altitude of sensor
68 
69  /* All parameters below are scan-length dependent */
70 
71  /* sensor band-pass-specific data */
72 
73 
74  char *data; /* points to start of variable-length data block */
75 
76  int32_t *nobs;
77  float *lon;
78  float *lat;
79  float *solz;
80  float *sola;
81  float *senz;
82  float *sena;
83  float *Lt;
84  float *Lt_unc;
85 
86  float *Ltir;
87  float *Bt;
88 
89  float *delphi;
90  float *csolz;
91  float *csenz;
92  int32_t *pixnum;
93  char *slot;
94  float *alpha;
95  float *scattang;
96 
97  float *ws;
98  float *wd;
99  float *mw;
100  float *zw;
101  float *pr;
102  float *oz;
103  float *wv;
104  float *rh;
105  float *no2_tropo;
106  float *no2_strat;
107  float *no2_frac;
108  float *sfcp;
109  float *sfcrh;
110  float *sfct;
111  float *icefr;
112  float *height;
113  float *elev;
114 
115  float *ws_unc;
116  float *wd_unc;
117  float *mw_unc;
118  float *zw_unc;
119  float *pr_unc;
120  float *oz_unc;
121  float *wv_unc;
122  float *rh_unc;
125 
126  // TODO: can get rid of this. Only used in setanc.c
127  short *ancqc;
128 
129 
130  short *ssttype; /* per pixel - reference type or climatology */
131 
132  int32_t *flags;
133  char *mask; // this group of params is the flags expanded into a byte
134  char *hilt;
135  char *cloud;
136  char *glint;
137  char *land;
138  char *swater;
139  char *ice;
140  char *solzmax;
141  char *senzmax;
142  char *stlight;
143  char *absaer;
144  char *navfail;
145  char *navwarn;
146 
147  char *filter;
148 
149  float *t_h2o;
150  float *t_o2;
151  float *tg_sol;
152  float *tg_sen;
153  float *t_sol;
154  float *t_sen;
155  float *rhof;
156  float *tLf;
157  float *Lr;
158  float *L_q;
159  float *L_u;
160  float *polcor;
161  float *dpol;
162  float *TLg;
163  float *rhos;
164  float *glint_coef;
165  float *cloud_albedo;
166  float *aerindex;
167  float *sstref;
168  float *sssref;
169  float *sw_n;
170  float *sw_a;
171  float *sw_bb;
172  float *sw_a_avg;
173  float *sw_bb_avg;
174  float *rho_cirrus;
175 
176  // TODO: move MERIS L1 to private_data pointer in l1rec
177  /* for MERIS L1 */
178  int32_t *pixdet; /* detector index of pixel */
179  float *radcor; /* smile correction */
180 
181 
182  float *Fo;
183 
184  // TODO: this needs to go into private_data pointer in filehandle
185  /* for VIIRS unaggregated and superscan */
186  int16_t scn_fmt; /* scan format of data, 0 std, else unaggregated */
187  float margin_s; /* extra scan margin beyond actual samples */
188 
189  filehandle *l1file;
190 
191  // pointer to data needed by specific readers so far just meris
193 
194  // geometry per band
195  geom_struc *geom_per_band;
196 
197  // added ancillary data, for CHIMAERA profiles, etc
198  anc_struc *anc_add;
199 
200  // ancillary aerosol information from MERRA-2
201  anc_aer_struc *anc_aerosol;
202 
203 } l1str;
204 #endif
205 
206 
207 
208 
float * organic_carbon_ext
Definition: l1_struc.h:44
float * polcor
Definition: l1_struc.h:160
float * prof_rh
Definition: l1_struc.h:29
char * slot
Definition: l1_struc.h:93
float * sssref
Definition: l1_struc.h:168
int16_t scn_fmt
Definition: l1_struc.h:186
float * sena
Definition: l1_struc.h:82
float * alpha
Definition: l1_struc.h:94
float * Lr
Definition: l1_struc.h:157
float * no2_strat
Definition: l1_struc.h:106
float * ws
Definition: l1_struc.h:97
int32_t iscan
Definition: l1_struc.h:54
char * navfail
Definition: l1_struc.h:144
float * height
Definition: l1_struc.h:112
geom_struc * geom_per_band
Definition: l1_struc.h:195
int32_t npix
Definition: l1_struc.h:52
float * Ltir
Definition: l1_struc.h:86
float * dpol
Definition: l1_struc.h:161
float * solz
Definition: l1_struc.h:79
float * TLg
Definition: l1_struc.h:162
float * sulphur_scat
Definition: l1_struc.h:43
float * sea_salt_ext
Definition: l1_struc.h:40
int32_t * nobs
Definition: l1_struc.h:76
char * stlight
Definition: l1_struc.h:142
anc_struc * anc_add
Definition: l1_struc.h:198
float * zw
Definition: l1_struc.h:100
float * ws_unc
Definition: l1_struc.h:115
float * no2_frac
Definition: l1_struc.h:107
filehandle * l1file
Definition: l1_struc.h:189
float * sola
Definition: l1_struc.h:20
float * scattang
Definition: l1_struc.h:23
float * Lt_unc
Definition: l1_struc.h:84
float * csolz
Definition: l1_struc.h:21
int32_t mside
Definition: l1_struc.h:56
float * sstref
Definition: l1_struc.h:167
float * sena
Definition: l1_struc.h:17
float * t_sol
Definition: l1_struc.h:153
float * total_aerosol_scat
Definition: l1_struc.h:47
float * zw_unc
Definition: l1_struc.h:118
void * private_data
Definition: l1_struc.h:192
float * L_u
Definition: l1_struc.h:159
float * csenz
Definition: l1_struc.h:18
int32_t detnum
Definition: l1_struc.h:55
float * tg_sen
Definition: l1_struc.h:152
float * total_aerosol_ext
Definition: l1_struc.h:46
float * t_sen
Definition: l1_struc.h:154
short * ssttype
Definition: l1_struc.h:130
float * sw_bb
Definition: l1_struc.h:171
float * icefr
Definition: l1_struc.h:111
char * senzmax
Definition: l1_struc.h:141
float * prof_height
Definition: l1_struc.h:30
float * wv_unc
Definition: l1_struc.h:121
float * csenz
Definition: l1_struc.h:91
int32_t * pixdet
Definition: l1_struc.h:178
float * rhof
Definition: l1_struc.h:155
float * Bt
Definition: l1_struc.h:87
bool is_l2
Definition: l1_struc.h:62
float * sw_a_avg
Definition: l1_struc.h:172
float * mw
Definition: l1_struc.h:99
int32_t * pixnum
Definition: l1_struc.h:92
float * dust_scat
Definition: l1_struc.h:39
float * tLf
Definition: l1_struc.h:156
float * organic_carbon_scat
Definition: l1_struc.h:45
float * prof_q
Definition: l1_struc.h:31
float * rh_unc
Definition: l1_struc.h:122
float * radcor
Definition: l1_struc.h:179
char * absaer
Definition: l1_struc.h:143
float * elev
Definition: l1_struc.h:113
float * rh
Definition: l1_struc.h:104
float * csolz
Definition: l1_struc.h:90
char * data
Definition: l1_struc.h:74
double fsol
Definition: l1_struc.h:60
int32_t * flags
Definition: l1_struc.h:132
float * senz
Definition: l1_struc.h:16
float * glint_coef
Definition: l1_struc.h:164
anc_aer_struc * anc_aerosol
Definition: l1_struc.h:201
float * Lt
Definition: l1_struc.h:83
float * mw_unc
Definition: l1_struc.h:117
short * ancqc
Definition: l1_struc.h:127
float * no2_tropo
Definition: l1_struc.h:105
float alt
Definition: l1_struc.h:67
float * sfcrh
Definition: l1_struc.h:109
float * no2_strat_unc
Definition: l1_struc.h:124
float margin_s
Definition: l1_struc.h:187
int32_t nlvl
Definition: l1_struc.h:27
float * wd_unc
Definition: l1_struc.h:116
float * sw_a
Definition: l1_struc.h:170
double scantime
Definition: l1_struc.h:59
float * sulphur_ext
Definition: l1_struc.h:42
float * lon
Definition: l1_struc.h:77
float * t_h2o
Definition: l1_struc.h:149
float * sea_salt_scat
Definition: l1_struc.h:41
char * cloud
Definition: l1_struc.h:135
float * prof_temp
Definition: l1_struc.h:28
char * land
Definition: l1_struc.h:137
float * black_carbon_ext
Definition: l1_struc.h:36
float * Fo
Definition: l1_struc.h:182
float * t_o2
Definition: l1_struc.h:150
float * sfcp
Definition: l1_struc.h:108
float * sw_bb_avg
Definition: l1_struc.h:173
float * no2_tropo_unc
Definition: l1_struc.h:123
float * scattang
Definition: l1_struc.h:95
float * sw_n
Definition: l1_struc.h:169
float * oz
Definition: l1_struc.h:102
float * cloud_albedo
Definition: l1_struc.h:165
float tilt
Definition: l1_struc.h:66
char * filter
Definition: l1_struc.h:147
float * oz_unc
Definition: l1_struc.h:120
float * rho_cirrus
Definition: l1_struc.h:174
char * swater
Definition: l1_struc.h:138
float * solz
Definition: l1_struc.h:19
float * pr
Definition: l1_struc.h:101
float * rhos
Definition: l1_struc.h:163
float * wv
Definition: l1_struc.h:103
float * lat
Definition: l1_struc.h:78
float * senz
Definition: l1_struc.h:81
char * glint
Definition: l1_struc.h:136
float * tg_sol
Definition: l1_struc.h:151
float * pr_unc
Definition: l1_struc.h:119
char * solzmax
Definition: l1_struc.h:140
char * mask
Definition: l1_struc.h:133
int32_t length
Definition: l1_struc.h:51
float * L_q
Definition: l1_struc.h:158
char * ice
Definition: l1_struc.h:139
char * hilt
Definition: l1_struc.h:134
float * sola
Definition: l1_struc.h:80
float * delphi
Definition: l1_struc.h:89
float * dust_ext
Definition: l1_struc.h:38
float * delphi
Definition: l1_struc.h:22
float * aerindex
Definition: l1_struc.h:166
float * sfct
Definition: l1_struc.h:110
float * black_carbon_scat
Definition: l1_struc.h:37
char * navwarn
Definition: l1_struc.h:145
float * wd
Definition: l1_struc.h:98