OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
init_l2.c
Go to the documentation of this file.
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include "l2_struc.h"
4 #include "l12_parms.h"
5 #include "l12_proto.h"
6 
7 /* --------------------------------------------------------- */
8 /* init_l2() - initialize a Level-2 record */
9 
10 /* --------------------------------------------------------- */
11 void init_l2(l2str *l2rec, int32_t nbands) {
12  int32_t ip, ib, ipb;
13  int32_t npix = l2rec->l1rec->npix;
14 
15  for (ip = 0; ip < npix; ip++) {
16 
17  l2rec->num_iter[ip] = BAD_INT;
18  l2rec->aermodmin[ip] = BAD_INT;
19  l2rec->aermodmax[ip] = BAD_INT;
20  l2rec->aermodmin2[ip] = BAD_INT;
21  l2rec->aermodmax2[ip] = BAD_INT;
22 
23  l2rec->chl[ip] = BAD_FLT;
24  l2rec->eps[ip] = BAD_FLT;
25  l2rec->aerratio[ip] = BAD_FLT;
26  l2rec->aerratio2[ip] = BAD_FLT;
27  l2rec->aerindex[ip] = BAD_FLT;
28 
29  for (ib = 0; ib < nbands; ib++) {
30  ipb = ip * nbands + ib;
31  l2rec->taua[ipb] = BAD_FLT;
32  l2rec->La[ipb] = BAD_FLT;
33  l2rec->Lw[ipb] = BAD_FLT;
34  l2rec->nLw[ipb] = BAD_FLT;
35  l2rec->nLw_unc[ipb] = 0.0;
36  l2rec->brdf[ipb] = BAD_FLT;
37  l2rec->Rrs[ipb] = BAD_FLT;
38  l2rec->Rrs_unc[ipb] = 0.0;
39  l2rec->outband_correction[ipb] = 1.0;
40  l2rec->a[ipb] = BAD_FLT;
41  l2rec->bb[ipb] = BAD_FLT;
42  }
43 
44  }
45 }
void init_l2(l2str *l2rec, int32_t nbands)
Definition: init_l2.c:11
#define BAD_FLT
Definition: jplaeriallib.h:19
int32_t nbands
#define BAD_INT
Definition: genutils.h:23
int npix
Definition: get_cmp.c:27