ocssw V2020
l12_proto.h
Go to the documentation of this file.
1 #ifndef _L12_PROTO_H
2 #define _L12_PROTO_H
3 
4 #include <stdint.h>
5 #include <sys/types.h>
6 #include <unistd.h>
7 #include <stdio.h>
8 #include <math.h>
9 #include <stdlib.h>
10 #include <libgen.h>
11 #include <string.h>
12 #include <ctype.h>
13 #include <netcdf.h>
14 
15 #include "input_struc.h"
16 #include "l12_parms.h"
17 #include "l1_struc.h"
18 #include "l1q_struc.h"
19 #include "l2_struc.h"
20 #include "target_struc.h"
21 #include "vcal_struc.h"
22 #include "filehandle.h"
23 #include "filter.h"
24 #include "l2_flags.h"
25 #include <timeutils.h>
26 #include "genutils.h"
27 #include "aer_struc.h"
28 #include "l2prod.h"
29 #include "l2prod_struc.h"
30 #include "dfutils.h"
31 #include "allocate2d.h"
32 #include "xcal.h"
33 #include "epr_api.h"
34 #include "scene_meta.h"
35 #include "l2_hdf_generic.h"
36 #include "flags_iop.h"
37 #include "table_io_wrapper.h"
38 #include <clo.h>
39 #include "navigation.h"
40 #include "read_l3bin.h"
41 #include "par_utils.h"
42 #include "smile.h"
43 #include "get_nitrate.h"
44 
45 #ifndef MAX
46 #define MAX(A,B) ((A) > (B) ? (A) : (B)) /* Greater of (A,B) */
47 #endif
48 
49 #ifndef MIN
50 #define MIN(A,B) ((A) < (B) ? (A) : (B)) /* Lesser of (A,B) */
51 #endif
52 //VIIRS aggregation zone pixel indexes (M-band)
53 #define AGZONE0 0
54 #define AGZONE1 640
55 #define AGZONE2 1008
56 #define AGZONE3 1600
57 #define AGZONE4 2192
58 #define AGZONE5 2560
59 
60 // Metadata standard strings
61 #define INSTITUTION "NASA Goddard Space Flight Center, Ocean Ecology Laboratory, Ocean Biology Processing Group"
62 #define LICENSE "https://science.nasa.gov/earth-science/earth-science-data/data-information-policy/"
63 #define NAMING_AUTHORITY "gov.nasa.gsfc.sci.oceandata"
64 #define KEYWORDS_VOCABULARY "NASA Global Change Master Directory (GCMD) Science Keywords"
65 #define STDNAME_VOCABULARY "CF Standard Name Table v36"
66 #define CREATOR_NAME "NASA/GSFC/OBPG"
67 #define CREATOR_EMAIL "data@oceancolor.gsfc.nasa.gov"
68 #define CREATOR_URL "https://oceandata.sci.gsfc.nasa.gov"
69 #define PROJECT "Ocean Biology Processing Group (NASA/GSFC/OBPG)"
70 #define PUBLISHER_NAME "NASA/GSFC/OBPG"
71 #define PUBLISHER_EMAIL "data@oceancolor.gsfc.nasa.gov"
72 #define PUBLISHER_URL "https://oceandata.sci.gsfc.nasa.gov"
73 
74 #ifdef __cplusplus
75 extern "C" {
76 #endif
77 
78 extern instr *input; /* input parameters structure */
79 
80 void filehandle_init(filehandle *file);
81 
82 int getl1rec(int32_t recnum, int32_t dscan, l1str *l1rec);
83 
84 int loadl1(filehandle *l1file, l1str *l1rec);
85 
86 int openl1(filehandle *l1file);
87 int readl1(filehandle *l1file, int32_t recnum, l1str *l1rec);
88 int readl1_lonlat(filehandle *l1file, int32_t recnum, l1str *l1rec);
89 int writel1(filehandle *l1file, int32_t recnum, l1str *l1rec);
90 void closel1(filehandle *l1file);
91 void closel1_generic(filehandle *l1file);
92 
93 int openl1_read_hdf(filehandle *l1file);
94 int openl1_write_hdf(filehandle *l1file);
95 int openl1_write(filehandle *l1file);
96 int writel1_hdf(filehandle *l1file, int32_t recnum, l1str *l1rec);
97 void closel1_hdf(filehandle *l1file);
98 
99 int openl2(filehandle *l2file);
100 int writel2(filehandle *l2file, int32_t recnum, l2str *l2rec, int outfile_number);
101 int closel2(filehandle *l2file);
102 //VOIDP scale_sds(float *data, l2prodstr *p, int nbands);
103 void update_flag_cnts(int32_t *flag_cnt, int32_t* flags, int32_t nflags, int32_t npix, uint32_t init_mask);
104 void update_flag_cnts16(int32_t *flag_cnt, int16_t* flags, int32_t nflags, int32_t npix, uint32_t init_mask);
105 void update_qual_cnts(int32_t *flag_cnt, int8_t* flags, int32_t nflags, int32_t npix);
106 int write_flag_pcnts(idDS ds_id, FILE *fpmeta, int32_t *flag_cnt, int32_t nflags, const char * const flag_lname[], int32_t numScans, int32_t numPixels);
107 int write_qual_flag_pcnts(idDS ds_id, FILE *fpmeta, int32_t *flag_cnt, int32_t nflags, const char * const flag_lname[]);
108 
109 int open_target(filehandle *file);
110 int read_target(filehandle *file, int32_t recnum, tgstr *tgrec);
111 void close_target(void);
112 
113 int open_aer(filehandle *file);
114 int read_aer(filehandle *file, int32_t recnum, aestr *aerec);
115 void close_aer(filehandle *file);
116 
117 void init_l1(l1str *l1rec);
118 void init_l2(l2str *l2rec, int32_t nbands);
119 
120 void free_l1q(void);
121 int32_t alloc_l1(filehandle *l1file, l1str *l1rec);
122 void free_l1(l1str *l1rec);
123 int32_t alloc_l2(l1str *l1rec, l2str *l2rec);
124 void free_l2(l2str *l2rec);
125 int32_t alloc_target(int32_t npix, int32_t nbands, tgstr *tgrec);
126 int32_t alloc_aer(int32_t npix, int32_t nbands, aestr *aerec);
127 
128 void init_l2prod();
129 l2prodstr *get_l2prod_index(char *name, int32 sensorID, int32 numBands, int32 numPixels,
130  int32 numScans, int32_t *wave);
131 void write_product_XML_file(char* filename);
132 
133 int32 prodlist(int32 sensorID, int32 evalmask, const char *inprod, const char *defprod, char outprod[MAXPROD][32]);
134 
135 int convl12(l1str *l1rec, l2str *l2rec, int32_t spix, int32_t epix, aestr *aerec);
136 int convl21(l2str *l2rec, tgstr *tgrec, int32_t spix, int32_t epix, float *Lt, vcstr *vrec);
137 
138 int32 l2_seawifs(filehandle *l1file, filehandle *l2file);
139 int32 l1b_seawifs(filehandle *l1file, filehandle *ofile,
140  int32 sscan, int32 escan, int32 dscan,
141  int32 spixl, int32 epixl, int32 dpixl);
142 int32 get_modis_calfile(int32 sd_id, char *file);
143 
144 int setanc(l1str *l1rec);
145 int setflags(l1str *l1rec);
146 void setflagbits(int level, l1str *l1rec, l2str *l2rec, int32_t ipix);
147 void l1_mask_set(l1str *l1rec, int32_t ip);
148 int modis_cloud_mask(l1str *l1rec, int32_t ip);
149 int modis_cirrus_mask(l1str *l1rec, int32_t ip);
150 
151 void cpl1rec(l1str *l1new, l1str *l1old);
152 
153 int b128_msk_init(char *landfile, int msknum);
154 int b128_msk_get(float lat, float lon, int msknum);
155 int land_mask_init(char *file);
156 int land_mask(float lat, float lon);
157 int bath_mask_init(char *file);
158 int bath_mask(float lat, float lon);
159 int get_height(char *demfile, l1str *l1rec, int32_t ip, int terrain_corrected);
160 void free_deminfo();
161 
162 int32_t rdsensorinfo(int32_t sensorID, int32_t evalmask, const char *pname, void **pval);
163 void lowercase(char *s);
164 
165 void atmocor1(l1str *l1rec, int32_t ip);
166 int atmocor2(l2str *l2rec, aestr *aerec, int32_t ip);
167 void whitecaps(int32_t sensorID, int32_t evalmask, int32_t nwave, float ws, float ws_max, float rhof[]);
168 void rayleigh(l1str *l1rec, int32_t ip);
169 int aerosol(l2str *l2rec, int32_t aer_opt_in, aestr *aerec, int32_t ip,
170  float wave[], int32_t nwave, int32_t nir_s_in, int32_t nir_l_in,
171  float F0_in[], float La1_in[], float La2_out[],
172  float t_sol_out[], float t_sen_out[], float *eps, float taua_out[],
173  int32_t *modmin, int32_t *modmax, float *modrat,
174  int32_t *modmin2, int32_t *modmax2, float *modrat2);
175 void gaseous_transmittance(l1str *l1rec, int32_t ip);
176 
177 float ky_airmass(float theta);
178 float pp_airmass(float theta);
179 
180 void get_rhown_nir(char *fqfile, float Rrs[], float wave[], int32_t nir_s, int32_t nir_l,
181  float aw[], float bbw[], float chl, float rhown[]);
182 void get_rhown_eval(char *fqfile, float Rrs[], float wave[], int32_t nir_s, int32_t nir_l,
183  int32_t nwave, float aw[], float bbw[], float chl,
184  float solz, float senz, float phi, float rhown[]);
185 void get_rho_mumm(l2str *l2rec, int32_t ip, int32_t iw, float *rhom);
186 void get_rhown_mumm(l2str *l2rec, int32_t ip, int32_t nir_s, int32_t nir_l, float rhown[]);
187 void glint_rad(int32_t num_iter, int32_t nband, int32_t nir_s, int32_t nir_l,
188  float glint_coef, float air_mass,
189  float mu0, float F0[], float taur[], float taua[], float La[], float TLg[]);
190 
191 float fresnel_coef(float mu, float n);
192 float fresnel_sen(float senz, int return_tf);
193 void fresnel_sol(float wave[], int32_t nwave, float solz, float ws, float brdf[], int return_tf);
194 void foqint_morel(char *file, float wave[], int32_t nwave, float solz, float senzp,
195  float phi, float chl, float brdf[]);
196 void qint_morel(float wave[], int32_t nwave, float solz, float chl, float Qn[]);
197 void gothic_R(float wave[], int32_t nwave, float solz, float senz, float ws, float R[]);
198 int ocbrdf(l2str *l2rec, int32_t ip, int32_t brdf_opt, float wave[], int32_t nwave,
199  float solz, float senz, float phi, float ws, float chl, float nLw[], float Fo[], float brdf[]);
200 
201 void nlw_outband(int32_t evalmask, int32_t sensorID, float wave[], int32_t nwave, float Lw[], float nLw[]);
202 
203 int l2gen_usage(const char *prog);
204 int msl12_input_defaults(filehandle *l1file);
205 void msl12_input_init();
206 int l2gen_init_options(clo_optionList_t* list, const char* prog);
207 int msl12_option_input(int argc, char *argv[], clo_optionList_t* list,
208  char *progName, filehandle *l1file);
209 int msl12_input(int argc, char *argv[], const char* progName, filehandle *l1file);
210 
211 int l1subpix(filehandle *l1file, l1str *l1rec);
212 
213 int windex(float wave, float twave[], int ntwave);
214 int invbindx(int band, int32_t *bindx, int nbands);
215 void bindex_set(int32_t wave[], int nwave, int dwave);
216 int windex_get(int32_t wave);
217 int bindex_get(int32_t wave);
218 int bindex_get_555(void);
219 
220 float bin_climatology(char *l3file, int32_t day, float lon, float lat, char *prodname);
221 
222 float get_default_chl(l2str *l2rec, float Rrs[]);
223 void get_chl(l2str *l2rec, int prodnum, float prod[]);
224 void get_las(l2str *l2rec, l2prodstr *p, float prod[]);
225 //void get_sma(l2str *l2rec, int32_t prodID, float prod[]);
226 void get_tsm(l2str *l2rec, int prodnum, float prod[]);
227 void get_poc(l2str *l2rec, int prodnum, float prod[]);
228 void get_flh(l2str *l2rec, float flh[]);
229 void get_fsat(l2str *l2rec, float flh[]);
230 void get_fsat2(l2str *l2rec, float flh[]);
231 void get_fqy(l2str *l2rec, float fqy[]);
232 void get_fqy2(l2str *l2rec, float fqy[]);
233 void get_ipar(l2str *l2rec, float ipar[]);
234 void get_ipar2(l2str *l2rec, float ipar[]);
235 void get_depth(l2str *l2rec, float depth[]);
236 void get_par(l2str *l2rec, float par[]);
237 void get_bsi(l2str *l2rec, float BSi[]);
238 void get_ssn(l2str *l2rec, float ssn[]);
239 void get_angstrom(l2str *l2rec, int band, float angst[]);
240 void get_ms_epsilon(l2str *l2rec, float eps[]);
241 void get_es(l2str *l2rec, int band, float es[]);
242 void get_toa_refl(l2str *l2rec, int band, float rhot[]);
243 void get_dust_index(l2str *l2rec, float dust[]);
244 void get_ndvi_evi(l1str *l1rec, int prodnum, float prod[]);
245 void get_ndvi(l1str *l1rec, float ndvi[]);
246 void get_evi(l1str *l1rec, float evi[]);
247 void get_evi2(l1str *l1rec, float evi2[]);
248 void get_evi3(l1str *l1rec, float evi3[]);
249 void get_smoke(l2str *l2rec, float smoke[]);
250 void get_Kd(l2str *l2rec, l2prodstr *p, float Kd[]);
251 void get_photic_depth(l2str *l2rec, l2prodstr *p, float Z[]);
252 void cdom_morel(l2str *l2rec, l2prodstr *p, float prod[]);
253 void cdom_mannino(l2str *l2rec, int prodnum, float prod[]);
254  //void get_soa(l2str *l2rec, int32_t prodID, float prod[]);
255  //int run_soa_sma(l2str *l2rec, int32_t ip);
256 void vcal(l2str *l2rec, l2prodstr *p, float vcal[]);
257 double *get_xcal(l1str *l1rec, int type, int bandnum);
258 double *get_fpm_xcal(char *fpm_file); //added by Sudipta to support FPM based band correction
259 float aw_spectra(int32_t wl, int32_t width);
260 float bbw_spectra(int32_t wl, int32_t width);
261 void get_aw_bbw(l2str *l2rec, float wave[], int nwave, float *aw, float *bbw);
262 float seawater_nsw(float wave, float sst, float sss, float *dnswds);
263 float seawater_bb(float wave, float sst, float sss, double delta);
264 void seawater_set(l1str *l1rec);
265 float seawater_get_n(int32_t ip, int32_t ib);
266 float seawater_get_a(int32_t ip, int32_t ib);
267 float seawater_get_bb(int32_t ip, int32_t ib);
268 void get_bbws(l2str *l2rec, l2prodstr *p, float prod[]);
269 
270 int atmocor1_land(l1str *l1rec, int32_t ip);
271 void polcor(l1str *l1rec, int32_t ip);
272 int get_rhos(l1str *l1rec, int32_t ip);
273 int8 *get_qual_sst(l2str *l2rec);
274 int8 *get_qual_sst4(l2str *l2rec);
275 int8 *get_qual_sst_triple(l2str *l2rec);
276 int16 *get_flags_sst(l2str *l2rec);
277 int16 *get_flags_sst4(l2str *l2rec);
278 int16 *get_flags_sst_triple(l2str *l2rec);
279 float *get_sst_dust_correction(l2str *l2rec);
280 float *get_sst(l2str *l2rec);
281 float *get_sst4(l2str *l2rec);
282 float *get_sst_triple(l2str *l2rec);
283 float *get_bias_sst(l2str *l2rec);
284 float *get_bias_sst4(l2str *l2rec);
285 float *get_bias_sst_triple(l2str *l2rec);
286 float *get_stdv_sst(l2str *l2rec);
287 float *get_stdv_sst4(l2str *l2rec);
288 float *get_stdv_sst_triple(l2str *l2rec);
289 float *get_bias_mean_sst(l2str *l2rec);
290 float *get_bias_mean_sst4(l2str *l2rec);
291 float *get_bias_mean_sst_triple(l2str *l2rec);
292 int16 *get_counts_sst(l2str *l2rec);
293 int16 *get_counts_sst4(l2str *l2rec);
294 int16 *get_counts_sst_triple(l2str *l2rec);
295 
296 void radiance2bt(l1str *l1rec, int resolution);
297 float get_sstref(short reftyp, char *file, l1str *l1rec, int32_t ip);
298 float get_sssref(char *file, float lon, float lat, int day);
299 void calcite(l2str *l2rec, l2prodstr *p, float caco3[]);
300 void tindx_morel(l2str *l2rec, int32_t ip, float *tindx);
301 void tindx_shi(l2str *l2rec, int32_t ip, float *tindx);
302 float conv_rrs_to_555(float Rrs, float wave);
303 
304 float water_vapor(int ib, float wv, float airmass);
305 int ice_mask_init(char *file, int year, int day, float threshold);
306 char ice_mask(float lon, float lat);
307 float ice_fraction(float lon, float lat);
308 void get_ice_frac(l2str *l2rec, float ice[]);
309 void get_tauc(l2str *l2rec, float tauc[]);
310 void get_mgiop(l2str *l2rec, l2prodstr *p, float prod[]);
311 void get_gsm(l2str *l2rec, l2prodstr *p, float prod[]);
312 int16 *get_iter_gsm(l2str *l2rec);
313 void iops_gsm(l2str *l2rec);
314 void get_giop(l2str *l2rec, l2prodstr *p, float prod[]);
315 int16 *get_iter_giop(l2str *l2rec);
316 int16 *get_flags_giop(l2str *l2rec);
317 void iops_giop(l2str *l2rec);
318 void get_carder(l2str *l2rec, l2prodstr *p, float prod[]);
319 int16 *get_flags_carder(l2str *l2rec);
320 void iops_carder(l2str *l2rec);
321 void chl_carder_empirical(l2str *l2rec, float prod[]);
322 void get_pml(l2str *l2rec, l2prodstr *p, float prod[]);
323 void iops_pml(l2str *l2rec);
324 void get_qaa(l2str *l2rec, l2prodstr *p, float prod[]);
325 unsigned char *get_flags_qaa(l2str *l2rec);
326 void iops_qaa(l2str *l2rec);
327 void get_niwa(l2str *l2rec, l2prodstr *p, float prod[]);
328 void iops_niwa(l2str *l2rec);
329 int16 *get_flags_niwa(l2str *l2rec);
330 void iops_las(l2str *l2rec);
331 int get_bbp_qaa(l2str *l2rec, int ip, float tab_wave[], float tab_bbp[], int tab_nwave);
332 int get_bbp_las(l2str *l2rec, int ip, float tab_wave[], float tab_bbp[], int tab_nwave);
333 float get_bbp_las_eta(l2str *l2rec, int ip);
334 float get_bbp_las_eta_ksm(l2str *l2rec, int ip);
335 void get_iops(l2str *l2rec, int32_t iop_opt);
336 void set_iop_flag(float32 wave[], int32 nwave,
337  float32 a[], float32 aph[], float32 adg[],
338  float32 bb[], float32 bbp[], int16 *flag);
339 float aph_bricaud(float wave, float chl);
340 float aph_ciotti(float wave, float sf);
341 float get_aphstar(float wave, int dwave, int ftype, float proxy);
342 float rrs_above_to_below(float Rrs);
343 void optical_class(l2str *l2rec, l2prodstr *p, float prod[]);
344 float *get_class_ward_owmc(l2str *l2rec);
345 float *get_class_k_owmc(l2str *l2rec);
346 float *get_class_34k_w_owmc(l2str *l2rec);
347 
348  /*
349 void myprod1(l2str *l2rec, float prod[]);
350 void myprod2(l2str *l2rec, float prod[]);
351 void myprod3(l2str *l2rec, float prod[]);
352 void myprod4(l2str *l2rec, float prod[]);
353 void myprod5(l2str *l2rec, float prod[]);
354 void myprod6(l2str *l2rec, float prod[]);
355 void myprod7(l2str *l2rec, float prod[]);
356 void myprod8(l2str *l2rec, float prod[]);
357 void myprod9(l2str *l2rec, float prod[]);
358 void myprod10(l2str *l2rec, float prod[]);
359  */
360 
361 int get_f0_neckel(int32_t wl, int32_t width, float *f0);
362 int get_f0_thuillier(int32_t wl, int32_t width, float *f0);
363 void get_f0_thuillier_ext(int32_t wl, int32_t width, float *f0);
364 
365 float32 westernmost(float32 lon1, float32 lon2);
366 float32 easternmost(float32 lon1, float32 lon2);
367 
368 /* Filter functions */
369 
370 void fctl_init(fctlstr *fctl);
371 int fctl_set(fctlstr *fctl, int32_t npix, char *fname,
372  int32_t band, int32_t nx, int32_t ny, int32_t minfill, int32_t nbands);
373 void filter(fctlstr *fctl, l1qstr *l1que, l1str *l1rec, int32_t dscan);
374 int rdfilter(char *file, fctlstr *fctl, int32_t nbands);
375 void fdilate(l1qstr *l1que, int32_t nx, int32_t ny, int flag, char kernel[], l1str *l1rec);
376 void fclean(l1qstr *l1que, int32_t nx, int32_t ny, int flag, char kernel[], l1str *l1rec);
377 void fLTmean(l1qstr *l1que, int32_t nx, int32_t ny, int ib, int32_t minfill, char kernel[], l1str *l1rec);
378 void fLTRmean(l1qstr *l1que, int32_t nx, int32_t ny, int ib, int32_t minfill, char kernel[], l1str *l1rec);
379 void fLTmed(l1qstr *l1que, int32_t nx, int32_t ny, int ib, int32_t minfill, char kernel[], l1str *l1rec);
380 void fLTRmed(l1qstr *l1que, int32_t nx, int32_t ny, int ib, int32_t minfill, char kernel[], l1str *l1rec);
381 void fEPSmean(l1qstr *l1que, int32_t nx, int32_t ny, int ib, int32_t minfill, char kernel[], l1str *l1rec);
382 void fEPSiqmean(l1qstr *l1que, int32_t nx, int32_t ny, int ib, int32_t minfill, char kernel[], l1str *l1rec);
383 void fLTRiqmean(l1qstr *l1que, int32_t nx, int32_t ny, int ib, int32_t minfill, char kernel[], l1str *l1rec);
384 void fLTrat(l1qstr *l1que, int32_t nx, int32_t ny, l1str *l1rec);
385 
386 /* viirs pixel conversion */
387 void viirs_pxcvt_2uag(int, int *, int *);
388 void viirs_pxcvt_2ag(int, int *);
389 void viirs_pxcvt_agdel(int, int, int *);
390 void flag_bowtie_deleted(l1str *l1rec, size_t ipix, int extract_offset);
391 
392 /* Fortran functions called from C */
393 
394 void sunangs_(int *iyr, int *iday, float *gmt, float *xlon, float *ylat,
395  float *sunz, float *suna);
396 int getglint_(float *, float *, float *, float *, float *, float *);
397 int getglint_iqu_(float *, float *, float *, float *, float *, float *, float *, float *);
398 double esdist_(int32_t *year, int32_t *day, int32_t *msec);
399 void get_um_prod_(int32_t* idProd, int32_t* pix, float* val);
400 void clear_um_prod_();
401  /*
402 int atmcor_soa_(
403  int32_t *sensorID,
404  char *sensorNm,
405  int32_t *nwave,
406  float *wave,
407  int32_t *scan,
408  int32_t *pixel,
409  float *solz,
410  float *senz,
411  float *raz,
412  float *lat,
413  float *lon,
414  float *Lt,
415  float *rho_r,
416  float *Fo,
417  float *Tau_r,
418  float *aw,
419  float *bbw,
420  float *aphstar,
421  float *adg_s,
422  float *bbp_s,
423  float *Rs,
424  float *Rw,
425  float *wv,
426  float *t_sen,
427  float *t_sol,
428  float *optTaua,
429  float *optW0,
430  float *optChl,
431  float *optAcdm,
432  float *pcentCDM,
433  float *optBbp,
434  float *optMr,
435  float *optMi,
436  float *optV,
437  int32_t *status);
438  */
439 
440 void get_fdiff(l2str *l2rec, float fdiff[]);
441 
442 void get_cdom_morel(l2str *l2rec, l2prodstr *p, float prod[]);
443 
444 void optical_water_type(l2str *l2rec, l2prodstr *p, void *vptr);
445 
446 VOIDP prodgen(l2prodstr *p, l2str *l2rec);
447 
448 void virtual_constellation(l2str *l2rec, l2prodstr *p, float prod[]);
449 void bioOptBandShift(l2str *l2rec, l2prodstr *p, float prod[]);
450 
451 void get_swim(l2str *l2rec, l2prodstr *p, float prod[]);
452 void iops_swim(l2str *l2rec);
453 
454 int compfloat(float *x, float *y);
455 void elev_init(char* elevFilename, char* elevAuxFilename);
456 float get_elev(float lat, float lon);
457 
458 int read_target_l3(filehandle *file, l1str *l1rec, int32_t nbands, tgstr *tgrec);
459 int ncio_dim_siz(int, char *);
460 int ncio_grab_f_ds(int, char *, float *);
461 int ncio_grab_stdsclf_ds(int, char *, float, float *);
462 
463 float get_mld(char* mldfile, float lon, float lat, int day);
464 void get_pft_hirata(l2str *l2rec, l2prodstr *p, float prod[]);
465 void get_pft_uitz(l2str *l2rec, l2prodstr *p, float prod[]);
466 void get_npp(l2str *l2rec, int32_t, float prod[]);
467 float chl_abi(l2str *l2rec, float nLw[]);
468 
469 void run_raman_cor(l2str *l2rec, int ip);
470 void get_bpar(l2str *l2rec, l2prodstr *p, float prod[]) ;
471 
472 void get_habs_ci(l2str *l2rec, l2prodstr *p, float ci[]);
473 void get_habs_mph(l2str *l2rec, l2prodstr *p, float mph_chl[]);
474 uint8_t* get_flags_habs_mph(l2str *l2rec);
475 uint8_t* get_flags_habs(l2str *l2rec);
476 char get_cldmask(l1str *l1rec, int32_t ip);
477 void get_psd_ksm(l2str *l2rec, l2prodstr *p, float prod[]);
478 int init_geom_per_band(l1str *);
479 int geom_per_band_deriv(l1str *);
480 int destroy_geom_per_band(geom_struc *);
481 
482 float* giop_get_aph_pointer();
483 float* giop_get_adg_pointer();
484 float* giop_get_bbp_pointer();
485 float* giop_get_bbp_s_pointer();
486 void run_giop(l2str *l2rec);
487 int giop_ran(int recnum);
488 
489 #ifdef __cplusplus
490 }
491 #endif
492 
493 #endif
float pp_airmass(float theta)
Definition: airmass.c:14
float * giop_get_aph_pointer()
Definition: giop.c:2782
int aerosol(l2str *l2rec, int32_t aer_opt_in, aestr *aerec, int32_t ip, float wave[], int32_t nwave, int32_t nir_s_in, int32_t nir_l_in, float F0_in[], float La1_in[], float La2_out[], float t_sol_out[], float t_sen_out[], float *eps, float taua_out[], int32_t *modmin, int32_t *modmax, float *modrat, int32_t *modmin2, int32_t *modmax2, float *modrat2)
Definition: aerosol.c:4134
int32_t alloc_l1(filehandle *l1file, l1str *l1rec)
Definition: alloc_l1.c:17
void get_fsat2(l2str *l2rec, float flh[])
int32 l1file(int32 sdfid, int32 *nsamp, int32 *nscans, int16 *dtynum)
Definition: l1stat_chk.c:586
subroutine dust
Definition: 6sm1.f:3800
void calcite(l2str *l2rec, l2prodstr *p, float caco3[])
Definition: calcite.c:514
char ice_mask(float lon, float lat)
Definition: ice_mask.c:992
void l1_mask_set(l1str *l1rec, int32_t ip)
Definition: setflags.c:23
void get_gsm(l2str *l2rec, l2prodstr *p, float prod[])
Definition: gsm.c:717
integer, parameter int16
Definition: cubeio.f90:3
double * get_fpm_xcal(char *fpm_file)
Definition: xcal.c:331
int convl21(l2str *l2rec, tgstr *tgrec, int32_t spix, int32_t epix, float *Lt, vcstr *vrec)
Definition: convl21.c:15
const int bindx[3]
Definition: DbLutNetcdf.cpp:31
u5 which has been done in the LOCALGRANULEID metadata should have an extension NRT It is requested to identify the NRT production Changes from v6 which may affect scientific the sector rotation may actually occur during one of the scans earlier than the one where it is first reported As a the b1 values are about the LOCALGRANULEID metadata should have an extension NRT It is requested to identify the NRT to fill pixels affected by dead subframes with a special value Output the metadata of noisy and dead subframe Dead Subframe EV and Detector Quality Flag2 Removed the function call of Fill_Dead_Detector_SI to stop interpolating SI values for dead but also for all downstream products for science test only Changes from v5 which will affect scientific to conform to MODIS requirements Removed the Mixed option from the ScanType in the code because the L1A Scan Type is never Mixed Changed for ANSI C compliance and comments to better document the fact that when the HDF_EOS metadata is stricly the and products are off by and in the track respectively Corrected some misspelling of RCS swir_oob_sending_detector to the Reflective LUTs to enable the SWIR OOB correction detector so that if any of the sending detectors becomes noisy or non near by good detectors from the same sending band can be specified as the substitute in the new look up table Code change for adding an additional dimension of mirror side to the Band_21_b1 LUT to separate the coefficient of the two mirror sides for just like other thermal emissive so that the L1B code can calibrate Band scan to scan with mirror side dependency which leads better calibration result Changes which do not affect scientific when the EV data are not provided in this Crosstalk Correction will not be performed to the Band calibration data Changes which do not affect scientific and BB_500m in L1A Logic was added to turn off the or to spatial aggregation processes and the EV_250m_Aggr1km_RefSB and EV_500m_Aggr1km_RefSB fields were set to fill values when SDSs EV_250m and EV_500m are absent in L1A file Logic was added to skip the processing and turn off the output of the L1B QKM and HKM EV data when EV_250m and EV_500m are absent from L1A In this the new process avoids accessing and reading the and L1A EV skips and writing to the L1B and EV omits reading and subsampling SDSs from geolocation file and writing them to the L1B and omits writing metadata to L1B and EV and skips closing the L1A and L1B EV and SDSs Logic was added to turn off the L1B OBC output when the high resolution OBC SDSs are absent from L1A This is accomplished by skipping the openning the writing of metadata and the closing of the L1B OBC hdf which is Bit in the scan by scan bit QA flags
Definition: HISTORY.txt:361
void fLTRmean(l1qstr *l1que, int32_t nx, int32_t ny, int ib, int32_t minfill, char kernel[], l1str *l1rec)
Definition: filter.c:671
void get_dust_index(l2str *l2rec, float dust[])
void elev_init(char *elevFilename, char *elevAuxFilename)
Definition: elev.c:66
int get_rhos(l1str *l1rec, int32_t ip)
Definition: get_rhos.c:23
float get_mld(char *mldfile, float lon, float lat, int day)
Definition: get_mld.cpp:347
void fLTRmed(l1qstr *l1que, int32_t nx, int32_t ny, int ib, int32_t minfill, char kernel[], l1str *l1rec)
Definition: filter.c:1091
int setflags(l1str *l1rec)
Definition: setflags.c:36
subroutine kernel(is, mu, rm, xpl, psl, bp)
Definition: 6sm1.f:4700
void get_rho_mumm(l2str *l2rec, int32_t ip, int32_t iw, float *rhom)
Definition: mumm.c:25
void filter(fctlstr *fctl, l1qstr *l1que, l1str *l1rec, int32_t dscan)
Definition: filter.c:1396
int32_t day
void lowercase(char *s)
int msl12_input(int argc, char *argv[], const char *progName, filehandle *l1file)
Definition: msl12_input.c:4722
void iops_niwa(l2str *l2rec)
Definition: get_niwa_iop.c:109
void get_fqy2(l2str *l2rec, float fqy[])
int atmocor2(l2str *l2rec, aestr *aerec, int32_t ip)
Definition: atmocor2.c:11
void fLTRiqmean(l1qstr *l1que, int32_t nx, int32_t ny, int ib, int32_t minfill, char kernel[], l1str *l1rec)
Definition: filter.c:1164
float get_sstref(short reftyp, char *file, l1str *l1rec, int32_t ip)
Definition: sstref.c:1592
int l2gen_init_options(clo_optionList_t *list, const char *prog)
Definition: msl12_input.c:717
void get_evi(l1str *l1rec, float evi[])
Definition: get_ndvi.c:63
void get_poc(l2str *l2rec, int prodnum, float prod[])
Definition: get_poc.c:81
float get_aphstar(float wave, int dwave, int ftype, float proxy)
Definition: aph.c:296
l2prodstr * get_l2prod_index(char *name, int32 sensorID, int32 numBands, int32 numPixels, int32 numScans, int32_t *wave)
float aph_ciotti(float wave, float sf)
Definition: aph.c:190
int getl1rec(int32_t recnum, int32_t dscan, l1str *l1rec)
Definition: getl1rec.c:119
float32 xlon[LAC_PIXEL_NUM]
Definition: l1a_seawifs.c:91
float fresnel_coef(float mu, float n)
Definition: aerosol.c:1027
int ncio_dim_siz(int, char *)
Definition: ncio.c:18
string fname
Definition: mie_kernal.py:124
int readl1_lonlat(filehandle *l1file, int32_t recnum, l1str *l1rec)
Definition: l1_io.c:587
int closel2(filehandle *l2file)
Definition: l2_generic.c:1444
float get_bbp_las_eta(l2str *l2rec, int ip)
Definition: las_iop.c:627
void get_ndvi_evi(l1str *l1rec, int prodnum, float prod[])
Definition: get_ndvi.c:203
void close_target(void)
Definition: target_io.c:35
int read_target(filehandle *file, int32_t recnum, tgstr *tgrec)
Definition: target_io.c:103
int writel1_hdf(filehandle *l1file, int32_t recnum, l1str *l1rec)
int open_aer(filehandle *file)
Definition: aer_io.c:73
void fresnel_sol(float wave[], int32_t nwave, float solz, float ws, float brdf[], int return_tf)
Definition: brdf.c:160
int16 * get_flags_carder(l2str *l2rec)
Definition: carder.c:948
float seawater_get_n(int32_t ip, int32_t ib)
Definition: seawater_get.c:17
void get_tauc(l2str *l2rec, float tauc[])
int openl1_read_hdf(filehandle *l1file)
int16 * get_flags_niwa(l2str *l2rec)
Definition: get_niwa_iop.c:99
uint8_t * get_flags_habs(l2str *l2rec)
Definition: get_habs.c:664
float aph_bricaud(float wave, float chl)
Definition: aph.c:181
int32_t alloc_target(int32_t npix, int32_t nbands, tgstr *tgrec)
Definition: alloc_target.c:12
void iops_carder(l2str *l2rec)
Definition: carder.c:1013
this program makes no use of any feature of the SDP Toolkit that could generate such a then geolocation is calculated at that resolution
Definition: HISTORY.txt:188
int32 l2_seawifs(filehandle *l1file, filehandle *l2file)
void foqint_morel(char *file, float wave[], int32_t nwave, float solz, float senzp, float phi, float chl, float brdf[])
Definition: brdf.c:314
void get_photic_depth(l2str *l2rec, l2prodstr *p, float Z[])
Definition: photic_depth.c:303
int getglint_(float *, float *, float *, float *, float *, float *)
read l1rec
void get_smoke(l2str *l2rec, float smoke[])
Definition: get_smoke.c:20
PARAM_TYPE_NONE Default value No parameter is buried in the product name name_prefix is case insensitive string compared to the product name PARAM_TYPE_VIS_WAVE The visible wavelength bands from the sensor are buried in the product name The product name is compared by appending and name_suffix ie aph_412_giop where prod_ix will be set to PARAM_TYPE_IR_WAVE same search method as PARAM_TYPE_VIS_WAVE except only wavelength above are looped through but prod_ix is still based ie aph_2_giop for the second band
void set_iop_flag(float32 wave[], int32 nwave, float32 a[], float32 aph[], float32 adg[], float32 bb[], float32 bbp[], int16 *flag)
int msl12_option_input(int argc, char *argv[], clo_optionList_t *list, char *progName, filehandle *l1file)
void get_angstrom(l2str *l2rec, int band, float angst[])
Definition: aerosol.c:4737
void close_aer(filehandle *file)
void viirs_pxcvt_agdel(int, int, int *)
Definition: viirs_pxcvt.c:106
void tindx_shi(l2str *l2rec, int32_t ip, float *tindx)
Definition: turbid.c:4
uint8_t * get_flags_habs_mph(l2str *l2rec)
Definition: get_habs.c:347
float * get_class_34k_w_owmc(l2str *l2rec)
Definition: get_owmc.c:214
int ice_mask_init(char *file, int year, int day, float threshold)
Definition: ice_mask.c:899
void get_ipar2(l2str *l2rec, float ipar[])
list(APPEND LIBS ${NETCDF_LIBRARIES}) list(APPEND LIBS $
Definition: CMakeLists.txt:9
int setanc(l1str *l1rec)
Definition: setanc.c:563
int open_target(filehandle *file)
Definition: target_io.c:77
#define VOIDP
Definition: hdf5utils.h:11
int destroy_geom_per_band(geom_struc *)
float * giop_get_adg_pointer()
Definition: giop.c:2768
float conv_rrs_to_555(float Rrs, float wave)
Definition: convert_band.c:17
char get_cldmask(l1str *l1rec, int32_t ip)
Definition: cloud_flag.c:345
float mu
void rayleigh(l1str *l1rec, int32_t ip)
Definition: rayleigh.c:42
float * get_bias_mean_sst(l2str *l2rec)
Definition: sst.c:7657
float * lat
int32 * msec
Definition: l1_czcs_hdf.c:30
void get_fdiff(l2str *l2rec, float fdiff[])
float chl_abi(l2str *l2rec, float nLw[])
Definition: get_chl.c:432
void gaseous_transmittance(l1str *l1rec, int32_t ip)
Definition: gas_trans.c:438
float get_default_chl(l2str *l2rec, float Rrs[])
Definition: get_chl.c:478
void polcor(l1str *l1rec, int32_t ip)
Definition: polcor.c:15
float * get_sst_dust_correction(l2str *l2rec)
Definition: sst.c:7379
int16 * get_flags_sst_triple(l2str *l2rec)
Definition: sst.c:7592
float * giop_get_bbp_pointer()
Definition: giop.c:2775
void get_ndvi(l1str *l1rec, float ndvi[])
Definition: get_ndvi.c:31
void msl12_input_init()
Definition: msl12_input.c:506
void cpl1rec(l1str *l1new, l1str *l1old)
Definition: cpl1rec.c:6
int l1subpix(filehandle *l1file, l1str *l1rec)
Definition: l1subpix.c:19
int modis_cirrus_mask(l1str *l1rec, int32_t ip)
Definition: cloud_flag.c:94
void viirs_pxcvt_2ag(int, int *)
Definition: viirs_pxcvt.c:62
unsigned char * get_flags_qaa(l2str *l2rec)
Definition: get_qaa.c:253
int windex_get(int32_t wave)
void fLTrat(l1qstr *l1que, int32_t nx, int32_t ny, l1str *l1rec)
int bindex_get(int32_t wave)
Definition: windex.c:43
int ocbrdf(l2str *l2rec, int32_t ip, int32_t brdf_opt, float wave[], int32_t nwave, float solz, float senz, float phi, float ws, float chl, float nLw[], float Fo[], float brdf[])
Definition: brdf.c:40
int rdfilter(char *file, fctlstr *fctl, int32_t nbands)
Definition: filter.c:300
void optical_class(l2str *l2rec, l2prodstr *p, float prod[])
int32 prodlist(int32 sensorID, int32 evalmask, const char *inprod, const char *defprod, char outprod[MAXPROD][32])
Definition: prodlist.c:3
void get_bbws(l2str *l2rec, l2prodstr *p, float prod[])
Definition: seawater.c:254
VOIDP prodgen(l2prodstr *p, l2str *l2rec)
Definition: prodgen.c:89
float * giop_get_bbp_s_pointer()
Definition: giop.c:2797
int l2gen_usage(const char *prog)
Definition: msl12_input.c:4775
no change in intended resolving MODur00064 Corrected handling of bad ephemeris attitude resolving resolving GSFcd00179 Corrected handling of fill values for[Sensor|Solar][Zenith|Azimuth] resolving MODxl01751 Changed to validate LUT version against a value retrieved from the resolving MODxl02056 Changed to calculate Solar Diffuser angles without adjustment for estimated post launch changes in the MODIS orientation relative to incidentally resolving defects MODxl01766 Also resolves MODxl01947 Changed to ignore fill values in SCI_ABNORM and SCI_STATE rather than treating them as resolving MODxl01780 Changed to use spacecraft ancillary data to recognise when the mirror encoder data is being set by side A or side B and to change calculations accordingly This removes the need for seperate LUTs for Side A and Side B data it makes the new LUTs incompatible with older versions of the and vice versa Also resolves MODxl01685 A more robust GRing algorithm is being which will create a non default GRing anytime there s even a single geolocated pixel in a granule Removed obsolete messages from seed file
Definition: HISTORY.txt:413
void free_l2(l2str *l2rec)
Definition: alloc_l2.c:7
instr * input
int land_mask(float lat, float lon)
Definition: read_mask.c:31
void get_um_prod_(int32_t *idProd, int32_t *pix, float *val)
int openl2(filehandle *l2file)
Definition: l2_generic.c:220
int compfloat(float *x, float *y)
Definition: filter.c:728
void radiance2bt(l1str *l1rec, int resolution)
Definition: brightness.c:168
int readl1(filehandle *l1file, int32_t recnum, l1str *l1rec)
Definition: l1_io.c:400
l1qstr l1que
Definition: getl1rec.c:7
float ky_airmass(float theta)
Definition: airmass.c:4
void filehandle_init(filehandle *file)
void get_habs_ci(l2str *l2rec, l2prodstr *p, float ci[])
Definition: get_habs.c:80
int b128_msk_init(char *landfile, int msknum)
Definition: b128_msk_get.c:30
int b128_msk_get(float lat, float lon, int msknum)
Definition: b128_msk_get.c:183
void get_fqy(l2str *l2rec, float fqy[])
Definition: fluorescence.c:251
void get_evi3(l1str *l1rec, float evi3[])
Definition: get_ndvi.c:156
int writel2(filehandle *l2file, int32_t recnum, l2str *l2rec, int outfile_number)
Definition: l2_generic.c:953
int openl1_write(filehandle *l1file)
void update_flag_cnts16(int32_t *flag_cnt, int16_t *flags, int32_t nflags, int32_t npix, uint32_t init_mask)
Definition: l2_generic.c:1506
void get_par(l2str *l2rec, float par[])
Definition: get_par.c:34
int16 * get_flags_sst(l2str *l2rec)
Definition: sst.c:7561
void fEPSmean(l1qstr *l1que, int32_t nx, int32_t ny, int ib, int32_t minfill, char kernel[], l1str *l1rec)
Definition: filter.c:851
void get_npp(l2str *l2rec, int32_t, float prod[])
int16 * get_flags_sst4(l2str *l2rec)
Definition: sst.c:7574
read recnum
void bindex_set(int32_t wave[], int nwave, int dwave)
Definition: windex.c:13
int geom_per_band_deriv(l1str *)
Definition: geom_per_band.c:52
void update_flag_cnts(int32_t *flag_cnt, int32_t *flags, int32_t nflags, int32_t npix, uint32_t init_mask)
Definition: l2_generic.c:1491
float seawater_nsw(float wave, float sst, float sss, float *dnswds)
Definition: seawater.c:8
float seawater_get_a(int32_t ip, int32_t ib)
Definition: seawater_get.c:21
void get_bsi(l2str *l2rec, float BSi[])
void chl_carder_empirical(l2str *l2rec, float prod[])
Definition: carder.c:1168
int16 * get_counts_sst4(l2str *l2rec)
Definition: sst.c:7461
void fLTmean(l1qstr *l1que, int32_t nx, int32_t ny, int ib, int32_t minfill, char kernel[], l1str *l1rec)
Definition: filter.c:614
float get_sssref(char *file, float lon, float lat, int day)
Definition: sssref.c:360
void get_Kd(l2str *l2rec, l2prodstr *p, float Kd[])
Definition: get_Kd.c:981
int ncio_grab_stdsclf_ds(int, char *, float, float *)
Definition: ncio.c:101
void fdilate(l1qstr *l1que, int32_t nx, int32_t ny, int flag, char kernel[], l1str *l1rec)
Definition: filter.c:361
int read_target_l3(filehandle *file, l1str *l1rec, int32_t nbands, tgstr *tgrec)
Definition: target_io.c:207
void gothic_R(float wave[], int32_t nwave, float solz, float senz, float ws, float R[])
Definition: brdf.c:266
void update_qual_cnts(int32_t *flag_cnt, int8_t *flags, int32_t nflags, int32_t npix)
Definition: l2_generic.c:1521
int32_t rdsensorinfo(int32_t sensorID, int32_t evalmask, const char *pname, void **pval)
Definition: rdsensorinfo.c:69
float get_elev(float lat, float lon)
Definition: elev.c:108
void cdom_mannino(l2str *l2rec, int prodnum, float prod[])
Definition: cdom_mannino.c:7
void iops_gsm(l2str *l2rec)
Definition: gsm.c:885
int modis_cloud_mask(l1str *l1rec, int32_t ip)
Definition: cloud_flag.c:9
int bath_mask_init(char *file)
Definition: read_mask.c:53
void get_pml(l2str *l2rec, l2prodstr *p, float prod[])
Definition: get_pml.c:268
int fctl_set(fctlstr *fctl, int32_t npix, char *fname, int32_t band, int32_t nx, int32_t ny, int32_t minfill, int32_t nbands)
Definition: filter.c:92
void get_qaa(l2str *l2rec, l2prodstr *p, float prod[])
Definition: get_qaa.c:260
void get_tsm(l2str *l2rec, int prodnum, float prod[])
void iops_qaa(l2str *l2rec)
Definition: get_qaa.c:335
double esdist_(int32_t *year, int32_t *day, int32_t *msec)
float * get_bias_sst_triple(l2str *l2rec)
Definition: sst.c:7422
void get_rhown_mumm(l2str *l2rec, int32_t ip, int32_t nir_s, int32_t nir_l, float rhown[])
Definition: mumm.c:74
void get_es(l2str *l2rec, int band, float es[])
Definition: get_es.c:24
void clear_um_prod_()
float * get_sst(l2str *l2rec)
Definition: sst.c:7605
void init_l1(l1str *l1rec)
Definition: init_l1.c:12
float aw_spectra(int32_t wl, int32_t width)
int bath_mask(float lat, float lon)
Definition: read_mask.c:59
void get_giop(l2str *l2rec, l2prodstr *p, float prod[])
Definition: giop.c:2538
float * get_sst4(l2str *l2rec)
Definition: sst.c:7624
float bbw_spectra(int32_t wl, int32_t width)
const double delta
float seawater_get_bb(int32_t ip, int32_t ib)
Definition: seawater_get.c:25
float * get_sst_triple(l2str *l2rec)
Definition: sst.c:7643
void optical_water_type(l2str *l2rec, l2prodstr *p, void *vptr)
Definition: owt.c:325
void get_toa_refl(l2str *l2rec, int band, float rhot[])
Definition: get_toa_refl.c:19
void iops_swim(l2str *l2rec)
Definition: swim.c:799
int bindex_get_555(void)
Definition: windex.c:55
char filename[FILENAME_MAX]
Definition: atrem_corl1.h:122
float * get_stdv_sst4(l2str *l2rec)
Definition: sst.c:7487
void get_aw_bbw(l2str *l2rec, float wave[], int nwave, float *aw, float *bbw)
int write_qual_flag_pcnts(idDS ds_id, FILE *fpmeta, int32_t *flag_cnt, int32_t nflags, const char *const flag_lname[])
Definition: l2_generic.c:1556
void init_l2prod()
float32 easternmost(float32 lon1, float32 lon2)
Definition: scene_meta.c:37
int writel1(filehandle *l1file, int32_t recnum, l1str *l1rec)
#define MAXPROD
Definition: l2prod.h:4
void whitecaps(int32_t sensorID, int32_t evalmask, int32_t nwave, float ws, float ws_max, float rhof[])
Definition: whitecaps.c:51
float * get_bias_sst(l2str *l2rec)
Definition: sst.c:7391
void get_evi2(l1str *l1rec, float evi2[])
Definition: get_ndvi.c:122
void get_pft_uitz(l2str *l2rec, l2prodstr *p, float prod[])
Definition: get_pft_uitz.c:387
void cdom_morel(l2str *l2rec, l2prodstr *p, float prod[])
float * get_class_k_owmc(l2str *l2rec)
Definition: get_owmc.c:209
void write_product_XML_file(char *filename)
Utility functions for allocating and freeing two-dimensional arrays of various types.
void get_pft_hirata(l2str *l2rec, l2prodstr *p, float prod[])
void sunangs_(int *iyr, int *iday, float *gmt, float *xlon, float *ylat, float *sunz, float *suna)
int openl1_write_hdf(filehandle *l1file)
void get_depth(l2str *l2rec, float depth[])
Definition: get_depth.c:20
float fresnel_sen(float senz, int return_tf)
Definition: brdf.c:127
string ofile
Definition: l1mapgen.py:183
int16 * get_iter_giop(l2str *l2rec)
Definition: giop.c:2710
float * get_bias_mean_sst_triple(l2str *l2rec)
Definition: sst.c:7688
void atmocor1(l1str *l1rec, int32_t ip)
Definition: atmocor1.c:39
void get_ssn(l2str *l2rec, float ssn[])
int write_flag_pcnts(idDS ds_id, FILE *fpmeta, int32_t *flag_cnt, int32_t nflags, const char *const flag_lname[], int32_t numScans, int32_t numPixels)
Definition: l2_generic.c:1536
int giop_ran(int recnum)
Definition: giop.c:569
int16 * get_counts_sst(l2str *l2rec)
Definition: sst.c:7449
level
Definition: mapgen.py:175
void get_ipar(l2str *l2rec, float ipar[])
Definition: ipar.c:18
void get_fsat(l2str *l2rec, float flh[])
Definition: fluorescence.c:289
void run_raman_cor(l2str *l2rec, int ip)
Definition: raman.c:1069
int32_t nband
int ncio_grab_f_ds(int, char *, float *)
Definition: ncio.c:57
int getglint_iqu_(float *, float *, float *, float *, float *, float *, float *, float *)
void setflagbits(int level, l1str *l1rec, l2str *l2rec, int32_t ipix)
Definition: setflags.c:168
void fEPSiqmean(l1qstr *l1que, int32_t nx, int32_t ny, int ib, int32_t minfill, char kernel[], l1str *l1rec)
Definition: filter.c:1247
int get_f0_neckel(int32_t wl, int32_t width, float *f0)
Definition: get_f0.c:5
int read_aer(filehandle *file, int32_t recnum, aestr *aerec)
Definition: aer_io.c:99
void bioOptBandShift(l2str *l2rec, l2prodstr *p, float prod[])
float32 ylat[LAC_PIXEL_NUM]
Definition: l1a_seawifs.c:90
int16 * get_flags_giop(l2str *l2rec)
Definition: giop.c:2722
int get_bbp_qaa(l2str *l2rec, int ip, float tab_wave[], float tab_bbp[], int tab_nwave)
Definition: get_qaa.c:367
int32 l1b_seawifs(filehandle *l1file, filehandle *ofile, int32 sscan, int32 escan, int32 dscan, int32 spixl, int32 epixl, int32 dpixl)
int32_t alloc_aer(int32_t npix, int32_t nbands, aestr *aerec)
Definition: alloc_aer.c:12
float * get_bias_mean_sst4(l2str *l2rec)
Definition: sst.c:7670
void get_rhown_nir(char *fqfile, float Rrs[], float wave[], int32_t nir_s, int32_t nir_l, float aw[], float bbw[], float chl, float rhown[])
int32_t nbands
int32_t alloc_l2(l1str *l1rec, l2str *l2rec)
Definition: alloc_l2.c:17
int msl12_input_defaults(filehandle *l1file)
Definition: msl12_input.c:4746
void fctl_init(fctlstr *fctl)
Definition: filter.c:19
float32 westernmost(float32 lon1, float32 lon2)
Definition: scene_meta.c:28
void vcal(l2str *l2rec, l2prodstr *p, float vcal[])
Definition: vcal.c:25
void iops_pml(l2str *l2rec)
Definition: get_pml.c:313
int32 spix
Definition: l1_czcs_hdf.c:20
float * get_stdv_sst(l2str *l2rec)
Definition: sst.c:7436
char * name
Definition: Granule.c:1234
void get_ms_epsilon(l2str *l2rec, float eps[])
Definition: aerosol.c:4785
void init_l2(l2str *l2rec, int32_t nbands)
Definition: init_l2.c:11
void free_l1q(void)
Definition: getl1rec.c:13
void glint_rad(int32_t num_iter, int32_t nband, int32_t nir_s, int32_t nir_l, float glint_coef, float air_mass, float mu0, float F0[], float taur[], float taua[], float La[], float TLg[])
Definition: glint.c:40
void get_habs_mph(l2str *l2rec, l2prodstr *p, float mph_chl[])
Definition: get_habs.c:252
int get_f0_thuillier(int32_t wl, int32_t width, float *f0)
Definition: get_f0.c:71
void free_deminfo()
int invbindx(int band, int32_t *bindx, int nbands)
Definition: windex.c:104
float rrs_above_to_below(float Rrs)
Definition: giop.c:1598
int get_bbp_las(l2str *l2rec, int ip, float tab_wave[], float tab_bbp[], int tab_nwave)
Definition: las_iop.c:605
float mu0
int16 * get_counts_sst_triple(l2str *l2rec)
Definition: sst.c:7474
void get_iops(l2str *l2rec, int32_t iop_opt)
Definition: convl12.c:113
float get_bbp_las_eta_ksm(l2str *l2rec, int ip)
Definition: las_iop_ksm.c:745
Definition: dfutils.h:29
int32 l3file(int32 sdfid, int32 c_sdfid, int32 *nbins, int32 *c_nbins, char *ptype)
Definition: l3stat_chk.c:345
void iops_giop(l2str *l2rec)
Definition: giop.c:2734
float * lon
void fclean(l1qstr *l1que, int32_t nx, int32_t ny, int flag, char kernel[], l1str *l1rec)
Definition: filter.c:534
data_t s[NROOTS]
Definition: decode_rs.h:75
int32 epix
Definition: l1_czcs_hdf.c:22
void get_carder(l2str *l2rec, l2prodstr *p, float prod[])
Definition: carder.c:957
int openl1(filehandle *l1file)
Definition: l1_io.c:207
void get_mgiop(l2str *l2rec, l2prodstr *p, float prod[])
Definition: mgiop.c:10
void iops_las(l2str *l2rec)
Definition: las_iop.c:581
void run_giop(l2str *l2rec)
Definition: giop.c:1616
void get_psd_ksm(l2str *l2rec, l2prodstr *p, float prod[])
Definition: get_psd_ksm.c:432
float water_vapor(int ib, float wv, float airmass)
Definition: water_vapor.c:4
void get_cdom_morel(l2str *l2rec, l2prodstr *p, float prod[])
Definition: cdom_morel.c:319
float ice_fraction(float lon, float lat)
Definition: ice_mask.c:1017
#define R
Definition: make_L3_v1.1.c:96
int atmocor1_land(l1str *l1rec, int32_t ip)
Definition: atmocor1_land.c:16
void get_f0_thuillier_ext(int32_t wl, int32_t width, float *f0)
Definition: get_f0.c:137
float bin_climatology(char *l3file, int32_t day, float lon, float lat, char *prodname)
int8 * get_qual_sst(l2str *l2rec)
Definition: sst.c:7517
int8 * get_qual_sst_triple(l2str *l2rec)
Definition: sst.c:7548
void get_swim(l2str *l2rec, l2prodstr *p, float prod[])
Definition: swim.c:741
float * get_stdv_sst_triple(l2str *l2rec)
Definition: sst.c:7504
void get_chl(l2str *l2rec, int prodnum, float prod[])
Definition: get_chl.c:546
int loadl1(filehandle *l1file, l1str *l1rec)
Definition: loadl1.c:198
float * get_bias_sst4(l2str *l2rec)
Definition: sst.c:7404
void virtual_constellation(l2str *l2rec, l2prodstr *p, float prod[])
void flag_bowtie_deleted(l1str *l1rec, size_t ipix, int extract_offset)
Definition: l1b_viirs_nc.c:879
int init_geom_per_band(l1str *)
Definition: geom_per_band.c:8
int get_height(char *demfile, l1str *l1rec, int32_t ip, int terrain_corrected)
Definition: get_height.c:34
void closel1_hdf(filehandle *l1file)
void fLTmed(l1qstr *l1que, int32_t nx, int32_t ny, int ib, int32_t minfill, char kernel[], l1str *l1rec)
Definition: filter.c:1020
int32 l2file(int32 sdfid, int32 *nsamp, int32 *nscans, char *dtype)
Definition: l2stat_chk.c:313
void qint_morel(float wave[], int32_t nwave, float solz, float chl, float Qn[])
Definition: brdf.c:672
msiBandIdx val
Definition: l1c_msi.cpp:36
void free_l1(l1str *l1rec)
Definition: alloc_l1.c:8
PGE01 indicating that PGE02 PGE01 V6 for and PGE01 V2 for MOD03 were used to produce the granule By convention adopted in all MODIS Terra PGE02 code versions are The fourth digit of the PGE02 version denotes the LUT version used to produce the granule The source of the metadata environment variable ProcessingCenter was changed from a QA LUT value to the Process Configuration A sign used in error in the second order term was changed to a
Definition: HISTORY.txt:424
int32_t sensorID[MAXNFILES]
Definition: l2bin.cpp:95
void nlw_outband(int32_t evalmask, int32_t sensorID, float wave[], int32_t nwave, float Lw[], float nLw[])
Definition: nlw_outband.c:3
void closel1_generic(filehandle *l1file)
void get_las(l2str *l2rec, l2prodstr *p, float prod[])
Definition: las_iop.c:492
int windex(float wave, float twave[], int ntwave)
Definition: windex.c:71
int land_mask_init(char *file)
Definition: read_mask.c:14
int32_t iyr
Definition: atrem_corl1.h:161
void get_niwa(l2str *l2rec, l2prodstr *p, float prod[])
Definition: get_niwa_iop.c:67
int convl12(l1str *l1rec, l2str *l2rec, int32_t spix, int32_t epix, aestr *aerec)
Definition: convl12.c:16
float seawater_bb(float wave, float sst, float sss, double delta)
Definition: seawater.c:176
int32 npix
Definition: l1_czcs_hdf.c:19
int16 * get_iter_gsm(l2str *l2rec)
Definition: gsm.c:875
void get_flh(l2str *l2rec, float flh[])
Definition: fluorescence.c:269
double * get_xcal(l1str *l1rec, int type, int bandnum)
Definition: xcal.c:30
void viirs_pxcvt_2uag(int, int *, int *)
Definition: viirs_pxcvt.c:11
float p[MODELMAX]
Definition: atrem_corl1.h:131
float * get_class_ward_owmc(l2str *l2rec)
Definition: get_owmc.c:204
void get_ice_frac(l2str *l2rec, float ice[])
Definition: get_ice_frac.c:17
void get_bpar(l2str *l2rec, l2prodstr *p, float prod[])
Definition: get_bpar.c:482
int32 get_modis_calfile(int32 sd_id, char *file)
void get_rhown_eval(char *fqfile, float Rrs[], float wave[], int32_t nir_s, int32_t nir_l, int32_t nwave, float aw[], float bbw[], float chl, float solz, float senz, float phi, float rhown[])
void closel1(filehandle *l1file)
Definition: l1_io.c:69
void tindx_morel(l2str *l2rec, int32_t ip, float *tindx)
Definition: turbid.c:65
void seawater_set(l1str *l1rec)
Definition: seawater_get.c:8
int8 * get_qual_sst4(l2str *l2rec)
Definition: sst.c:7530