OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
init_l1.c
Go to the documentation of this file.
1 
2 #include "l1.h"
3 
4 #include <stdio.h>
5 #include <stdlib.h>
6 
7 /* --------------------------------------------------------- */
8 /* init_l1() - initialize a Level-1 record */
9 
10 /* --------------------------------------------------------- */
11 void init_l1(l1str *l1rec) {
12  int32_t nbands = l1rec->l1file->nbands;
13  int32_t nbir = NBANDSIR;
14  int32_t npix = l1rec->npix = l1rec->l1file->npix;
15 
16  int32_t ip, ib, ipb;
17 
18  for (ip = 0; ip < npix; ip++) {
19  l1rec->lon [ip] = BAD_FLT;
20  l1rec->lat [ip] = BAD_FLT;
21  l1rec->solz [ip] = BAD_FLT;
22  l1rec->sola [ip] = BAD_FLT;
23  l1rec->senz [ip] = BAD_FLT;
24  l1rec->sena [ip] = BAD_FLT;
25  l1rec->delphi [ip] = BAD_FLT;
26  l1rec->csolz [ip] = BAD_FLT;
27  l1rec->csenz [ip] = BAD_FLT;
28  l1rec->alpha [ip] = BAD_FLT;
29  l1rec->scattang [ip] = BAD_FLT;
30 
31  l1rec->ws [ip] = BAD_FLT;
32  l1rec->wd [ip] = BAD_FLT;
33  l1rec->mw [ip] = BAD_FLT;
34  l1rec->zw [ip] = BAD_FLT;
35  l1rec->pr [ip] = BAD_FLT;
36  l1rec->oz [ip] = BAD_FLT;
37  l1rec->wv [ip] = BAD_FLT;
38  l1rec->rh [ip] = BAD_FLT;
39  l1rec->sfcp [ip] = BAD_FLT;
40  l1rec->sfcrh [ip] = BAD_FLT;
41  l1rec->sfct [ip] = BAD_FLT;
42  l1rec->icefr [ip] = BAD_FLT;
43  l1rec->no2_tropo [ip] = BAD_FLT;
44  l1rec->no2_strat [ip] = BAD_FLT;
45  l1rec->no2_frac [ip] = BAD_FLT;
46  l1rec->ws_unc [ip] = 0;
47  l1rec->wd_unc [ip] = 0;
48  l1rec->mw_unc [ip] = 0;
49  l1rec->zw_unc [ip] = 0;
50  l1rec->pr_unc [ip] = 0;
51  l1rec->oz_unc [ip] = 0;
52  l1rec->wv_unc [ip] = 0;
53  l1rec->rh_unc [ip] = 0;
54  l1rec->no2_tropo_unc[ip] = 0;
55  l1rec->no2_strat_unc[ip] = 0;
56  l1rec->height [ip] = BAD_FLT;
57  l1rec->glint_coef [ip] = BAD_FLT;
58  l1rec->cloud_albedo[ip] = BAD_FLT;
59  l1rec->aerindex [ip] = BAD_FLT;
60  l1rec->sstref [ip] = BAD_FLT;
61  l1rec->sssref [ip] = BAD_FLT;
62  l1rec->rho_cirrus [ip] = BAD_FLT;
63 
64  l1rec->ssttype[ip] = 0;
65  l1rec->pixnum [ip] = 0;
66  l1rec->slot [ip] = 0;
67  l1rec->flags [ip] = 0;
68  l1rec->dem [ip] = 0;
69  l1rec->ancqc [ip] = 0;
70  l1rec->mask [ip] = 0;
71  l1rec->hilt [ip] = 0;
72  l1rec->cloud [ip] = 0;
73  l1rec->glint [ip] = 0;
74  l1rec->land [ip] = 0;
75  l1rec->swater [ip] = 0;
76  l1rec->ice [ip] = 0;
77  l1rec->solzmax[ip] = 0;
78  l1rec->senzmax[ip] = 0;
79  l1rec->stlight[ip] = 0;
80  l1rec->absaer [ip] = 0;
81  l1rec->navfail[ip] = 0;
82  l1rec->navwarn[ip] = 0;
83  l1rec->filter [ip] = 0;
84  l1rec->pixdet [ip] = 0;
85  l1rec->nobs [ip] = 1;
86 
87  for (ib = 0; ib < nbands; ib++) {
88  ipb = ip * nbands + ib;
89  l1rec->Lt [ipb] = BAD_FLT;
90  l1rec->Lt_unc [ipb] = BAD_FLT;
91  l1rec->t_h2o [ipb] = BAD_FLT;
92  l1rec->t_o2 [ipb] = BAD_FLT;
93  l1rec->tg_sol [ipb] = BAD_FLT;
94  l1rec->tg_sen [ipb] = BAD_FLT;
95  l1rec->t_sol [ipb] = BAD_FLT;
96  l1rec->t_sen [ipb] = BAD_FLT;
97  l1rec->rhof [ipb] = BAD_FLT;
98  l1rec->tLf [ipb] = BAD_FLT;
99  l1rec->Lr [ipb] = BAD_FLT;
100  l1rec->L_q [ipb] = BAD_FLT;
101  l1rec->L_u [ipb] = BAD_FLT;
102  l1rec->polcor [ipb] = BAD_FLT;
103  l1rec->dpol [ipb] = BAD_FLT;
104  l1rec->TLg [ipb] = BAD_FLT;
105  l1rec->rhos [ipb] = BAD_FLT;
106  l1rec->sw_a [ipb] = BAD_FLT;
107  l1rec->sw_bb [ipb] = BAD_FLT;
108  l1rec->sw_a_avg [ipb] = BAD_FLT;
109  l1rec->sw_bb_avg[ipb] = BAD_FLT;
110  l1rec->sw_n [ipb] = BAD_FLT;
111  l1rec->radcor [ipb] = 0.0;
112 
113  }
114 
115  for (ib = 0; ib < nbir; ib++) {
116  ipb = ip * nbir + ib;
117  l1rec->Ltir[ipb] = BAD_FLT;
118  l1rec->Bt [ipb] = BAD_FLT;
119  }
120 
121  } // ip
122 
123  l1rec->alt = BAD_FLT;
124  l1rec->scn_fmt = 0;
125  l1rec->is_l2 = 0;
126 
127  for (ib = 0; ib < nbands; ib++) {
128  l1rec->Fo[ib] = BAD_FLT;
129  }
130 }
131 
132 
133 
#define NBANDSIR
Definition: filehandle.h:23
read l1rec
#define BAD_FLT
Definition: jplaeriallib.h:19
void init_l1(l1str *l1rec)
Definition: init_l1.c:11
int32_t nbands
int npix
Definition: get_cmp.c:27