OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
calcite.c
Go to the documentation of this file.
1 /*---------------------------------------------------------------------*/
2 /* calcite.c - get calcium carbonate concentration. */
3 /* */
4 /* Inputs: */
5 /* l2rec - level-2 structure containing one complete scan after */
6 /* atmospheric correction. */
7 /* Outputs: */
8 /* caco3 - calcium carbonate concentration, per pixel . */
9 /* */
10 /* Written by: W. Robinson, GSC, 7 Jun 2000. */
11 /* S. Bailey, OCDPG, July 2004, conversion to C. */
12 /* B. Franz, OCDPG, Sep 2004, sensor generalization and */
13 /* implementation of 2-Band algorithm. */
14 /* */
15 /* 2014: Standardized to use common table for 2-band alg */
16 /* and adjust green nLw as needed for sensor. */
17 /* */
18 /* 2014: Changed bbstar from 4 to 1.628. */
19 /* */
20 /*---------------------------------------------------------------------*/
21 
22 #include <stdlib.h>
23 #include <math.h>
24 #include "l12_proto.h"
25 #include "l2_flags.h"
26 
27 #define BAD_CACO3 BAD_FLT
28 
29 static int32_t caco3_msk = LAND | HIGLINT | CLOUD | HILT;
30 static float pi = PI;
31 static float bbstr = 1.628;
32 static float caco3min = 1e-5; // BCB - was 1.18e-5
33 static float caco3hi = 0.0005; // BCB - was 0.003
34 static float fixedbbstar = 1.28;
35 
36 /* --------------------------------------------------------------------- */
37 /* calcite_3b() - calcium carbonate concentration from 3-Band algorith.. */
38 /* */
39 /* Gordon, H.R. Boynton, G.C., Balch, W.M., Groom, S.B., Harbour, D.S., */
40 /* Smyth, T.J., Retrieval of Coccolithophore Calcite Concentration from */
41 /* SeaWiFS Imagery, GRL, 28, 8, 1587-1590. */
42 /* */
43 /* --------------------------------------------------------------------- */
44 
45 float calcite_3b(l2str *l2rec, int32_t ip) {
46  static int firstCall = 1;
47  static int maxiter = 10;
48  static float ftrans = 6.179; /* (1/.298)*(1/.543) */
49 
50  static float wave[3] = {670., 760., 870.}; /* approx. wavelengths */
51  static int bx [3];
52  static float aw [3];
53  static float bbw [3];
54  static float bbc [3];
55  static float t [3];
56  static float b68diff;
57  static float b78diff;
58  static float fw1, fw2;
59 
60  static float oobswf[3][8] = {
61  {0.000313529, 0.000770558, 0.00152194, 0.000155573,
62  0.00116455, 0.0, 0.000445433, 0.000124172},
63  {0.000201709, 6.96143e-05, 7.00147e-06, 2.28957e-07,
64  4.17788e-05, 0.00159814, 0.0, 0.00536827},
65  {0.000463807, 8.54003e-05, 2.47401e-05, 0.000755890,
66  0.00587073, 0.00021686, 0.0111331, 0.0}
67  };
68 
69  int32_t ipb, ib, i;
70  float *rhoaw;
71  float rho[3];
72  float bbc_cclth, r8_cclth, aeps_cclth;
73  float bbcinit, bbctol;
74  int numiter;
75  int32_t nwave, status = 0;
76  float *awptr, *bbwptr;
77  float caco3;
78  float bbw546;
79  float newbbstar; // BCB - new, dynamic bb*
80 
81  l1str *l1rec = l2rec->l1rec;
82  filehandle *l1file = l1rec->l1file;
83  nwave = l1file->nbands;
84 
85  if (firstCall) {
86 
87  /* save coeffs for the three bands, resolve actual sensor wave */
88  for (i = 0; i < 3; i++) {
89  bx [i] = windex(wave[i], l1file->fwave, nwave);
90  wave[i] = l1file->fwave[bx[i]];
91 
92  bbc [i] = 0.0;
93  }
94 
95  b68diff = wave[2] - wave[0];
96  b78diff = wave[1] - wave[0];
97 
98  /* spectral dependence of bbc */
99  fw1 = pow(wave[0] / wave[1], 1.35);
100  fw2 = pow(wave[0] / wave[2], 1.35);
101 
102  firstCall = 0;
103  }
104 
105  /* set aw & bbw */
106 
107  ipb = ip*nwave;
108  awptr = &l1rec->sw_a_avg[ipb];
109  bbwptr = &l1rec->sw_bb_avg[ipb];
110 
111  for (i = 0; i < 3; i++) {
112  aw [i] = awptr [bx[i]];
113  bbw [i] = bbwptr[bx[i]];
114  }
115  bbw546 = seawater_bb(546.0, l1rec->sstref[ip], l1rec->sssref[ip], 0.039);
116 
117  status = 0;
118  numiter = 0;
119  bbctol = 100.;
120  bbcinit = 0.00085;
121  caco3 = BAD_CACO3;
122  bbc[0] = 0.000;
123 
124  /* skip pixel if already masked (this should not include ATMFAIL) */
125  if ((l1rec->flags[ip] & caco3_msk) != 0) {
126  return (caco3);
127  }
128 
129  if ((rhoaw = (float *) calloc(nwave, sizeof (float))) == NULL) {
130  printf("-E- : Error allocating memory to rhoaw\n");
131  exit(FATAL_ERROR);
132  }
133 
134  /* compute the aerosol/water reflectance (include out-of-band correction for SeaWiFS) */
135  if (l1file->sensorID == SEAWIFS) {
136  for (ib = 0; ib < nwave; ib++) {
137  ipb = nwave * ip + ib;
138  rhoaw[ib] = ((l2rec->l1rec->Lt[ipb] / l1rec->tg_sol[ipb] / l1rec->tg_sen[ipb] - l1rec->tLf[ipb]
139  - l1rec->Lr[ipb]) / l1rec->t_o2[ipb] - l1rec->TLg[ipb]) * pi / l1rec->Fo[ib] / l1rec->csolz[ip];
140  }
141  for (i = 0; i < 3; i++) {
142  rho[i] = rhoaw[bx[i]];
143  for (ib = 0; ib < nwave; ib++) {
144  rho[i] -= rhoaw[ib] * oobswf[i][ib];
145  if (rho[i] <= 0.0) status = 1;
146  }
147  }
148  } else {
149  for (i = 0; i < 3; i++) {
150  ib = bx[i];
151  ipb = nwave * ip + ib;
152  rho[i] = ((l2rec->l1rec->Lt[ipb] / l1rec->tg_sol[ipb] / l1rec->tg_sen[ipb] - l1rec->tLf[ipb]
153  - l1rec->Lr[ipb]) / l1rec->t_o2[ipb] - l1rec->TLg[ipb]) * pi / l1rec->Fo[ib] / l1rec->csolz[ip];
154  if (rho[i] <= 0.0) status = 1;
155  }
156  }
157 
158  /* skip pixel on negative surface reflectance */
159  if (status != 0) {
160  free(rhoaw);
161  return (caco3);
162  }
163 
164  /* compute total transmittance */
165  for (i = 0; i < 3; i++) {
166  ipb = nwave * ip + bx[i];
167  t[i] = l1rec->tg_sol[ipb] * l1rec->tg_sen[ipb] * l1rec->t_sol[ipb] * l1rec->t_sen[ipb];
168  }
169 
170  /* compute backscatter at 546 nm */
171  while (bbctol > 5. && numiter < maxiter) {
172 
173  numiter++;
174 
175  bbc[1] = bbc[0] * fw1;
176  bbc[2] = bbc[0] * fw2;
177 
178  /* reflectance at longest wavelength */
179  r8_cclth = rho[2] - (bbw[2] + bbc[2]) / (aw[2] + bbw[2] + bbc[2]) / ftrans * t[2];
180 
181  if ((r8_cclth > 0.09) || (r8_cclth < 0)) {
182  status = 1;
183  bbc[0] = 0;
184  break;
185  }
186 
187  /* atmospheric epsilon at two longest wavelengths */
188  aeps_cclth = log((rho[1] - (bbw[1] + bbc[1]) / (aw[1] + bbw[1] + bbc[1]) / ftrans * t[1]) / r8_cclth) / b78diff;
189 
190  if (aeps_cclth > 0.4) {
191  status = 1;
192  bbc[0] = 0;
193  break;
194  }
195 
196  /* --------------- */
197  bbc[0] = (rho[0] - r8_cclth * exp(aeps_cclth * b68diff)) / t[0] * (aw[0] + bbw[0] + bbc[0]) * ftrans - bbw[0];
198 
199  if ((bbc[0] <= 0) || isnan(bbc[0])) {
200  status = 1;
201  bbc[0] = 0;
202  break;
203  }
204 
205  bbctol = fabs((bbcinit - bbc[0]) / bbcinit)*100.;
206  bbcinit = bbc[0];
207  }
208 
209 
210  if (status == 0) {
211 
212  bbc_cclth = bbc[0] / pow((546. / wave[0]), 1.35) - bbw546;
213  if (bbc_cclth > 0) {
214  // convert to calcite in moles/m^3 (Balch 2005)
215  caco3 = bbc_cclth / bbstr;
216  newbbstar = pow(10,(0.2007476*log10(caco3)*log10(caco3) + 1.033187*log10(caco3) + 1.069821));
217 
218  if (newbbstar < fixedbbstar) {
219  newbbstar = fixedbbstar;
220  }
221 
222  caco3 = caco3*bbstr/newbbstar;
223  }
224  }
225 
226  free(rhoaw);
227 
228  return (caco3);
229 }
230 
231 
232 /* --------------------------------------------------------------------- */
233 /* calcite_2b() - calcium carbonate concentration from 2-Band algorith.. */
234 /* */
235 /* Gordon, H.R. and Balch, W.M., MODIS Detached Coccolith Concentration */
236 /* Algorithm Theoretical Basis Document, April 30, 1999 */
237 /* */
238 /* --------------------------------------------------------------------- */
239 
240 #define N443 490
241 #define N550 456
242 
243 float calcite_2b(l2str *l2rec, int32_t ip) {
244  static int firstCall = 1;
245  static int bandShift = 0;
246 
247  static float* t443;
248  static float* t550;
249  typedef float tbb_t[N550];
250  static tbb_t* tbb;
251  static int32_t ib443;
252  static int32_t ib550;
253 
254  float caco3;
255  int i443 = 0, i550 = 0;
256  float x, y, a, b;
257  int32_t nwave, i, nc;
258  float x443, x550;
259  float bb1, bb2, bb;
260  float newbbstar; // BCB - new, dynamic bb*
261 
262  l1str *l1rec = l2rec->l1rec;
263  filehandle *l1file = l1rec->l1file;
264  nwave = l1file->nbands;
265 
266  if (firstCall) {
267 
268  t443 = (float*) allocateMemory(N443 * sizeof (float), "t443");
269  t550 = (float*) allocateMemory(N550 * sizeof (float), "t550");
270  tbb = (tbb_t*) allocateMemory(N443 * sizeof (tbb_t), "tbb");
271 
272  FILE *fp;
273  char filename[FILENAME_MAX];
274  char line [80];
275 
276  strcpy(filename, input->picfile);
277  if (strlen(filename) == 0) {
278  printf("-E- %s line %d: No picfile specified.\n", __FILE__, __LINE__);
279  exit(1);
280  }
281  printf("Loading PIC 2-band algorithm table %s\n", filename);
282 
283  ib443 = windex(443., l1file->fwave, nwave);
284  ib550 = windex(550., l1file->fwave, nwave);
285 
286  if (strstr(filename, "common") != NULL) {
287  printf("Assuming PIC table is for 443nm and 555nm.\n");
288  bandShift = 1;
289  ib443 = bindex_get(443);
290  ib550 = bindex_get_555();
291  if (ib443 < 0 || ib550 < 0) {
292  printf("-E- %s line %d: required bands not available PIC\n",
293  __FILE__, __LINE__);
294  exit(1);
295  }
296  }
297 
298  if ((fp = fopen(filename, "r")) == NULL) {
299  fprintf(stderr, "-E- %s line %d: unable to open %s for reading\n",
300  __FILE__, __LINE__, filename);
301  exit(1);
302  }
303 
304  // Skip comment lines
305  nc = 0;
306  while (fgets(line, 80, fp)) {
307  if (line[0] != '#' && line[0] != '\n') {
308  break;
309  }
310  nc++;
311  }
312  rewind(fp);
313  for (i = 0; i < nc; i++)
314  fgets(line, 80, fp);
315 
316  // Load table
317 
318  for (i443 = 0; i443 < N443; i443++)
319  for (i550 = 0; i550 < N550; i550++) {
320  fscanf(fp, "%f %f %f %f\n", &x, &y, &a, &b);
321  t443[i443] = x;
322  t550[i550] = y;
323  tbb [i443][i550] = a;
324  }
325 
326  firstCall = 0;
327  }
328 
329  caco3 = BAD_CACO3;
330 
331  // skip pixel if already masked (this includes ATMFAIL)
332  if (l1rec->mask[ip]) {
333  return (caco3);
334  }
335 
336  x443 = l2rec->nLw[ip * nwave + ib443];
337  x550 = l2rec->nLw[ip * nwave + ib550];
338 
339  // if required radiances are negative, fail; BCB - correct comment
340  if (x550 <= 0.0) {
341  return (caco3);
342  }
343  if (x443 <= 0.0) {
344  return (caco3);
345  }
346 
347  // adjust nLw to 555 based on Rrs555/Rrs5xx ratio
348  if (bandShift) {
349  float Rrs555 = conv_rrs_to_555(l2rec->Rrs[ip * nwave + ib550], l1file->fwave[ib550]);
350  x550 *= Rrs555 / l2rec->Rrs[ip * nwave + ib550];
351  }
352 
353  // locate bounding table indices
354  for (i = 0; i < N443; i++) {
355  if (x443 < t443[i]) {
356  i443 = i;
357  break;
358  }
359  }
360  if (x443 >= t443[N443-1]) // BCB - Explicit check for high side of the table
361  i443 = N443;
362 
363  for (i=0; i<N550; i++) {
364  if (x550 < t550[i]) {
365  i550 = i;
366  break;
367  }
368  }
369  if (x550 >= t550[N550-1]) // BCB - Explicit check for high side of the table
370  i550 = N550;
371 
372  // radiances less than table entries, fail and don't call 3band; BCB - change failure
373  if (i443 <=0) { // BCB - is nLw443 is lower than any entry in table?
374  return(-1.0); // BCB - yes, set failure mode
375  }
376  if (i550 <=0) { // BCB - is nLw550 is lower than any entry in table?
377  return(-1.0); // BCB - yes, set failure mode
378  }
379 
380  // radiances greater than table entries, fail
381  if (i443 >= N443 || i550 >= N550) {
382  return (caco3);
383  }
384 
385  // radiances associated with missing table entries, fail
386  if (tbb[i443 - 1][i550 - 1] > 998.9 || tbb[i443 ][i550 - 1] > 998.9 ||
387  tbb[i443 - 1][i550 ] > 998.9 || tbb[i443 ][i550 ] > 998.9) {
388  return (caco3);
389  }
390 
391  // interpolate to get bb(546)
392  bb1 = tbb[i443 - 1][i550 - 1] + (x443 - t443[i443 - 1])*
393  (tbb[i443][i550 - 1] - tbb[i443 - 1][i550 - 1]) / (t443[i443] - t443[i443 - 1]);
394 
395  bb2 = tbb[i443 - 1][i550 ] + (x443 - t443[i443 - 1])*
396  (tbb[i443][i550 ] - tbb[i443 - 1][i550 ]) / (t443[i443] - t443[i443 - 1]);
397 
398  bb = bb1 + (x550 - t550[i550 - 1]) * (bb2 - bb1) / (t550[i550] - t550[i550 - 1]);
399 
400  // convert to calcite in moles/m^3 (Balch 2005)
401  caco3 = bb / bbstr;
402 
403  newbbstar = pow(10,(0.2007476*log10(caco3)*log10(caco3) + 1.033187*log10(caco3) + 1.069821));
404 
405  if (newbbstar < fixedbbstar) {
406  newbbstar = fixedbbstar;
407  }
408 
409  caco3 = caco3*bbstr/newbbstar;
410 
411  // if (caco3 < caco3min ) {
412  // caco3 = caco3min;
413  //}
414 
415  return(caco3);
416 }
417 
418 
419 
420 /* --------------------------------------------------------------------- */
421 /* calcite_c() - calcium carbonate concentration (combined algorithm) */
422 /* --------------------------------------------------------------------- */
423 float calcite_c(l2str *l2rec, int32_t ip) {
424  float caco3 = BAD_CACO3;
425  int32_t shallow;
426  int32_t turbid;
427  int32_t shallowDepth = 30; // BCB - how shallow is too shallow?
428 
429  turbid = ((l2rec->l1rec->flags[ip] & TURBIDW) != 0); // BCB - is the TURBID flag set?
430  shallow = (abs(l2rec->l1rec->dem[ip]) < shallowDepth); // BCB - use depth, rather than SHALLOW flag
431 
432 
433  if (turbid & shallow) {
434  caco3 = BAD_CACO3; // BCB - if it's shallow and turbid, we don't believe it.
435  } else {
436  caco3 = calcite_2b(l2rec,ip); // BCB - calculate 2 band value
437  if (caco3 < 0.0) { // BCB - did it fail?
438  if (caco3 < -2.0) { // BCB - yes, how did it fail?
439  caco3 = calcite_3b(l2rec,ip); // BCB - normal 2 band failure, call the 3 band
440  if (caco3 < caco3hi) { // BCB - is 3 band value believable?
441  caco3 = BAD_CACO3; // BCB - nope, fail.
442  }
443  } else {
444  caco3 = BAD_CACO3; // BCB - 2 band failed out of the low side of the table, fail
445  }
446  }
447  }
448 
449  // if valid value
450  if (caco3 > BAD_CACO3) {
451  caco3 = MAX(caco3, caco3min);
452  }
453 
454  return (caco3);
455 }
456 
457 /* --------------------------------------------------------------------- */
458 /* calcite_ci2() - calcium carbonate concentration - CI2 algorithm */
459 /* reference: doi:10.1002/2017JC013146 */
460 
461 /* --------------------------------------------------------------------- */
462 float calcite_ci2(l2str *l2rec, int32_t ip) {
463  float caco3 = BAD_CACO3;
464  int nwave = l2rec->l1rec->l1file->nbands;
465  static int32_t ibRed;
466  static int32_t ibGreen;
467  static int firstCall = 1;
468 
469  if (firstCall) {
470  ibRed = windex(667., l2rec->l1rec->l1file->fwave, nwave);
471  ibGreen = windex(550., l2rec->l1rec->l1file->fwave, nwave);
472  firstCall = 0;
473  }
474 
475  float RrsRed = l2rec->Rrs[ip * nwave + ibRed];
476  float RrsGreen = l2rec->Rrs[ip * nwave + ibGreen];
477  if (RrsRed >= 0.0 && RrsGreen >= 0.0) {
478  caco3 = 1.3055 * (RrsGreen - RrsRed) - 0.00188; // SRP 09/21 changed from previous caco3 = 0.4579 * (RrsGreen - RrsRed) - 0.0006;
479  }
480  if (caco3<0) {
481  caco3=BAD_CACO3;
482  }
483  return (caco3);
484 }
485 
486 /* --------------------------------------------------------------------- */
487 /* calcite_ciNIR() - calcium carbonate concentration - */
488 /* CI748 or CI869 algorithm */
489 /* reference: doi:10.1002/2017JC013146 */
490 
491 /* --------------------------------------------------------------------- */
492 float calcite_ciNIR(l2str *l2rec, int32_t ip, int32_t NIR) {
493  float caco3 = BAD_CACO3;
494  float CI = BAD_FLT;
495  int nwave = l2rec->l1rec->l1file->nbands;
496  static int32_t ibNIR;
497  static int32_t ibRed;
498  static int32_t ibGreen;
499  static float wvlratio;
500  static int firstCall = 1;
501 
502  if (firstCall) {
503  if (NIR == 869) {
504  ibNIR = windex(869., l2rec->l1rec->l1file->fwave, nwave);
505 
506  } else {
507  ibNIR = windex(748., l2rec->l1rec->l1file->fwave, nwave);
508  }
509  ibRed = windex(667., l2rec->l1rec->l1file->fwave, nwave);
510  ibGreen = windex(550., l2rec->l1rec->l1file->fwave, nwave);
511  wvlratio = (l2rec->l1rec->l1file->fwave[ibRed] -
512  l2rec->l1rec->l1file->fwave[ibGreen]) /
513  (l2rec->l1rec->l1file->fwave[ibNIR] -
514  l2rec->l1rec->l1file->fwave[ibGreen]);
515  firstCall = 0;
516  }
517 
518  float RrsNIR = l2rec->Rrs[ip * nwave + ibNIR];
519  if (RrsNIR == BAD_FLT)
520  RrsNIR = 0.0;
521  float RrsRed = l2rec->Rrs[ip * nwave + ibRed];
522  float RrsGreen = l2rec->Rrs[ip * nwave + ibGreen];
523  if (RrsRed >= 0.0 && RrsGreen >= 0.0) {
524  CI = RrsRed - (RrsGreen + (wvlratio * (RrsNIR - RrsGreen)));
525  if (NIR == 869) {
526  caco3 = -0.8013 * CI - 0.00076;
527  } else {
528  caco3 = -1.3764 * CI - 0.00071;
529  }
530  }
531  if (caco3<0) {
532  caco3=BAD_CACO3;
533  }
534 
535  return (caco3);
536 }
537 
538 /* ------------------------------------------------------------------- */
539 /* calcite() - l2_hdf_generic interface for calcite (pic) */
540 /* ------------------------------------------------------------------- */
541 void calcite(l2str *l2rec, l2prodstr *p, float prod[]) {
542  int32_t ip;
543 
544  for (ip = 0; ip < l2rec->l1rec->npix; ip++) {
545  switch (p->cat_ix) {
546  case CAT_calcite:
547  prod[ip] = calcite_c(l2rec, ip);
548  break;
549  case CAT_calcite_2b:
550  prod[ip] = calcite_2b(l2rec, ip);
551  break;
552  case CAT_calcite_3b:
553  prod[ip] = calcite_3b(l2rec, ip);
554  break;
555  case CAT_calcite_ci2:
556  prod[ip] = calcite_ci2(l2rec, ip);
557  break;
558  case CAT_calcite_ci748:
559  prod[ip] = calcite_ciNIR(l2rec, ip,748);
560  break;
561  case CAT_calcite_ci869:
562  prod[ip] = calcite_ciNIR(l2rec, ip,869);
563  break;
564  default:
565  printf("Error: %s : Unknown product specifier: %d\n", __FILE__, p->cat_ix);
566  exit(1);
567  break;
568  }
569 
570  if (prod[ip] == BAD_CACO3)
571  l2rec->l1rec->flags[ip] |= PRODFAIL;
572  }
573 
574  return;
575 }
int32 l1file(int32 sdfid, int32 *nsamp, int32 *nscans, int16 *dtynum)
Definition: l1stat_chk.c:586
#define MAX(A, B)
Definition: swl0_utils.h:26
data_t t[NROOTS+1]
Definition: decode_rs.h:77
float calcite_ci2(l2str *l2rec, int32_t ip)
Definition: calcite.c:462
#define CAT_calcite_ci2
Definition: l2prod.h:374
#define N443
Definition: calcite.c:240
int status
Definition: l1_czcs_hdf.c:32
#define N550
Definition: calcite.c:241
@ NIR
Definition: hybrid.c:24
void * allocateMemory(size_t numBytes, const char *name)
Definition: allocateMemory.c:7
#define NULL
Definition: decode_rs.h:63
read l1rec
const double pi
#define CAT_calcite_2b
Definition: l2prod.h:91
#define PRODFAIL
Definition: l2_flags.h:41
float calcite_3b(l2str *l2rec, int32_t ip)
Definition: calcite.c:45
instr * input
#define CAT_calcite_3b
Definition: l2prod.h:59
#define PI
Definition: l3_get_org.c:6
#define TURBIDW
Definition: l2_flags.h:22
#define CAT_calcite
Definition: l2prod.h:124
int bindex_get(int32_t wave)
Definition: windex.c:45
#define CAT_calcite_ci869
Definition: l2prod.h:376
#define CAT_calcite_ci748
Definition: l2prod.h:375
#define FATAL_ERROR
Definition: swl0_parms.h:5
#define BAD_CACO3
Definition: calcite.c:27
float calcite_2b(l2str *l2rec, int32_t ip)
Definition: calcite.c:243
char filename[FILENAME_MAX]
Definition: atrem_corl1.h:122
#define CLOUD
Definition: l2_flags.h:20
#define LAND
Definition: l2_flags.h:12
#define HILT
Definition: l2_flags.h:15
float calcite_c(l2str *l2rec, int32_t ip)
Definition: calcite.c:423
data_t b[NROOTS+1]
Definition: decode_rs.h:77
#define BAD_FLT
Definition: jplaeriallib.h:19
#define fabs(a)
Definition: misc.h:93
int windex(float wave, float twave[], int ntwave)
Definition: windex.c:73
#define HIGLINT
Definition: l2_flags.h:14
#define SEAWIFS
Definition: sensorDefs.h:12
#define abs(a)
Definition: misc.h:90
float calcite_ciNIR(l2str *l2rec, int32_t ip, int32_t NIR)
Definition: calcite.c:492
int i
Definition: decode_rs.h:71
How many dimensions is the output array Default is Not sure if anything above will work correctly strcpy(l2prod->title, "no title yet")
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
float seawater_bb(float wave, float sst, float sss, double delta)
Definition: seawater.c:176
float p[MODELMAX]
Definition: atrem_corl1.h:131
int bindex_get_555(void)
Definition: windex.c:57
void calcite(l2str *l2rec, l2prodstr *p, float prod[])
Definition: calcite.c:541
float conv_rrs_to_555(float Rrs, float wave)
Definition: convert_band.c:17