OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
prodgen.c
Go to the documentation of this file.
1 /* =========================================================== */
2 /* Module prodgen.c */
3 /* */
4 /* Function prodgen returns a pointer to the geophysical */
5 /* product associated with the input product catalog entry and */
6 /* the input level-2 record. The specific product will be */
7 /* extracted from the level-2 record or computed using the */
8 /* information in the level-2 record and knowledge of the */
9 /* required algorithm to be called. The output is stored in */
10 /* a static array, and a pointer is returned to the caller. */
11 /* */
12 /* Written By: */
13 /* Bryan A. Franz, NASA/OBPG, August 2008. */
14 /* =========================================================== */
15 
16 #include "l12_proto.h"
17 
18 #include <stdint.h>
19 #include <inttypes.h>
20 
21 static int32 numScans;
22 static int32 numPixels;
23 static int32 numBands;
24 static int32 numBandsIR;
25 
26 
27 /* ----------------------------------------------------------- */
28 /* extract_band() - extracts a product from a BIL array */
29 
30 /* ----------------------------------------------------------- */
31 VOIDP extract_band(float *fbuf, l2prodstr *p, int32 nbands) {
32  static float32 *fbuf2 = NULL;
33 
34  int32 band = MIN(MAX(p->prod_ix, 0), nbands - 1);
35  static int32 npix = 0;
36  int32 ip;
37 
38  if (fbuf2 == NULL) {
39  npix = p->dim[1];
40  if ((fbuf2 = calloc(npix, sizeof (float32))) == NULL) {
41  fprintf(stderr,
42  "-E- %s line %d: Unable to allocate buffer space.\n",
43  __FILE__, __LINE__);
44  exit(1);
45  }
46  } else if (npix != p->dim[1]) {
47  npix = p->dim[1];
48  free(fbuf2);
49  // this is put here for l3gen which varies the number of pixels on each line
50 
51  if ((fbuf2 = (float32 *) calloc(npix, sizeof (float32)))
52  == NULL) {
53  fprintf(stderr,
54  "-E- %s line %d: Unable to allocate buffer space.\n",
55  __FILE__, __LINE__);
56  exit(1);
57  }
58  }
59 
60  for (ip = 0; ip < npix && ip < numPixels; ip++) {
61  fbuf2[ip] = fbuf[ip * nbands + band];
62  }
63 
64  return ((VOIDP) fbuf2);
65 }
66 
75 void applyMultiplier(float* in, float* out, int count, float multiplier) {
76  int i;
77  for (i = 0; i < count; i++) {
78  if (in[i] == BAD_FLT)
79  out[i] = BAD_FLT;
80  else
81  out[i] = in[i] * multiplier;
82  }
83 }
84 
85 /* ----------------------------------------------------------- */
86 /* prodgen() - returns pointer the the requested product */
87 
88 /* ----------------------------------------------------------- */
89 VOIDP prodgen(l2prodstr *p, l2str *l2rec) {
90  static int firstCall = 1;
91 
92  static float32 *fbuf = NULL;
93 
94  VOIDP pbuf = NULL;
95 
96  if (firstCall) {
97  firstCall = 0;
98  numPixels = l2rec->l1rec->npix;
99  numScans = l2rec->l1rec->l1file->nscan;
100  numBands = l2rec->l1rec->l1file->nbands;
101  numBandsIR = l2rec->l1rec->l1file->nbandsir;
102  if ((fbuf = (float32 *) calloc(numBands*numPixels,sizeof(float32))) == NULL) {
103  fprintf(stderr,
104  "-E- %s line %d: Unable to allocate buffer space.\n",
105  __FILE__, __LINE__);
106  exit(1);
107  }
108  } else if (l2rec->l1rec->npix != numPixels) {
109 
110  // this is put here for l3gen which varies the number of pixels on each line
111  if (l2rec->l1rec->npix > numPixels) {
112 
113  free(fbuf);
114  if ((fbuf = (float32 *) calloc(l2rec->l1rec->npix, sizeof (float32)))
115  == NULL) {
116  fprintf(stderr,
117  "-E- %s line %d: Unable to allocate buffer space.\n",
118  __FILE__, __LINE__);
119  exit(1);
120  }
121 
122  }
123  numPixels = l2rec->l1rec->npix;
124  }
125 
126  l1str* l1rec = l2rec->l1rec;
127  switch (p->cat_ix) {
128 
129  //
130  // Band-dependent, precomputed products
131  //
132  case CAT_nLw:
133  if (p->rank == 3)
134  applyMultiplier(l2rec->nLw, fbuf, numPixels*numBands, 10.0);
135  else
136  applyMultiplier(extract_band(l2rec->nLw, p, numBands), fbuf, numPixels, 10.0);
137  pbuf = fbuf;
138  break;
139  case CAT_nLw_unc:
140  if (p->rank == 3)
141  applyMultiplier(l2rec->nLw_unc, fbuf, numPixels*numBands, 10.0);
142  else
143  applyMultiplier(extract_band(l2rec->nLw_unc, p, numBands), fbuf, numPixels, 10.0);
144  pbuf = fbuf;
145  break;
146  case CAT_Lw:
147  if (p->rank == 3)
148  applyMultiplier(l2rec->Lw, fbuf, numPixels*numBands, 10.0);
149  else
150  applyMultiplier(extract_band(l2rec->Lw, p, numBands), fbuf, numPixels, 10.0);
151  pbuf = fbuf;
152  break;
153  case CAT_Rrs:
154  pbuf = p->rank == 3 ? l2rec->Rrs : extract_band(l2rec->Rrs,p,numBands);
155  break;
156  case CAT_Rrs_unc:
157  pbuf = p->rank == 3 ? l2rec->Rrs_unc : extract_band(l2rec->Rrs_unc,p,numBands);
158  break;
159  case CAT_Taua:
160  pbuf = p->rank == 3 ? l2rec->taua : extract_band(l2rec->taua,p,numBands);
161  break;
162  case CAT_Lr:
163  if (p->rank == 3)
164  applyMultiplier(l1rec->Lr, fbuf, numPixels*numBands, 10.0);
165  else
166  applyMultiplier(extract_band(l1rec->Lr, p, numBands), fbuf, numPixels, 10.0);
167  pbuf = fbuf;
168  break;
169  case CAT_L_q:
170  if (p->rank == 3)
171  applyMultiplier(l1rec->L_q, fbuf, numPixels * numBands, 10.0);
172  else
173  applyMultiplier(extract_band(l1rec->L_q, p, numBands), fbuf, numPixels, 10.0);
174  pbuf = fbuf;
175  break;
176  case CAT_L_u:
177  if (p->rank == 3)
178  applyMultiplier(l1rec->L_u, fbuf, numPixels*numBands, 10.0);
179  else
180  applyMultiplier(extract_band(l1rec->L_u, p, numBands), fbuf, numPixels, 10.0);
181  pbuf = fbuf;
182  break;
183  case CAT_polcor:
184  pbuf = p->rank == 3 ? l1rec->polcor : extract_band(l1rec->polcor,p,numBands);
185  break;
186  case CAT_La:
187  if (p->rank == 3)
188  applyMultiplier(l2rec->La, fbuf, numPixels*numBands, 10.0);
189  else
190  applyMultiplier(extract_band(l2rec->La, p, numBands), fbuf, numPixels, 10.0);
191  pbuf = fbuf;
192  break;
193  case CAT_TLg:
194  if (p->rank == 3)
195  applyMultiplier(l1rec->TLg, fbuf, numPixels*numBands, 10.0);
196  else
197  applyMultiplier(extract_band(l1rec->TLg, p, numBands), fbuf, numPixels, 10.0);
198  pbuf = fbuf;
199  break;
200  case CAT_tLf:
201  if (p->rank == 3)
202  applyMultiplier(l1rec->tLf, fbuf, numPixels*numBands, 10.0);
203  else
204  applyMultiplier(extract_band(l1rec->tLf, p, numBands), fbuf, numPixels, 10.0);
205  pbuf = fbuf;
206  break;
207  case CAT_brdf:
208  pbuf = p->rank == 3 ? l2rec->brdf : extract_band(l2rec->brdf,p,numBands);
209  break;
210  case CAT_Lt:
211  if (p->rank == 3) {
212  applyMultiplier(l2rec->l1rec->Lt, fbuf, numPixels*numBands, 10.0);
213  pbuf = fbuf;
214  } else {
215  if (p->prod_ix < numBands) {
216  applyMultiplier(extract_band(l2rec->l1rec->Lt, p, numBands), fbuf, numPixels, 10.0);
217  pbuf = fbuf;
218  } else {
219  // first subtract the num of visible bands
220  p->prod_ix -= numBands;
221  applyMultiplier(extract_band(l1rec->Ltir, p, NBANDSIR), fbuf, numPixels, 10.0);
222  pbuf = fbuf;
223  p->prod_ix += numBands;
224  }
225  }
226  break;
227  case CAT_Lt_unc:
228  applyMultiplier(extract_band(l2rec->l1rec->Lt_unc, p, numBands), fbuf, numPixels, 10.0);
229  pbuf = fbuf;
230  break;
231  case CAT_BT:
232  // first subtract the num of visible bands
233  p->prod_ix -= numBands;
234  pbuf = extract_band(l1rec->Bt, p, NBANDSIR);
235  p->prod_ix += numBands;
236  break;
237  case CAT_rhos:
238  pbuf = p->rank == 3 ? l1rec->rhos : extract_band(l1rec->rhos,p,numBands);
239  break;
240  case CAT_nw:
241  pbuf = extract_band(l1rec->sw_n, p, numBands);
242  break;
243  case CAT_aw:
244  pbuf = extract_band(l1rec->sw_a, p, numBands);
245  break;
246  case CAT_bbw:
247  pbuf = extract_band(l1rec->sw_bb, p, numBands);
248  break;
249  case CAT_bbws:
250  get_bbws(l2rec, p, fbuf);
251  pbuf = (VOIDP) fbuf;
252  break;
253  case CAT_a:
254  pbuf = p->rank == 3 ? l2rec->a : extract_band(l2rec->a,p,numBands);
255  break;
256  case CAT_bb:
257  pbuf = p->rank == 3 ? l2rec->bb : extract_band(l2rec->bb,p,numBands);
258  break;
259  case CAT_t_sol:
260  pbuf = p->rank == 3 ? l1rec->t_sol : extract_band(l1rec->t_sol, p, numBands);
261  break;
262  case CAT_t_sen:
263  pbuf = p->rank == 3 ? l1rec->t_sen : extract_band(l1rec->t_sen, p, numBands);
264  break;
265  case CAT_tg_sol:
266  pbuf = p->rank == 3 ? l1rec->tg_sol : extract_band(l1rec->tg_sol, p, numBands);
267  break;
268  case CAT_tg_sen:
269  pbuf = p->rank == 3 ? l1rec->tg_sen : extract_band(l1rec->tg_sen, p, numBands);
270  break;
271  case CAT_t_h2o:
272  pbuf = p->rank == 3 ? l1rec->t_h2o : extract_band(l1rec->t_h2o, p, numBands);
273  break;
274  case CAT_t_o2:
275  pbuf = p->rank == 3 ? l1rec->t_o2 : extract_band(l1rec->t_o2, p, numBands);
276  break;
277  case CAT_dpol:
278  pbuf = p->rank == 3 ? l1rec->dpol : extract_band(l1rec->dpol, p, numBands);
279  break;
280  case CAT_BT_39:
281  pbuf = extract_band(l1rec->Bt, p, NBANDSIR);
282  break;
283  case CAT_BT_40:
284  pbuf = extract_band(l1rec->Bt, p, NBANDSIR);
285  break;
286  case CAT_BT_11:
287  pbuf = extract_band(l1rec->Bt, p, NBANDSIR);
288  break;
289  case CAT_BT_12:
290  pbuf = extract_band(l1rec->Bt, p, NBANDSIR);
291  break;
292  //
293  // Band independent or dependent, precomputed products
294  // for the view angles and related values
295  //
296  case CAT_senz:
297  case CAT_solz:
298  case CAT_sola:
299  case CAT_sena:
300  case CAT_relaz:
301  case CAT_scattang:
302  if ((p->prod_ix >= 0) && (l1rec->geom_per_band == NULL)) {
303  fprintf(stderr,
304  "-E- %s, %d: Geometry-dependent view angle information",
305  __FILE__, __LINE__);
306  fprintf(stderr, " is unavailable for product catalog ID %d.\n",
307  p->cat_ix);
308  fprintf(stderr, "or, geometry-dependent view angle information was specifically not requested\n");
309  exit(1);
310  }
311  switch (p->cat_ix) {
312  case CAT_senz:
313  if (p->prod_ix < 0) {
314  pbuf = (VOIDP) l1rec->senz;
315  } else {
316  pbuf = extract_band(l1rec->geom_per_band->senz, p, numBands);
317  }
318  break;
319  case CAT_solz:
320  if (p->prod_ix < 0) {
321  pbuf = (VOIDP) l1rec->solz;
322  } else {
323  pbuf = extract_band(l1rec->geom_per_band->solz, p, numBands);
324  }
325  break;
326  case CAT_sena:
327  if (p->prod_ix < 0) {
328  pbuf = (VOIDP) l1rec->sena;
329  } else {
330  pbuf = extract_band(l1rec->geom_per_band->sena, p, numBands);
331  }
332  break;
333  case CAT_sola:
334  if (p->prod_ix < 0) {
335  pbuf = (VOIDP) l1rec->sola;
336  } else {
337  pbuf = extract_band(l1rec->geom_per_band->sola, p, numBands);
338  }
339  break;
340  case CAT_relaz:
341  if (p->prod_ix < 0) {
342  pbuf = (VOIDP) l1rec->delphi;
343  } else {
344  pbuf = extract_band(l1rec->geom_per_band->delphi, p, numBands);
345  }
346  break;
347  case CAT_scattang:
348  if (p->prod_ix < 0) {
349  pbuf = (VOIDP) l1rec->scattang;
350  } else {
351  pbuf = extract_band(l1rec->geom_per_band->scattang, p, numBands);
352  }
353  break;
354  }
355  break;
356 
357  //
358  // Band independent, precomputed products
359  //
360  case CAT_epsilon:
361  pbuf = (VOIDP) l2rec->eps;
362  break;
363  case CAT_alpha:
364  pbuf = (VOIDP) l1rec->alpha;
365  break;
366  case CAT_ozone:
367  pbuf = (VOIDP) l1rec->oz;
368  break;
369  case CAT_no2_tropo:
370  pbuf = (VOIDP) l1rec->no2_tropo;
371  break;
372  case CAT_no2_strat:
373  pbuf = (VOIDP) l1rec->no2_strat;
374  break;
375  case CAT_no2_frac:
376  pbuf = (VOIDP) l1rec->no2_frac;
377  break;
378  case CAT_windspeed:
379  pbuf = (VOIDP) l1rec->ws;
380  break;
381  case CAT_windangle:
382  pbuf = (VOIDP) l1rec->wd;
383  break;
384  case CAT_zwind:
385  pbuf = (VOIDP) l1rec->zw;
386  break;
387  case CAT_mwind:
388  pbuf = (VOIDP) l1rec->mw;
389  break;
390  case CAT_pressure:
391  pbuf = (VOIDP) l1rec->pr;
392  break;
393  case CAT_water_vapor:
394  pbuf = (VOIDP) l1rec->wv;
395  break;
396  case CAT_humidity:
397  pbuf = (VOIDP) l1rec->rh;
398  break;
399  case CAT_sfc_pressure:
400  pbuf = (VOIDP) l1rec->sfcp;
401  break;
402  case CAT_sfc_humidity:
403  pbuf = (VOIDP) l1rec->sfcrh;
404  break;
405  case CAT_sfc_temp:
406  pbuf = (VOIDP) l1rec->sfct;
407  break;
408  case CAT_T_prof:
409  case CAT_RH_prof:
410  case CAT_HGT_prof:
411  case CAT_Q_prof:
412  case CAT_O3_prof:
413  if( p->rank == 3 ) {
414  switch (p->cat_ix) {
415  case CAT_T_prof:
416  pbuf = (VOIDP) l1rec->anc_add->prof_temp;
417  break;
418  case CAT_RH_prof:
419  pbuf = (VOIDP) l1rec->anc_add->prof_rh;
420  break;
421  case CAT_HGT_prof:
422  pbuf = (VOIDP) l1rec->anc_add->prof_height;
423  break;
424  case CAT_Q_prof:
425  pbuf = (VOIDP) l1rec->anc_add->prof_q;
426  break;
427  case CAT_O3_prof:
428  pbuf = (VOIDP) l1rec->anc_add->prof_o3;
429  break;
430  }
431  } else {
432  fprintf( stderr,
433  "-I- %s %d: Single-level profile output not implemented yet\n",
434  __FILE__, __LINE__ );
435  }
436  break;
437  case CAT_ozone_unc:
438  pbuf = (VOIDP) l1rec->oz_unc;
439  break;
440  case CAT_no2_tropo_unc:
441  pbuf = (VOIDP) l1rec->no2_tropo_unc;
442  break;
443  case CAT_no2_strat_unc:
444  pbuf = (VOIDP) l1rec->no2_strat_unc;
445  break;
446  case CAT_windspeed_unc:
447  pbuf = (VOIDP) l1rec->ws_unc;
448  break;
449  case CAT_windangle_unc:
450  pbuf = (VOIDP) l1rec->wd_unc;
451  break;
452  case CAT_zwind_unc:
453  pbuf = (VOIDP) l1rec->zw_unc;
454  break;
455  case CAT_mwind_unc:
456  pbuf = (VOIDP) l1rec->mw_unc;
457  break;
458  case CAT_pressure_unc:
459  pbuf = (VOIDP) l1rec->pr_unc;
460  break;
461  case CAT_water_vapor_unc:
462  pbuf = (VOIDP) l1rec->wv_unc;
463  break;
464  case CAT_humidity_unc:
465  pbuf = (VOIDP) l1rec->rh_unc;
466  break;
467  case CAT_height:
468  pbuf = (VOIDP) l1rec->height;
469  break;
470  case CAT_sstref:
471  pbuf = (VOIDP) l1rec->sstref;
472  break;
473  case CAT_sssref:
474  pbuf = (VOIDP) l1rec->sssref;
475  break;
476  case CAT_glint_coef:
477  pbuf = (VOIDP) l1rec->glint_coef;
478  break;
479  case CAT_cloud_albedo:
480  pbuf = (VOIDP) l1rec->cloud_albedo;
481  break;
482  case CAT_rho_cirrus:
483  pbuf = (VOIDP) l1rec->rho_cirrus;
484  break;
485  case CAT_aerindex:
486  pbuf = (VOIDP) l2rec->aerindex;
487  break;
488  case CAT_aer_ratio:
489  if (p->prod_ix == 1)
490  pbuf = (VOIDP) l2rec->aerratio;
491  else
492  pbuf = (VOIDP) l2rec->aerratio2;
493  break;
494 
495  //
496  // Integer, precomputed products
497  //
498  case CAT_l2_flags:
499  pbuf = (VOIDP) l2rec->l1rec->flags;
500  break;
501  case CAT_num_iter:
502  pbuf = (VOIDP) l2rec->num_iter;
503  break;
504  case CAT_slot:
505  pbuf = (VOIDP) l2rec->l1rec->slot;
506  break;
507  case CAT_aer_model:
508  switch (p->prod_ix) {
509  case 1:
510  pbuf = l2rec->aermodmin;
511  break;
512  case 2:
513  pbuf = l2rec->aermodmax;
514  break;
515  case 3:
516  pbuf = l2rec->aermodmin2;
517  break;
518  case 4:
519  pbuf = l2rec->aermodmax2;
520  break;
521  }
522  break;
523 
524  //
525  // 1-dimensional, precomputed products
526  //
527  case CAT_fsol:
528  pbuf = (VOIDP) & l1rec->fsol;
529  break;
530  case CAT_pixnum:
531  pbuf = (VOIDP) l1rec->pixnum;
532  break;
533  case CAT_detnum:
534  pbuf = (VOIDP) & l1rec->detnum;
535  break;
536  case CAT_mside:
537  pbuf = (VOIDP) & l1rec->mside;
538  break;
539 
540  //
541  // Derived products
542  //
543  case CAT_angstrom:
544  get_angstrom(l2rec, p->prod_ix, fbuf);
545  pbuf = (VOIDP) fbuf;
546  break;
547  case CAT_ms_epsilon:
548  get_ms_epsilon(l2rec, fbuf);
549  pbuf = (VOIDP) fbuf;
550  break;
551  case CAT_Es:
552  get_es(l2rec, p->prod_ix, fbuf);
553  pbuf = (VOIDP) fbuf;
554  break;
555  case CAT_rhot:
556  get_toa_refl(l2rec, p->prod_ix, fbuf);
557  pbuf = (VOIDP) fbuf;
558  break;
559  case CAT_rhom:
560  get_rho_mumm(l2rec, -1, p->prod_ix, fbuf);
561  pbuf = (VOIDP) fbuf;
562  break;
563  case CAT_depth_class:
564  get_depth_classification(l2rec, fbuf);
565  pbuf = (VOIDP) fbuf;
566  break;
567  case CAT_fqy:
568  get_fqy(l2rec, fbuf);
569  pbuf = (VOIDP) fbuf;
570  break;
571  case CAT_flh:
572  get_flh(l2rec, fbuf);
573  applyMultiplier(fbuf, fbuf, numPixels, 10.0);
574  pbuf = (VOIDP) fbuf;
575  break;
576  case CAT_fsat:
577  get_fsat(l2rec, fbuf);
578  applyMultiplier(fbuf, fbuf, numPixels, 10.0);
579  pbuf = (VOIDP) fbuf;
580  break;
581  case CAT_ipar:
582  get_ipar(l2rec, fbuf);
583  pbuf = (VOIDP) fbuf;
584  break;
585  case CAT_BSi:
586  get_bsi(l2rec, fbuf);
587  pbuf = (VOIDP) fbuf;
588  break;
589  case CAT_Kd_mueller:
590  case CAT_Kd_532:
591  case CAT_Kd_obpg:
592  case CAT_Kd_lee:
593  case CAT_Kd_morel:
594  case CAT_Kd_KD2:
595  case CAT_KPAR_morel:
596  case CAT_KPAR_lee:
597  case CAT_Zhl_morel:
598  case CAT_Kd_jamet:
599  case CAT_Kd_rhos:
600  case CAT_nKd_lin:
601  get_Kd(l2rec, p, fbuf);
602  pbuf = (VOIDP) fbuf;
603  break;
604  case CAT_Zphotic_lee:
605  case CAT_Zeu_morel:
606  case CAT_Zsd_morel:
607  case CAT_Zsd_gbr:
608  get_photic_depth(l2rec, p, fbuf);
609  pbuf = (VOIDP) fbuf;
610  break;
611  case CAT_tindx_morel:
612  tindx_morel(l2rec, -1, fbuf);
613  pbuf = (VOIDP) fbuf;
614  break;
615  case CAT_tindx_shi:
616  tindx_shi(l2rec, -1, fbuf);
617  pbuf = (VOIDP) fbuf;
618  break;
619  case CAT_iCDOM_morel:
620  case CAT_pCDOM_morel:
621  case CAT_adg_morel:
622  case CAT_chl_morel:
624  get_cdom_morel(l2rec, p, fbuf);
625  pbuf = (VOIDP) fbuf;
626  break;
627  case CAT_owt:
628  case CAT_owtn:
629  case CAT_chl_owterr:
630  optical_water_type(l2rec, p, fbuf);
631  pbuf = (VOIDP) fbuf;
632  break;
633  case CAT_owtd:
634  optical_water_type(l2rec, p, fbuf);
635  pbuf = (VOIDP) fbuf;
636  break;
637  case CAT_ndvi:
638  case CAT_evi:
639  case CAT_evi2:
640  case CAT_evi3:
641  get_ndvi_evi(l1rec, p->cat_ix, fbuf);
642  pbuf = (VOIDP) fbuf;
643  break;
644  case CAT_smoke:
645  get_smoke(l2rec, fbuf);
646  pbuf = (VOIDP) fbuf;
647  break;
648  case CAT_par:
649  get_par(l2rec, fbuf);
650  pbuf = (VOIDP) fbuf;
651  break;
652  case CAT_chl_oc2:
653  case CAT_chl_oc3:
654  case CAT_chl_oc3c:
655  case CAT_chl_oc4:
656  case CAT_chl_hu:
657  case CAT_chl_oci:
658  case CAT_chl_oci2:
659  case CAT_chl_cdr:
660  case CAT_chl_abi:
661  get_chl(l2rec, p->cat_ix, fbuf);
662  pbuf = (VOIDP) fbuf;
663  break;
664  case CAT_chl_mgiop:
665  case CAT_bbp_mgiop:
666  case CAT_adg_mgiop:
667  case CAT_aph_mgiop:
668  case CAT_npix_mgiop:
669  case CAT_crat_mgiop:
670  case CAT_fitpar_mgiop:
671  get_mgiop(l2rec, p, fbuf);
672  pbuf = (VOIDP) fbuf;
673  break;
674  case CAT_a_pml:
675  case CAT_aph_pml:
676  case CAT_adg_pml:
677  case CAT_bb_pml:
678  case CAT_bbp_pml:
679  get_pml(l2rec, p, fbuf);
680  pbuf = (VOIDP) fbuf;
681  break;
682  case CAT_a_qaa:
683  case CAT_b_qaa:
684  case CAT_c_qaa:
685  case CAT_aph_qaa:
686  case CAT_adg_qaa:
687  case CAT_bb_qaa:
688  case CAT_bbp_qaa:
689  case CAT_mod_rrs_qaa:
690  get_qaa(l2rec, p, fbuf);
691  pbuf = (VOIDP) fbuf;
692  break;
693  case CAT_flags_qaa:
694  pbuf = (VOIDP) get_flags_qaa(l2rec);
695  break;
696  case CAT_chl_carder:
697  case CAT_a_carder:
698  case CAT_bb_carder:
699  case CAT_aph_carder:
700  case CAT_adg_carder:
701  case CAT_bbp_carder:
702  get_carder(l2rec, p, fbuf);
703  pbuf = (VOIDP) fbuf;
704  break;
705  case CAT_chl_carder_emp:
706  chl_carder_empirical(l2rec, fbuf);
707  pbuf = (VOIDP) fbuf;
708  break;
709  case CAT_flags_carder:
710  pbuf = (VOIDP) get_flags_carder(l2rec);
711  break;
712  case CAT_flags_giop:
713  pbuf = (VOIDP) get_flags_giop(l2rec);
714  break;
715  case CAT_iter_giop:
716  pbuf = (VOIDP) get_iter_giop(l2rec);
717  break;
718  case CAT_chl_giop:
719  case CAT_a_giop:
720  case CAT_bb_giop:
721  case CAT_aph_giop:
722  case CAT_adg_giop:
723  case CAT_bbp_giop:
724  case CAT_chl_unc_giop:
725  case CAT_a_unc_giop:
726  case CAT_bb_unc_giop:
727  case CAT_aph_unc_giop:
728  case CAT_adg_unc_giop:
729  case CAT_bbp_unc_giop:
730  case CAT_aphs_giop:
731  case CAT_adgs_giop:
732  case CAT_bbps_giop:
733  case CAT_rrsdiff_giop:
734  case CAT_mRrs_giop:
735  case CAT_chisqr_giop:
736  case CAT_fitpar_giop:
737  case CAT_acdom_giop:
738  case CAT_anap_giop:
739  case CAT_bbph_giop:
740  case CAT_bbnap_giop:
741  case CAT_acdom_unc_giop:
742  case CAT_anap_unc_giop:
743  case CAT_bbph_unc_giop:
744  case CAT_bbnap_unc_giop:
745  case CAT_opt_siop_giop:
746  get_giop(l2rec, p, fbuf);
747  pbuf = (VOIDP) fbuf;
748  break;
749  case CAT_iter_gsm:
750  pbuf = (VOIDP) get_iter_gsm(l2rec);
751  break;
752  case CAT_chl_gsm:
753  case CAT_a_gsm:
754  case CAT_bb_gsm:
755  case CAT_aph_gsm:
756  case CAT_adg_gsm:
757  case CAT_bbp_gsm:
758  get_gsm(l2rec, p, fbuf);
759  pbuf = (VOIDP) fbuf;
760  break;
761  case CAT_a_las:
762  case CAT_b_las:
763  case CAT_c_las:
764  case CAT_bb_las:
765  case CAT_bbp_las:
766  case CAT_bbps_las:
767  get_las(l2rec, p, fbuf);
768  pbuf = (VOIDP) fbuf;
769  break;
770  case CAT_a_niwa:
771  case CAT_bb_niwa:
772  get_niwa(l2rec, p, fbuf);
773  pbuf = (VOIDP) fbuf;
774  break;
775  case CAT_flags_niwa:
776  pbuf = (VOIDP) get_flags_niwa(l2rec);
777  break;
778 // case CAT_chl_soa:
779 // case CAT_adg_soa:
780 // case CAT_bbp_soa:
781 // case CAT_pcentcdm_soa:
782 // case CAT_w0_soa:
783 // case CAT_v_soa:
784 // get_soa(l2rec, p->cat_ix, fbuf);
785 // pbuf = (VOIDP) fbuf;
786 // break;
787 // case CAT_chl_sma:
788 // case CAT_adg_sma:
789 // case CAT_bbp_sma:
790 // case CAT_w0_sma:
791 // case CAT_dom_sma:
792 // get_sma(l2rec, p->cat_ix, fbuf);
793 // pbuf = (VOIDP) fbuf;
794 // break;
797  get_poc(l2rec, p->cat_ix, fbuf);
798  pbuf = (VOIDP) fbuf;
799  break;
800  case CAT_ag_412_mlrc:
801  case CAT_Sg_275_295_mlrc:
802  case CAT_Sg_300_600_mlrc:
803  cdom_mannino(l2rec, p->cat_ix, fbuf);
804  pbuf = (VOIDP) fbuf;
805  break;
806  case CAT_calcite:
807  case CAT_calcite_2b:
808  case CAT_calcite_3b:
809  case CAT_calcite_ci2:
810  case CAT_calcite_ci748:
811  case CAT_calcite_ci869:
812  calcite(l2rec, p, fbuf);
813  pbuf = (VOIDP) fbuf;
814  break;
815  case CAT_Rrs_vc:
816  if (input->band_shift_opt == 1)
817  bioOptBandShift(l2rec, p, fbuf);
818  else
819  virtual_constellation(l2rec, p, fbuf);
820  pbuf = (VOIDP) fbuf;
821  break;
822  case CAT_chl_vc:
823  virtual_constellation(l2rec, p, fbuf);
824  pbuf = (VOIDP) fbuf;
825  break;
826  case CAT_sst:
827  pbuf = (VOIDP) get_sst(l2rec);
828  break;
829  case CAT_sst4:
830  pbuf = (VOIDP) get_sst4(l2rec);
831  break;
832  case CAT_sst3:
833  pbuf = (VOIDP) get_sst_triple(l2rec);
834  break;
835  case CAT_dsdi:
836  pbuf = (VOIDP) get_sst_dust_correction(l2rec);
837  break;
838  case CAT_bias_sst:
839  pbuf = (VOIDP) get_bias_sst(l2rec);
840  break;
841  case CAT_bias_sst4:
842  pbuf = (VOIDP) get_bias_sst4(l2rec);
843  break;
844  case CAT_bias_sst3:
845  pbuf = (VOIDP) get_bias_sst_triple(l2rec);
846  break;
847  case CAT_bias_mean_sst:
848  pbuf = (VOIDP) get_bias_mean_sst(l2rec);
849  break;
850  case CAT_bias_mean_sst4:
851  pbuf = (VOIDP) get_bias_mean_sst4(l2rec);
852  break;
853  case CAT_bias_mean_sst3:
854  pbuf = (VOIDP) get_bias_mean_sst_triple(l2rec);
855  break;
856  case CAT_counts_sst:
857  pbuf = (VOIDP) get_counts_sst(l2rec);
858  break;
859  case CAT_counts_sst4:
860  pbuf = (VOIDP) get_counts_sst4(l2rec);
861  break;
862  case CAT_counts_sst3:
863  pbuf = (VOIDP) get_counts_sst_triple(l2rec);
864  break;
865  case CAT_stdv_sst:
866  pbuf = (VOIDP) get_stdv_sst(l2rec);
867  break;
868  case CAT_stdv_sst4:
869  pbuf = (VOIDP) get_stdv_sst4(l2rec);
870  break;
871  case CAT_stdv_sst3:
872  pbuf = (VOIDP) get_stdv_sst_triple(l2rec);
873  break;
874  case CAT_flags_sst:
875  pbuf = (VOIDP) get_flags_sst(l2rec);
876  break;
877  case CAT_flags_sst4:
878  pbuf = (VOIDP) get_flags_sst4(l2rec);
879  break;
880  case CAT_flags_sst3:
881  pbuf = (VOIDP) get_flags_sst_triple(l2rec);
882  break;
883  case CAT_qual_sst:
884  pbuf = (VOIDP) get_qual_sst(l2rec);
885  break;
886  case CAT_qual_sst4:
887  pbuf = (VOIDP) get_qual_sst4(l2rec);
888  break;
889  case CAT_qual_sst3:
890  pbuf = (VOIDP) get_qual_sst_triple(l2rec);
891  break;
892  case CAT_vLt:
893  case CAT_vtLw:
894  case CAT_vLw:
895  case CAT_vnLw:
896  vcal(l2rec, p, fbuf);
897  applyMultiplier(fbuf, fbuf, numPixels, 10.0);
898  pbuf = (VOIDP) fbuf;
899  break;
900  case CAT_vgain:
901  case CAT_vbsat:
902  case CAT_vbtgt:
903  vcal(l2rec, p, fbuf);
904  pbuf = (VOIDP) fbuf;
905  break;
906  case CAT_ice_frac:
907  get_ice_frac(l2rec, fbuf);
908  pbuf = (VOIDP) fbuf;
909  break;
910  case CAT_class_ward_owmc:
911  pbuf = get_class_ward_owmc(l2rec);
912  break;
913  case CAT_class_k_owmc:
914  pbuf = get_class_k_owmc(l2rec);
915  break;
917  pbuf = get_class_34k_w_owmc(l2rec);
918  break;
919  case CAT_a_swim:
920  case CAT_bb_swim:
921  case CAT_adg_swim:
922  case CAT_aph_swim:
923  case CAT_bbp_swim:
924  get_swim(l2rec, p, fbuf);
925  pbuf = (VOIDP) fbuf;
926  break;
927  case CAT_elev:
928  pbuf = (VOIDP) l1rec->dem;
929  break;
931  case CAT_diatoms_hirata:
940  get_pft_hirata(l2rec, p, fbuf);
941  pbuf = (VOIDP) fbuf;
942  break;
946  get_pft_uitz(l2rec, p, fbuf);
947  pbuf = (VOIDP) fbuf;
948  break;
949  case CAT_npp_vgpm:
950  case CAT_npp_eppley:
951  case CAT_npp_cbpm2:
952  case CAT_npp_mld:
953  case CAT_npp_zno3:
954  case CAT_npp_bbp:
955  case CAT_npp_par:
956  case CAT_npp_cafe:
957  get_npp(l2rec, p->cat_ix, fbuf);
958  pbuf = (VOIDP) fbuf;
959  break;
960  case CAT_CI_stumpf:
961  case CAT_CI_cyano:
962  case CAT_CI_noncyano:
963  case CAT_MCI_stumpf:
964  get_habs_ci(l2rec, p, fbuf);
965  pbuf = (VOIDP) fbuf;
966  break;
967  case CAT_MPH_chl:
968  get_habs_mph(l2rec, p, fbuf);
969  pbuf = (VOIDP) fbuf;
970  break;
971  case CAT_flags_habs_mph:
972  pbuf = (VOIDP) get_flags_habs_mph(l2rec);
973  break;
974  case CAT_flags_habs:
975  pbuf = (VOIDP) get_flags_habs(l2rec);
976  break;
977 
987  get_psd_ksm(l2rec, p, fbuf);
988  pbuf = (VOIDP) fbuf;
989  break;
990 
991  case CAT_nitrate:
992  get_nitrate(l2rec,p,fbuf);
993  pbuf = (VOIDP) fbuf;
994  break;
995  case CAT_avw:
996  get_avw(l2rec,fbuf);
997  pbuf=(VOIDP) fbuf;
998  break;
999  case CAT_Rrs_brightness:
1000  get_Rrs_brightness(l2rec,fbuf);
1001  pbuf=(VOIDP) fbuf;
1002  break;
1003  case CAT_lambda_max:
1004  get_lambda_max(l2rec,fbuf);
1005  pbuf=(VOIDP) fbuf;
1006  break;
1007  case CAT_Cphyt:
1008  get_Cphyt(l2rec,fbuf);
1009  pbuf=(VOIDP) fbuf;
1010  break;
1011 
1012  case CAT_iparb:
1013  case CAT_parb:
1014  get_bpar(l2rec,p,fbuf);
1015  pbuf = (VOIDP) fbuf;
1016  break;
1017 
1018  /* Chimaera cloud products */
1019  case CAT_Cld_p:
1020  case CAT_Cld_t:
1021  case CAT_CER_2100:
1022  case CAT_CER_1600:
1023  case CAT_COT_2100:
1024  case CAT_COT_1600:
1025  case CAT_CER_1621:
1026  case CAT_COT_1621:
1027  case CAT_CWP_2100:
1028  case CAT_CWP_1621:
1029  case CAT_CWP_1600:
1030  case CAT_Cld_Top_Refl_650:
1031  case CAT_Cld_Top_Refl_860:
1032  case CAT_Cld_Top_Refl_1200:
1033  case CAT_Cld_Top_Refl_1600:
1034  case CAT_Cld_Top_Refl_2100:
1035 
1036  case CAT_COT_fail_2100:
1037  case CAT_COT_fail_1600:
1038  case CAT_COT_fail_1621:
1039  case CAT_CER_fail_2100:
1040  case CAT_CER_fail_1600:
1041  case CAT_CER_fail_1621:
1042  case CAT_CMP_fail_pct_2100:
1043  case CAT_CMP_fail_pct_1600:
1044  case CAT_CMP_fail_pct_1621:
1045  case CAT_refl_loc_1600:
1046  case CAT_refl_loc_2100:
1047  case CAT_refl_loc_1621:
1048 /* WDR temporary re-route to output of initial albedo
1049 */
1055 /*
1056 */
1057  get_cmp(l2rec, p->cat_ix, fbuf);
1058  pbuf = (VOIDP) fbuf;
1059  break;
1060  case CAT_Cld_Sfc_Type:
1061  case CAT_Cld_Phase_2100:
1062  case CAT_Cld_Non_Abs_Band:
1063  case CAT_Cld_Phase_1600:
1064  case CAT_Cld_Phase_1621:
1065  pbuf = (VOIDP)get_cmp_byt( l2rec, p->cat_ix );
1066  break;
1067 
1068 
1069  default:
1070  fprintf(stderr, "-E- %s Line %d: Unknown product catalogue ID %d.\n",
1071  __FILE__, __LINE__, p->cat_ix);
1072  exit(1);
1073  }
1074 
1075  return (pbuf);
1076 }
1077 
#define CAT_Taua
Definition: l2prod.h:10
#define CAT_chl_morel
Definition: l2prod.h:231
#define CAT_rhot
Definition: l2prod.h:56
#define CAT_senz
Definition: l2prod.h:20
int8_t * get_qual_sst_triple(l2str *l2rec)
Definition: sst.c:7549
#define CAT_bb_gsm
Definition: l2prod.h:94
#define CAT_ms_epsilon
Definition: l2prod.h:235
#define CAT_chl_carder_emp
Definition: l2prod.h:159
#define CAT_stdv_sst4
Definition: l2prod.h:140
#define CAT_npp_vgpm
Definition: l2prod.h:316
#define MAX(A, B)
Definition: swl0_utils.h:26
#define CAT_aw
Definition: l2prod.h:261
#define CAT_adgs_giop
Definition: l2prod.h:205
#define CAT_prochlorococcus_hirata
Definition: l2prod.h:296
void get_fqy(l2str *l2rec, float fqy[])
Definition: fluorescence.c:239
#define MIN(x, y)
Definition: rice.h:169
#define CAT_Cld_Top_Refl_1600
Definition: l2prod.h:418
#define CAT_picoplankton_abundanceksm
Definition: l2prod.h:338
void get_habs_mph(l2str *l2rec, l2prodstr *p, float chl_mph[])
Definition: get_habs.c:261
#define CAT_par
Definition: l2prod.h:35
void get_bsi(l2str *l2rec, float *BSi)
Definition: get_bsi.c:20
#define CAT_prymnesiophytes_hirata
Definition: l2prod.h:300
#define CAT_calcite_ci2
Definition: l2prod.h:374
void get_rho_mumm(l2str *l2rec, int32_t ip, int32_t iw, float *rhom)
Definition: mumm.c:25
#define CAT_Cld_Top_Refl_1200
Definition: l2prod.h:417
#define CAT_adg_gsm
Definition: l2prod.h:64
#define CAT_class_ward_owmc
Definition: l2prod.h:243
#define CAT_mside
Definition: l2prod.h:79
#define CAT_CER_fail_1621
Definition: l2prod.h:433
#define CAT_counts_sst4
Definition: l2prod.h:310
#define CAT_CI_noncyano
Definition: l2prod.h:368
#define CAT_counts_sst3
Definition: l2prod.h:334
#define CAT_npp_cafe
Definition: l2prod.h:391
#define CAT_rhos
Definition: l2prod.h:44
#define CAT_mRrs_giop
Definition: l2prod.h:212
#define CAT_chl_giop
Definition: l2prod.h:197
#define CAT_no2_tropo
Definition: l2prod.h:27
#define CAT_O3_prof
Definition: l2prod.h:395
#define CAT_BT_40
Definition: l2prod.h:167
#define NBANDSIR
Definition: filehandle.h:23
#define CAT_CER_fail_1600
Definition: l2prod.h:432
#define CAT_aph_gsm
Definition: l2prod.h:95
void get_Kd(l2str *l2rec, l2prodstr *p, float prod[])
Definition: get_Kd.c:981
#define CAT_KPAR_lee
Definition: l2prod.h:164
#define CAT_owtn
Definition: l2prod.h:240
#define CAT_MCI_stumpf
Definition: l2prod.h:324
#define CAT_evi2
Definition: l2prod.h:73
#define CAT_bbp_unc_giop
Definition: l2prod.h:200
#define CAT_CER_1600
Definition: l2prod.h:402
#define CAT_L_u
Definition: l2prod.h:70
#define CAT_a_pml
Definition: l2prod.h:179
#define CAT_Surface_Albedo_650
Definition: l2prod.h:420
int16 * get_flags_carder(l2str *l2rec)
Definition: carder.c:948
#define CAT_no2_frac
Definition: l2prod.h:82
#define CAT_bias_mean_sst3
Definition: l2prod.h:333
#define CAT_owtd
Definition: l2prod.h:241
#define CAT_npp_mld
Definition: l2prod.h:350
unsigned char * get_flags_qaa(l2str *l2rec)
Definition: get_qaa.c:253
#define CAT_bbw
Definition: l2prod.h:262
#define CAT_aphs_giop
Definition: l2prod.h:204
#define CAT_Zsd_gbr
Definition: l2prod.h:248
#define CAT_picoplankton_hirata
Definition: l2prod.h:294
#define CAT_CER_fail_2100
Definition: l2prod.h:431
#define CAT_aer_ratio
Definition: l2prod.h:30
#define CAT_chl_oc3c
Definition: l2prod.h:256
#define CAT_npix_mgiop
Definition: l2prod.h:269
#define CAT_adg_giop
Definition: l2prod.h:196
#define CAT_aph_giop
Definition: l2prod.h:195
#define CAT_nanoplankton_volumeksm
Definition: l2prod.h:341
void get_smoke(l2str *l2rec, float smoke[])
Definition: get_smoke.c:20
#define CAT_CER_1621
Definition: l2prod.h:405
#define CAT_Sg_300_600_mlrc
Definition: l2prod.h:314
#define NULL
Definition: decode_rs.h:63
#define CAT_bb_carder
Definition: l2prod.h:85
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 as required for compatibility with version of the SDP toolkit Corrected test output file names to end in out
Definition: HISTORY.txt:422
void get_lambda_max(l2str *l2rec, float lambda_max[])
Definition: get_avw.c:226
void get_psd_ksm(l2str *l2rec, l2prodstr *p, float prod[])
Definition: get_psd_ksm.c:432
void get_avw(l2str *l2rec, float avw[])
Definition: get_avw.c:80
#define CAT_chl_hu
Definition: l2prod.h:250
#define CAT_adg_qaa
Definition: l2prod.h:106
#define CAT_iter_gsm
Definition: l2prod.h:110
#define CAT_diatoms_hirata
Definition: l2prod.h:292
#define CAT_nanoplankton_ratioksm
Definition: l2prod.h:345
void get_photic_depth(l2str *l2rec, l2prodstr *p, float Z[])
Definition: photic_depth.c:303
read l1rec
#define CAT_chl_cdr
Definition: l2prod.h:284
#define CAT_qual_sst
Definition: l2prod.h:122
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
#define CAT_b_qaa
Definition: l2prod.h:161
#define CAT_flags_giop
Definition: l2prod.h:213
#define CAT_stdv_sst3
Definition: l2prod.h:332
#define CAT_CMP_fail_pct_1600
Definition: l2prod.h:435
#define CAT_counts_sst
Definition: l2prod.h:309
#define CAT_Lw
Definition: l2prod.h:7
#define CAT_bbp_swim
Definition: l2prod.h:280
int16_t * get_flags_sst(l2str *l2rec)
Definition: sst.c:7562
void tindx_shi(l2str *l2rec, int32_t ip, float *tindx)
Definition: turbid.c:4
#define CAT_CWP_2100
Definition: l2prod.h:407
#define CAT_BSi
Definition: l2prod.h:273
#define CAT_windspeed
Definition: l2prod.h:22
#define CAT_microplankton_volumeksm
Definition: l2prod.h:340
unsigned char * get_cmp_byt(l2str *l2rec, int prodnum)
Definition: get_cmp.c:118
void get_Cphyt(l2str *l2rec, float cphyt[])
Definition: get_Cphyt.c:19
#define CAT_bb_las
Definition: l2prod.h:189
void get_cdom_morel(l2str *l2rec, l2prodstr *p, float prod[])
Definition: cdom_morel.c:319
#define CAT_bbp_giop
Definition: l2prod.h:194
#define CAT_rrsdiff_giop
Definition: l2prod.h:208
#define CAT_acdom_giop
Definition: l2prod.h:356
#define CAT_aph_pml
Definition: l2prod.h:183
#define CAT_sena
Definition: l2prod.h:19
#define CAT_water_vapor
Definition: l2prod.h:25
#define CAT_CER_2100
Definition: l2prod.h:401
#define CAT_no2_strat
Definition: l2prod.h:48
float * get_bias_mean_sst(l2str *l2rec)
Definition: sst.c:7658
#define CAT_ag_412_mlrc
Definition: l2prod.h:312
void get_habs_ci(l2str *l2rec, l2prodstr *p, float ci[])
Definition: get_habs.c:81
#define CAT_calcite_2b
Definition: l2prod.h:91
#define CAT_chl_oc2
Definition: l2prod.h:32
int8_t * get_qual_sst4(l2str *l2rec)
Definition: sst.c:7531
void get_gsm(l2str *l2rec, l2prodstr *p, float prod[])
Definition: gsm.c:803
#define CAT_no2_strat_unc
Definition: l2prod.h:228
#define CAT_bias_sst4
Definition: l2prod.h:138
#define CAT_anap_giop
Definition: l2prod.h:357
#define CAT_Surface_Albedo_1600
Definition: l2prod.h:423
#define CAT_fsol
Definition: l2prod.h:55
#define CAT_glint_coef
Definition: l2prod.h:40
#define CAT_flags_habs_mph
Definition: l2prod.h:326
float * get_sst_dust_correction(l2str *l2rec)
Definition: sst.c:7380
#define CAT_vLw
Definition: l2prod.h:154
#define CAT_nanoplankton_abundanceksm
Definition: l2prod.h:337
#define CAT_sfc_temp
Definition: l2prod.h:381
#define CAT_bbps_giop
Definition: l2prod.h:206
#define CAT_Cld_t
Definition: l2prod.h:426
void get_pft_uitz(l2str *l2rec, l2prodstr *p, float prod[])
Definition: get_pft_uitz.c:387
#define CAT_aph_carder
Definition: l2prod.h:86
#define CAT_Cld_Phase_1600
Definition: l2prod.h:413
#define CAT_a_swim
Definition: l2prod.h:276
void get_carder(l2str *l2rec, l2prodstr *p, float prod[])
Definition: carder.c:957
#define CAT_num_iter
Definition: l2prod.h:41
#define CAT_avw
Definition: l2prod.h:392
#define CAT_CWP_1600
Definition: l2prod.h:409
#define CAT_humidity_unc
Definition: l2prod.h:225
#define CAT_nanoplankton_uitz
Definition: l2prod.h:303
#define CAT_COT_fail_1600
Definition: l2prod.h:429
#define CAT_anap_unc_giop
Definition: l2prod.h:361
#define CAT_aph_qaa
Definition: l2prod.h:105
#define CAT_COT_2100
Definition: l2prod.h:403
#define CAT_flags_qaa
Definition: l2prod.h:215
#define CAT_pressure
Definition: l2prod.h:23
void get_bbws(l2str *l2rec, l2prodstr *p, float prod[])
Definition: seawater.c:254
#define CAT_poc_stramski_490
Definition: l2prod.h:173
#define CAT_dsdi
Definition: l2prod.h:389
#define CAT_bb_giop
Definition: l2prod.h:193
#define CAT_COT_1621
Definition: l2prod.h:406
#define CAT_c_qaa
Definition: l2prod.h:162
float * get_class_34k_w_owmc(l2str *l2rec)
Definition: get_owmc.c:214
#define CAT_flags_habs
Definition: l2prod.h:348
#define CAT_smoke
Definition: l2prod.h:46
void get_Rrs_brightness(l2str *l2rec, float Rrs_brightness[])
Definition: get_avw.c:170
void get_bpar(l2str *l2rec, l2prodstr *p, float prod[])
Definition: get_bpar.c:482
#define CAT_chl_vc
Definition: l2prod.h:260
instr * input
#define CAT_Surface_Albedo_2100
Definition: l2prod.h:424
character(len=1000) if
Definition: names.f90:13
#define CAT_adg_pml
Definition: l2prod.h:184
#define CAT_calcite_3b
Definition: l2prod.h:59
#define CAT_chl_carder
Definition: l2prod.h:88
#define CAT_aph_unc_giop
Definition: l2prod.h:201
#define CAT_pressure_unc
Definition: l2prod.h:224
#define CAT_Rrs_brightness
Definition: l2prod.h:393
#define CAT_qual_sst4
Definition: l2prod.h:123
#define CAT_bbp_qaa
Definition: l2prod.h:107
#define CAT_mod_rrs_qaa
Definition: l2prod.h:185
#define CAT_Lt_unc
Definition: l2prod.h:251
uint8_t * get_flags_habs(l2str *l2rec)
Definition: get_habs.c:673
int16 * get_iter_gsm(l2str *l2rec)
Definition: gsm.c:873
#define CAT_fsat
Definition: l2prod.h:83
#define CAT_windspeed_unc
Definition: l2prod.h:223
#define CAT_aph_mgiop
Definition: l2prod.h:268
#define CAT_a_las
Definition: l2prod.h:186
#define CAT_Cld_Non_Abs_Band
Definition: l2prod.h:412
#define CAT_refl_loc_1600
Definition: l2prod.h:437
#define CAT_cloud_albedo
Definition: l2prod.h:53
#define CAT_nitrate
Definition: l2prod.h:388
void get_fsat(l2str *l2rec, float flh[])
Definition: fluorescence.c:35
#define CAT_vnLw
Definition: l2prod.h:155
#define CAT_calcite
Definition: l2prod.h:124
#define CAT_aerindex
Definition: l2prod.h:43
#define CAT_height
Definition: l2prod.h:57
#define CAT_bias_mean_sst4
Definition: l2prod.h:308
#define CAT_npp_cbpm2
Definition: l2prod.h:318
#define CAT_picoplankton_volumeksm
Definition: l2prod.h:342
void get_poc(l2str *l2rec, int prodnum, float prod[])
Definition: get_poc.c:81
#define CAT_Cld_Phase_1621
Definition: l2prod.h:414
#define CAT_angstrom
Definition: l2prod.h:37
#define CAT_bias_sst
Definition: l2prod.h:137
#define CAT_refl_loc_2100
Definition: l2prod.h:438
#define CAT_windangle
Definition: l2prod.h:50
void get_pml(l2str *l2rec, l2prodstr *p, float prod[])
Definition: get_pml.c:268
#define CAT_aph_swim
Definition: l2prod.h:279
void get_ndvi_evi(l1str *l1rec, int prodnum, float prod[])
Definition: get_ndvi.c:203
#define CAT_bbp_carder
Definition: l2prod.h:99
#define CAT_fqy
Definition: l2prod.h:98
#define CAT_dpol
Definition: l2prod.h:90
#define CAT_chl_cdomcorr_morel
Definition: l2prod.h:249
#define CAT_chisqr_giop
Definition: l2prod.h:209
#define CAT_Rrs
Definition: l2prod.h:61
int get_cmp(l2str *l2rec, int prodnum, float prod[])
Definition: get_cmp.c:40
#define CAT_tg_sen
Definition: l2prod.h:16
#define CAT_KPAR_morel
Definition: l2prod.h:144
#define CAT_sola
Definition: l2prod.h:18
#define CAT_COT_fail_1621
Definition: l2prod.h:430
#define CAT_a_unc_giop
Definition: l2prod.h:198
int16_t * get_flags_sst_triple(l2str *l2rec)
Definition: sst.c:7593
#define CAT_class_34k_w_owmc
Definition: l2prod.h:246
#define CAT_fitpar_giop
Definition: l2prod.h:210
#define CAT_adg_swim
Definition: l2prod.h:278
#define CAT_microplankton_uitz
Definition: l2prod.h:302
void get_depth_classification(l2str *l2rec, float depth[])
#define CAT_sssref
Definition: l2prod.h:119
#define CAT_owt
Definition: l2prod.h:239
#define CAT_calcite_ci869
Definition: l2prod.h:376
#define CAT_bbp_mgiop
Definition: l2prod.h:266
#define CAT_picoplankton_ratioksm
Definition: l2prod.h:346
#define CAT_microplankton_hirata
Definition: l2prod.h:291
#define CAT_a_qaa
Definition: l2prod.h:102
#define CAT_evi
Definition: l2prod.h:45
#define CAT_calcite_ci748
Definition: l2prod.h:375
#define CAT_chl_unc_giop
Definition: l2prod.h:203
#define CAT_adg_carder
Definition: l2prod.h:87
#define CAT_a_niwa
Definition: l2prod.h:217
void chl_carder_empirical(l2str *l2rec, float prod[])
Definition: carder.c:1168
#define CAT_npp_bbp
Definition: l2prod.h:353
void get_ice_frac(l2str *l2rec, float ice[])
Definition: get_ice_frac.c:17
#define CAT_flh
Definition: l2prod.h:60
#define CAT_evi3
Definition: l2prod.h:74
#define CAT_vgain
Definition: l2prod.h:151
#define CAT_Zsd_morel
Definition: l2prod.h:148
#define CAT_CI_stumpf
Definition: l2prod.h:323
#define CAT_fitpar_mgiop
Definition: l2prod.h:271
float * get_bias_sst_triple(l2str *l2rec)
Definition: sst.c:7423
int16_t * get_counts_sst4(l2str *l2rec)
Definition: sst.c:7462
void get_chl(l2str *l2rec, int prodnum, float prod[])
Definition: get_chl.c:462
#define CAT_chl_oc4
Definition: l2prod.h:49
#define CAT_vbtgt
Definition: l2prod.h:157
#define CAT_t_sen
Definition: l2prod.h:13
float * get_sst(l2str *l2rec)
Definition: sst.c:7606
#define CAT_bb_pml
Definition: l2prod.h:181
#define CAT_aer_model
Definition: l2prod.h:29
#define CAT_Cphyt
Definition: l2prod.h:397
#define CAT_ipar
Definition: l2prod.h:97
VOIDP extract_band(float *fbuf, l2prodstr *p, int32 nbands)
Definition: prodgen.c:31
float * get_sst4(l2str *l2rec)
Definition: sst.c:7625
void get_angstrom(l2str *l2rec, int band, float angst[])
Definition: aerosol.c:4529
#define CAT_ice_frac
Definition: l2prod.h:236
#define CAT_Q_prof
Definition: l2prod.h:386
float * get_sst_triple(l2str *l2rec)
Definition: sst.c:7644
void optical_water_type(l2str *l2rec, l2prodstr *p, void *vptr)
Definition: owt.c:325
#define CAT_npp_zno3
Definition: l2prod.h:351
#define CAT_nw
Definition: l2prod.h:263
#define CAT_sst4
Definition: l2prod.h:111
#define CAT_Kd_morel
Definition: l2prod.h:142
#define CAT_iCDOM_morel
Definition: l2prod.h:229
#define CAT_npp_par
Definition: l2prod.h:352
#define CAT_relaz
Definition: l2prod.h:214
#define CAT_vbsat
Definition: l2prod.h:156
#define CAT_Cld_Sfc_Type
Definition: l2prod.h:410
#define CAT_T_prof
Definition: l2prod.h:383
float * get_stdv_sst4(l2str *l2rec)
Definition: sst.c:7488
#define CAT_lambda_max
Definition: l2prod.h:394
#define CAT_detnum
Definition: l2prod.h:78
#define CAT_CMP_fail_pct_1621
Definition: l2prod.h:436
#define CAT_Surface_Albedo_860
Definition: l2prod.h:421
#define CAT_iparb
Definition: l2prod.h:287
#define CAT_brdf
Definition: l2prod.h:42
void get_nitrate(l2str *l2rec, l2prodstr *p, float prod[])
Definition: get_nitrate.c:70
#define CAT_opt_siop_giop
Definition: l2prod.h:364
#define CAT_Kd_mueller
Definition: l2prod.h:38
int16 * get_iter_giop(l2str *l2rec)
Definition: giop.c:2710
#define CAT_flags_sst4
Definition: l2prod.h:121
#define CAT_rhom
Definition: l2prod.h:141
#define CAT_iter_giop
Definition: l2prod.h:207
#define CAT_Cld_Top_Refl_2100
Definition: l2prod.h:419
#define CAT_bb
Definition: l2prod.h:101
#define CAT_sstref
Definition: l2prod.h:67
float * get_bias_sst(l2str *l2rec)
Definition: sst.c:7392
#define CAT_bbws
Definition: l2prod.h:274
#define CAT_bb_unc_giop
Definition: l2prod.h:199
#define CAT_adg_mgiop
Definition: l2prod.h:267
#define CAT_chl_oc3
Definition: l2prod.h:72
#define CAT_BT_39
Definition: l2prod.h:166
#define CAT_BT
Definition: l2prod.h:165
void get_par(l2str *l2rec, float par[])
Definition: get_par.c:34
#define CAT_nanoplankton_hirata
Definition: l2prod.h:298
#define CAT_prokaryotes_hirata
Definition: l2prod.h:295
void bioOptBandShift(l2str *l2rec, l2prodstr *p, float prod[])
#define CAT_bias_mean_sst
Definition: l2prod.h:307
#define CAT_Es
Definition: l2prod.h:11
#define CAT_Sg_275_295_mlrc
Definition: l2prod.h:313
#define CAT_Lt
Definition: l2prod.h:4
#define CAT_solz
Definition: l2prod.h:17
#define CAT_t_sol
Definition: l2prod.h:12
#define CAT_sfc_humidity
Definition: l2prod.h:380
void get_es(l2str *l2rec, int band, float Es[])
Definition: get_es.c:24
#define CAT_bbp_pml
Definition: l2prod.h:182
#define CAT_BT_12
Definition: l2prod.h:170
#define CAT_nLw
Definition: l2prod.h:8
#define CAT_crat_mgiop
Definition: l2prod.h:270
#define CAT_tLf
Definition: l2prod.h:9
float * get_bias_mean_sst_triple(l2str *l2rec)
Definition: sst.c:7689
#define CAT_L_q
Definition: l2prod.h:68
#define CAT_CMP_fail_pct_2100
Definition: l2prod.h:434
#define CAT_Kd_KD2
Definition: l2prod.h:150
#define CAT_Kd_jamet
Definition: l2prod.h:283
#define CAT_adg_morel
Definition: l2prod.h:232
#define CAT_humidity
Definition: l2prod.h:24
#define CAT_bbph_unc_giop
Definition: l2prod.h:362
#define CAT_Cld_Phase_2100
Definition: l2prod.h:411
#define CAT_Kd_532
Definition: l2prod.h:163
#define CAT_sst3
Definition: l2prod.h:328
#define CAT_Zphotic_lee
Definition: l2prod.h:160
#define BAD_FLT
Definition: jplaeriallib.h:19
#define CAT_Lr
Definition: l2prod.h:5
#define CAT_adg_unc_giop
Definition: l2prod.h:202
#define CAT_flags_niwa
Definition: l2prod.h:219
#define CAT_poc_stramski_443
Definition: l2prod.h:172
#define CAT_a_gsm
Definition: l2prod.h:93
#define CAT_COT_1600
Definition: l2prod.h:404
#define CAT_sfc_pressure
Definition: l2prod.h:379
#define CAT_flags_sst3
Definition: l2prod.h:329
#define CAT_chl_abi
Definition: l2prod.h:320
#define CAT_greenalgae_hirata
Definition: l2prod.h:293
#define CAT_HGT_prof
Definition: l2prod.h:385
#define CAT_Rrs_vc
Definition: l2prod.h:259
#define CAT_bbnap_unc_giop
Definition: l2prod.h:363
#define CAT_bb_qaa
Definition: l2prod.h:104
#define CAT_stdv_sst
Definition: l2prod.h:139
float * get_bias_mean_sst4(l2str *l2rec)
Definition: sst.c:7671
int32_t nbands
int8_t * get_qual_sst(l2str *l2rec)
Definition: sst.c:7518
#define CAT_flags_carder
Definition: l2prod.h:89
#define CAT_vtLw
Definition: l2prod.h:153
#define CAT_rho_cirrus
Definition: l2prod.h:220
#define CAT_tindx_morel
Definition: l2prod.h:149
void vcal(l2str *l2rec, l2prodstr *p, float vcal[])
Definition: vcal.c:25
#define CAT_a_giop
Definition: l2prod.h:192
#define CAT_bbph_giop
Definition: l2prod.h:358
#define CAT_La
Definition: l2prod.h:6
float * get_stdv_sst(l2str *l2rec)
Definition: sst.c:7437
#define CAT_slot
Definition: l2prod.h:76
#define CAT_microplankton_abundanceksm
Definition: l2prod.h:336
int16 * get_flags_giop(l2str *l2rec)
Definition: giop.c:2722
#define CAT_picoplankton_uitz
Definition: l2prod.h:304
This should be set to the NetCDF standard name if exists for this product Create a function that computes your product edit get_myprod c add prototype to l12_proto h add get_myprod c to add_executable for l2gen and l3gen in CMakeLists txt Add an entry to the output routine to call your function edit prodgen c edit function prodgen() case CAT_myprod pbuf
#define CAT_water_vapor_unc
Definition: l2prod.h:226
void get_ipar(l2str *l2rec, float ipar[])
Definition: ipar.c:18
int16_t * get_counts_sst(l2str *l2rec)
Definition: sst.c:7450
#define CAT_microplankton_ratioksm
Definition: l2prod.h:344
#define CAT_epsilon
Definition: l2prod.h:28
void get_flh(l2str *l2rec, float flh[])
Definition: fluorescence.c:131
#define CAT_sst
Definition: l2prod.h:62
#define CAT_bbp_las
Definition: l2prod.h:190
void get_toa_refl(l2str *l2rec, int band, float rhot[])
Definition: get_toa_refl.c:19
#define CAT_tg_sol
Definition: l2prod.h:15
#define CAT_t_o2
Definition: l2prod.h:54
VOIDP prodgen(l2prodstr *p, l2str *l2rec)
Definition: prodgen.c:89
#define CAT_npp_eppley
Definition: l2prod.h:317
#define CAT_bbp_gsm
Definition: l2prod.h:65
#define CAT_polcor
Definition: l2prod.h:71
void get_pft_hirata(l2str *l2rec, l2prodstr *p, float prod[])
#define CAT_parb
Definition: l2prod.h:288
#define CAT_COT_fail_2100
Definition: l2prod.h:428
#define CAT_chl_oci
Definition: l2prod.h:254
int16_t * get_counts_sst_triple(l2str *l2rec)
Definition: sst.c:7475
#define CAT_TLg
Definition: l2prod.h:34
#define CAT_mwind_unc
Definition: l2prod.h:238
#define CAT_tindx_shi
Definition: l2prod.h:143
#define CAT_dinoflagellates_hirata
Definition: l2prod.h:297
void get_mgiop(l2str *l2rec, l2prodstr *p, float prod[])
Definition: mgiop.c:10
#define CAT_l2_flags
Definition: l2prod.h:31
#define CAT_Kd_obpg
Definition: l2prod.h:109
#define CAT_zwind
Definition: l2prod.h:52
#define CAT_bbps_las
Definition: l2prod.h:216
#define CAT_bias_sst3
Definition: l2prod.h:331
#define CAT_ndvi
Definition: l2prod.h:39
#define CAT_no2_tropo_unc
Definition: l2prod.h:227
void applyMultiplier(float *in, float *out, int count, float multiplier)
Definition: prodgen.c:75
#define CAT_b_las
Definition: l2prod.h:187
#define CAT_ozone_unc
Definition: l2prod.h:222
void get_swim(l2str *l2rec, l2prodstr *p, float prod[])
Definition: swim.c:741
#define CAT_flags_sst
Definition: l2prod.h:120
#define CAT_class_k_owmc
Definition: l2prod.h:245
float * get_stdv_sst_triple(l2str *l2rec)
Definition: sst.c:7505
#define CAT_depth_class
Definition: l2prod.h:33
#define CAT_chl_oci2
Definition: l2prod.h:257
float * get_bias_sst4(l2str *l2rec)
Definition: sst.c:7405
#define CAT_Zhl_morel
Definition: l2prod.h:145
void cdom_mannino(l2str *l2rec, int prodnum, float prod[])
Definition: cdom_mannino.c:7
void virtual_constellation(l2str *l2rec, l2prodstr *p, float prod[])
#define CAT_bb_swim
Definition: l2prod.h:277
#define CAT_acdom_unc_giop
Definition: l2prod.h:360
#define CAT_alpha
Definition: l2prod.h:80
#define CAT_a
Definition: l2prod.h:100
#define CAT_bbnap_giop
Definition: l2prod.h:359
#define CAT_c_las
Definition: l2prod.h:188
void get_niwa(l2str *l2rec, l2prodstr *p, float prod[])
Definition: get_niwa_iop.c:67
#define CAT_CI_cyano
Definition: l2prod.h:367
#define CAT_Cld_Top_Refl_650
Definition: l2prod.h:415
#define CAT_BT_11
Definition: l2prod.h:168
#define CAT_nKd_lin
Definition: l2prod.h:372
#define CAT_chl_gsm
Definition: l2prod.h:63
int i
Definition: decode_rs.h:71
int16_t * get_flags_sst4(l2str *l2rec)
Definition: sst.c:7575
void get_npp(l2str *l2rec, int prodnum, float prod[])
Definition: get_npp.c:35
int16 * get_flags_niwa(l2str *l2rec)
Definition: get_niwa_iop.c:99
#define CAT_Kd_lee
Definition: l2prod.h:108
#define CAT_Cld_p
Definition: l2prod.h:425
#define CAT_zwind_unc
Definition: l2prod.h:247
#define CAT_Kd_rhos
Definition: l2prod.h:322
uint8_t * get_flags_habs_mph(l2str *l2rec)
Definition: get_habs.c:356
#define CAT_scattang
Definition: l2prod.h:233
void get_las(l2str *l2rec, l2prodstr *p, float prod[])
Definition: las_iop.c:492
#define CAT_bb_niwa
Definition: l2prod.h:218
#define CAT_pixnum
Definition: l2prod.h:77
#define CAT_RH_prof
Definition: l2prod.h:384
void get_ms_epsilon(l2str *l2rec, float eps[])
Definition: aerosol.c:4577
#define CAT_refl_loc_1621
Definition: l2prod.h:439
#define CAT_qual_sst3
Definition: l2prod.h:330
#define CAT_vLt
Definition: l2prod.h:152
#define CAT_nLw_unc
Definition: l2prod.h:252
int npix
Definition: get_cmp.c:27
#define CAT_Rrs_unc
Definition: l2prod.h:253
#define CAT_t_h2o
Definition: l2prod.h:66
#define CAT_chl_owterr
Definition: l2prod.h:242
#define CAT_CWP_1621
Definition: l2prod.h:408
#define CAT_Cld_Top_Refl_860
Definition: l2prod.h:416
#define CAT_a_carder
Definition: l2prod.h:84
#define CAT_ozone
Definition: l2prod.h:21
float p[MODELMAX]
Definition: atrem_corl1.h:131
#define CAT_Zeu_morel
Definition: l2prod.h:146
#define CAT_Surface_Albedo_1200
Definition: l2prod.h:422
#define CAT_elev
Definition: l2prod.h:282
float * get_class_k_owmc(l2str *l2rec)
Definition: get_owmc.c:209
#define CAT_MPH_chl
Definition: l2prod.h:325
void get_giop(l2str *l2rec, l2prodstr *p, float prod[])
Definition: giop.c:2538
#define CAT_pCDOM_morel
Definition: l2prod.h:230
void calcite(l2str *l2rec, l2prodstr *p, float prod[])
Definition: calcite.c:541
void get_qaa(l2str *l2rec, l2prodstr *p, float prod[])
Definition: get_qaa.c:260
#define CAT_windangle_unc
Definition: l2prod.h:237
void tindx_morel(l2str *l2rec, int32_t ip, float *tindx)
Definition: turbid.c:65
#define CAT_picoeukaryotes_hirata
Definition: l2prod.h:299
float * get_class_ward_owmc(l2str *l2rec)
Definition: get_owmc.c:204
#define CAT_chl_mgiop
Definition: l2prod.h:265
#define CAT_mwind
Definition: l2prod.h:51
int count
Definition: decode_rs.h:79