NASA Logo
Ocean Color Science Software

ocssw V2022
get_par.c
Go to the documentation of this file.
1 /* --------------------------------------------------------------- */
2 /* get_par.c - computes photosynthetically active radiation */
3 /* */
4 /* Inputs: */
5 /* l2rec - level-2 structure containing one complete scan */
6 /* after atmospheric correction. */
7 /* Outputs: */
8 /* par - Photosynthetically Active Radiation just above the */
9 /* surface from SeaWiFS level 1b instantaneous */
10 /* radiances at 412, 443, 490, 510, 555, and 670 nm. */
11 /* */
12 /* Algorithm Provided By: Robert Frouin, */
13 /* Scripps Institution of Oceanography */
14 /* */
15 /* Written By: B. A. Franz, SAIC GSC, SIMBIOS, 30 July 1999 */
16 /* Modified: */
17 /* Fall 2013, Robert Lossing, SAIC - Adapted underlying code to C */
18 /* --------------------------------------------------------------- */
19 
20 #include <math.h>
21 #include <stdlib.h>
22 
23 #include "l12_proto.h"
24 #include "par_utils.h"
25 #include "smi_climatology.h"
26 
27 static int *alloc_bindx(int nbands, int *bindx) {
28  if ((bindx = (int *) calloc(nbands, sizeof(int))) == NULL) {
29  printf("-E- : Error allocating memory to bindx in get_par\n");
30  exit(FATAL_ERROR);
31  }
32  return bindx;
33 }
34 
35 static int scan_processed = -1;
36 static float *parb, *parc, *par0, *para, *mu_est;
37 
39 
40 void get_par_scalar(l2str *l2rec, float par[]) {
41  if (scan_processed != l2rec->l1rec->iscan || scan_processed == -1) {
42  get_par2(l2rec, par);
43  }
44 
45  for (size_t ip = 0; ip < l2rec->l1rec->npix; ip++) {
46  calc_scalar_par_mean_cosine(l2rec, ip, para[ip], parc[ip], &par0[ip], &mu_est[ip]);
47  par[ip] = par0[ip];
48  }
49 };
50 
51 void get_par_below_surface(l2str *l2rec, float par[]) {
52  if (scan_processed != l2rec->l1rec->iscan || scan_processed == -1) {
53  get_par2(l2rec, para);
54  }
55  for (size_t ip = 0; ip < l2rec->l1rec->npix; ip++)
56  par[ip] = parb[ip];
57 };
58 
59 void get_mu_cosine(l2str *l2rec, float mu[]) {
60  get_par_scalar(l2rec, par0);
61  for (size_t ip = 0; ip < l2rec->l1rec->npix; ip++) {
62  mu[ip] = mu_est[ip];
63  if (mu_est[ip] == BAD_FLT) {
64  mu[ip] = BAD_FLT;
65  }
66  }
67 }
68 
69 void get_par2(l2str *l2rec, float par[]) {
70  if (scan_processed == l2rec->l1rec->iscan && scan_processed != -1) {
71  for (size_t ip = 0; ip < l2rec->l1rec->npix; ip++)
72  par[ip] = para[ip];
73  }
74 
75  int32_t ip, ib, ipb, iw;
76  float *Lt;
77  float angst;
78  float taua;
79 
80  static int32_t mask = SEAICE | LAND | HIGLINT | NAVFAIL;
81 
82  static float *lambda;
83  static float *Fobar;
84  static float *Taur;
85  static float *kO3;
86  static int *bindx;
87  static int nwave;
88  static int firstCall = TRUE;
89 
90  l1str *l1rec = l2rec->l1rec;
91  filehandle *l1file = l1rec->l1file;
92 
93  if (firstCall) {
94  firstCall = FALSE;
95  parb = (float *) calloc(l1rec->npix, sizeof(float));
96  parc = (float *) calloc(l1rec->npix, sizeof(float));
97  par0 = (float *) calloc(l1rec->npix, sizeof(float));
98  para = (float *) calloc(l1rec->npix, sizeof(float));
99  mu_est = (float *) calloc(l1rec->npix, sizeof(float));
100  par_planar_a_inst = (float *) calloc(l1rec->npix, sizeof(float));
101  par_planar_b_inst = (float *) calloc(l1rec->npix, sizeof(float));
102  int16_t year, day;
103  double sec;
104  unix2yds(l2rec->l1rec->scantime, &year, &day, &sec);
105  if (strlen(input->cld_rad1) == 0) {
106  printf("-Error-: rad1 file is not provided. Exiting ... \n ");
107  exit(EXIT_FAILURE);
108  }
109  if (strlen(input->cld_rad2) == 0) {
110  printf("-Error-: rad2 file is not provided. Exiting ... \n ");
111  exit(EXIT_FAILURE);
112  }
113  if (strlen(input->cld_rad3) == 0) {
114  printf("-Error-: rad3 file is not provided. Exiting ... \n ");
115  exit(EXIT_FAILURE);
116  }
117  if (strlen(input->anc_aerosol1) == 0) {
118  printf("-Error-: anc_aerosol1 file is not provided. Exiting ... \n ");
119  exit(EXIT_FAILURE);
120  }
121  if (strlen(input->anc_aerosol2) == 0) {
122  printf("-Error-: anc_aerosol2 file is not provided. Exiting ... \n ");
123  exit(EXIT_FAILURE);
124  }
125  if (strlen(input->anc_aerosol3) == 0) {
126  printf("-Error-: anc_aerosol3 file is not provided. Exiting ... \n ");
127  exit(EXIT_FAILURE);
128  }
129  if (l2rec->l1rec->cld_rad == NULL) {
130  printf("-Error-: cloud rad structure has not been allocated. Exiting ... \n ");
131  exit(EXIT_FAILURE);
132  }
133  /* Initialize climatologies */
134  smi_climatology_init(input->alphafile, day, ALPHA510);
135  smi_climatology_init(input->tauafile, day, TAUA865);
136  size_t total_waves = l1file->nbands;
137  // size_t count = 0;
138  size_t start_ib = total_waves;
139  size_t end_ib = 0;
140  switch (sensorId2InstrumentId(l1file->sensorID)) {
141  case INSTRUMENT_MODIS:
142  nwave = 3;
143  bindx = alloc_bindx(nwave, bindx);
144  bindx[0] = 2;
145  bindx[1] = 6;
146  bindx[2] = 7;
147  break;
148  case INSTRUMENT_SEAWIFS:
149  nwave = 6;
150  bindx = alloc_bindx(nwave, bindx);
151  for (ib = 0; ib < nwave; ib++)
152  bindx[ib] = ib;
153  break;
154  case INSTRUMENT_VIIRS:
155  nwave = 5;
156  bindx = alloc_bindx(nwave, bindx);
157  for (ib = 0; ib < nwave; ib++)
158  bindx[ib] = ib;
159  break;
160  case INSTRUMENT_MERIS:
161  nwave = 7;
162  bindx = alloc_bindx(nwave, bindx);
163  for (ib = 0; ib < nwave; ib++)
164  bindx[ib] = ib;
165  break;
166  case INSTRUMENT_OCTS:
167  nwave = 6;
168  bindx = alloc_bindx(nwave, bindx);
169  for (ib = 0; ib < nwave; ib++)
170  bindx[ib] = ib;
171  break;
172  case INSTRUMENT_OCI:
173  case INSTRUMENT_OCIS:
174 
175  for (ib = 0; ib < total_waves; ib++) {
176  if (l1file->fwave[ib] >= 400) {
177  start_ib = MIN(ib, start_ib);
178  }
179  if (l1file->fwave[ib] < 700) {
180  end_ib = MAX(ib, end_ib);
181  }
182  }
183  nwave = 20; // end_ib - start_ib + 1; // to be changed
184  bindx = alloc_bindx(nwave, bindx);
185  size_t band_step = (end_ib - start_ib) / (nwave - 1);
186  //printf("Wavelenght band is %d ", (int)(end_ib - start_ib));
187  for (size_t ib = 0; ib < nwave; ib++) {
188  bindx[ib] = ib * band_step + start_ib;
189  }
190 
191  break;
192  default:
193  printf("PAR not supported for this sensor (%d).\n", l1file->sensorID);
194  exit(1);
195  break;
196  }
197  if ((lambda = (float *) calloc(nwave, sizeof(float))) == NULL) {
198  printf("-E- : Error allocating memory to lambda in get_par\n");
199  exit(FATAL_ERROR);
200  }
201  if ((Fobar = (float *) calloc(nwave, sizeof(float))) == NULL) {
202  printf("-E- : Error allocating memory to Fobar in get_par\n");
203  exit(FATAL_ERROR);
204  }
205  if ((Taur = (float *) calloc(nwave, sizeof(float))) == NULL) {
206  printf("-E- : Error allocating memory to Taur in get_par\n");
207  exit(FATAL_ERROR);
208  }
209  if ((kO3 = (float *) calloc(nwave, sizeof(float))) == NULL) {
210  printf("-E- : Error allocating memory to kO3 in get_par\n");
211  exit(FATAL_ERROR);
212  }
213 
214  /* Get band-pass dependent quantities */
215  // consider passing in an array of band indexes to index
216  // l2rec->(lambda,k03,Fobar,Taur) in calc_par
217  for (iw = 0; iw < nwave; iw++) {
218  ib = bindx[iw];
219  lambda[iw] = l1file->fwave[ib];
220  kO3[iw] = l1file->k_oz[ib];
221  Fobar[iw] = l1file->Fobar[ib];
222  Taur[iw] = l1file->Tau_r[ib];
223  }
224  }
225  if ((Lt = (float *) calloc(nwave, sizeof(float))) == NULL) {
226  printf("-E- : Error allocating memory to Lt in get_par\n");
227  exit(FATAL_ERROR);
228  }
229  for (ip = 0; ip < l1rec->npix; ip++) {
230  /* Grab radiances for this pixel */
231  for (ib = 0; ib < nwave; ib++) {
232  ipb = ip * l1file->nbands + bindx[ib];
233  Lt[ib] = l1rec->Lt[ipb];
234  }
235 
236  /* Skip pixel if masked */
237  if (Lt[0] <= 0.0 || (l1rec->flags[ip] & mask) != 0 || l1rec->solz[ip] > 90.0) {
238  par[ip] = BAD_FLT;
239  para[ip] = par[ip];
240  parb[ip] = BAD_FLT;
241  mu_est[ip] = BAD_FLT;
242  parc[ip] = BAD_FLT;
245  l1rec->flags[ip] |= PRODFAIL;
246  continue;
247  }
248 
249  /* Get angstrom and AOT from climatology */
250  angst = smi_climatology(l1rec->lon[ip], l1rec->lat[ip],
251  ALPHA510); // ALPHA550
252  taua = smi_climatology(l1rec->lon[ip], l1rec->lat[ip],
253  TAUA865); // TAUA550
254  switch (sensorId2InstrumentId(l1file->sensorID)) {
255  case INSTRUMENT_SEAWIFS:
256  case INSTRUMENT_MERIS:
257  case INSTRUMENT_VIIRS:
258  case INSTRUMENT_OCTS:
259  case INSTRUMENT_OCI:
260  case INSTRUMENT_MODIS:
261  case INSTRUMENT_OCIS:
262  par[ip] = calc_par_impl_of_2023(l2rec, ip, nwave, Lt, taua, angst, lambda, Fobar, kO3, Taur,
263  parb, parc);
264  break;
265  default:
266  printf("PAR not supported for this sensor (%d).\n", l1file->sensorID);
267  exit(1);
268  break;
269  }
270  /* Convert to E/D/m^2 */
271  if (par[ip] != BAD_FLT) {
272  par[ip] *= EINSTEIN;
273  parb[ip] *= EINSTEIN;
274  parc[ip] *= EINSTEIN;
277  } else {
278  par[ip] = BAD_FLT;
279  parb[ip] = BAD_FLT;
280  }
281  para[ip] = par[ip];
282  }
283  free(Lt);
284  // process the scan
285  scan_processed = l2rec->l1rec->iscan;
286 }
287 
288 static int32_t ini_obs = 0;
289 static float observed_time;
290 static int32_t index_obs;
291 
292 void get_taucld(l2str *l2rec, float taucld[]) {
293  if (ini_obs == 0) {
294  ini_obs = 1;
295  int16_t year, month, mday;
296  double sec;
297  unix2ymds(l2rec->l1rec->scantime, &year, &month, &mday, &sec);
298  observed_time = sec / 3600;
299  size_t ntimes = l2rec->l1rec->cld_rad->ntimes;
300  float min_diff = 73;
301  for (size_t it = 0; it < ntimes; it++) {
302  float diff = fabs(l2rec->l1rec->cld_rad->timecldrange[it] - observed_time);
303  if (min_diff > diff) {
304  min_diff = diff;
305  index_obs = it;
306  };
307  }
308  }
309  size_t npix = l2rec->l1rec->npix;
310  for (size_t ip = 0; ip < npix; ip++) {
311  taucld[ip] = l2rec->l1rec->cld_rad->taucld[ip][index_obs];
312  }
313 };
314 
315 void get_clfr(l2str *l2rec, float clfr[]) {
316  if (ini_obs == 0) {
317  ini_obs = 1;
318  int16_t year, month, mday;
319  double sec;
320  unix2ymds(l2rec->l1rec->scantime, &year, &month, &mday, &sec);
321  observed_time = sec / 3600;
322  size_t ntimes = l2rec->l1rec->cld_rad->ntimes;
323  float min_diff = 73;
324  for (size_t it = 0; it < ntimes; it++) {
325  float diff = fabs(l2rec->l1rec->cld_rad->timecldrange[it] - observed_time);
326  if (min_diff > diff) {
327  min_diff = diff;
328  index_obs = it;
329  };
330  }
331  }
332  size_t npix = l2rec->l1rec->npix;
333  for (size_t ip = 0; ip < npix; ip++) {
334  clfr[ip] = l2rec->l1rec->cld_rad->cfcld[ip][index_obs];
335  }
336 };
337 
338 void get_par(l2str *l2rec, float par[]) {
339  int32_t ip, ib, ipb, iw;
340 
341  float *Lt;
342 
343  float angst;
344  float taua;
345 
346  static int32_t mask = SEAICE | LAND | HIGLINT | NAVFAIL;
347 
348  static float *lambda;
349  static float *Fobar;
350  static float *Taur;
351  static float *kO3;
352  static int *bindx;
353  static int nwave;
354  static int firstCall = TRUE;
355 
356  l1str *l1rec = l2rec->l1rec;
357  filehandle *l1file = l1rec->l1file;
358 
359  if (firstCall) {
360  firstCall = FALSE;
361 
362  int16_t year, day;
363  double sec;
364  unix2yds(l2rec->l1rec->scantime, &year, &day, &sec);
365 
366  /* Initialize climatologies */
367  smi_climatology_init(input->alphafile, day, ALPHA510);
368  smi_climatology_init(input->tauafile, day, TAUA865);
369 
370  switch (sensorId2InstrumentId(l1file->sensorID)) {
371  case INSTRUMENT_MODIS:
372  nwave = 3;
373  bindx = alloc_bindx(nwave, bindx);
374  bindx[0] = 2;
375  bindx[1] = 6;
376  bindx[2] = 7;
377  break;
378  case INSTRUMENT_SEAWIFS:
379  nwave = 6;
380  bindx = alloc_bindx(nwave, bindx);
381  for (ib = 0; ib < nwave; ib++)
382  bindx[ib] = ib;
383  break;
384  case INSTRUMENT_VIIRS:
385  nwave = 5;
386  bindx = alloc_bindx(nwave, bindx);
387  for (ib = 0; ib < nwave; ib++)
388  bindx[ib] = ib;
389  break;
390  case INSTRUMENT_MERIS:
391  nwave = 7;
392  bindx = alloc_bindx(nwave, bindx);
393  for (ib = 0; ib < nwave; ib++)
394  bindx[ib] = ib;
395  break;
396  case INSTRUMENT_OCTS:
397  nwave = 6;
398  bindx = alloc_bindx(nwave, bindx);
399  for (ib = 0; ib < nwave; ib++)
400  bindx[ib] = ib;
401  break;
402  default:
403  printf("PAR not supported for this sensor (%d).\n", l1file->sensorID);
404  exit(1);
405  break;
406  }
407  if ((lambda = (float *) calloc(nwave, sizeof(float))) == NULL) {
408  printf("-E- : Error allocating memory to lambda in get_par\n");
409  exit(FATAL_ERROR);
410  }
411  if ((Fobar = (float *) calloc(nwave, sizeof(float))) == NULL) {
412  printf("-E- : Error allocating memory to Fobar in get_par\n");
413  exit(FATAL_ERROR);
414  }
415  if ((Taur = (float *) calloc(nwave, sizeof(float))) == NULL) {
416  printf("-E- : Error allocating memory to Taur in get_par\n");
417  exit(FATAL_ERROR);
418  }
419  if ((kO3 = (float *) calloc(nwave, sizeof(float))) == NULL) {
420  printf("-E- : Error allocating memory to kO3 in get_par\n");
421  exit(FATAL_ERROR);
422  }
423 
424  /* Get band-pass dependent quantities */
425  // consider passing in an array of band indexes to index l2rec->(lambda,k03,Fobar,Taur) in calc_par
426  for (iw = 0; iw < nwave; iw++) {
427  ib = bindx[iw];
428  lambda[iw] = l1file->fwave[ib];
429  kO3[iw] = l1file->k_oz[ib];
430  Fobar[iw] = l1file->Fobar[ib];
431  Taur[iw] = l1file->Tau_r[ib];
432  }
433  }
434  if ((Lt = (float *) calloc(nwave, sizeof(float))) == NULL) {
435  printf("-E- : Error allocating memory to Lt in get_par\n");
436  exit(FATAL_ERROR);
437  }
438 
439  for (ip = 0; ip < l1rec->npix; ip++) {
440  /* Grab radiances for this pixel */
441  for (ib = 0; ib < nwave; ib++) {
442  ipb = ip * l1file->nbands + bindx[ib];
443  Lt[ib] = l1rec->Lt[ipb];
444  }
445 
446  /* Skip pixel if masked */
447  if (Lt[0] <= 0.0 || (l1rec->flags[ip] & mask) != 0 || l1rec->solz[ip] > 90.0) {
448  par[ip] = BAD_FLT;
449  l1rec->flags[ip] |= PRODFAIL;
450  continue;
451  }
452 
453  /* Get angstrom and AOT from climatology */
454  angst = smi_climatology(l1rec->lon[ip], l1rec->lat[ip], ALPHA510);
455  taua = smi_climatology(l1rec->lon[ip], l1rec->lat[ip], TAUA865);
456 
457  switch (sensorId2InstrumentId(l1file->sensorID)) {
458  case INSTRUMENT_SEAWIFS:
459  case INSTRUMENT_MODIS:
460  case INSTRUMENT_MERIS:
461  case INSTRUMENT_VIIRS:
462  case INSTRUMENT_OCTS:
463 
464  par[ip] = calc_par(l2rec, ip, nwave, Lt, taua, angst, lambda, Fobar, kO3, Taur);
465  break;
466 
467  default:
468  printf("PAR not supported for this sensor (%d).\n", l1file->sensorID);
469  exit(1);
470  break;
471  }
472  /* Convert to E/D/m^2 */
473  if (par[ip] != BAD_FLT)
474  par[ip] *= 1.193;
475  }
476  free(Lt);
477 }
478 
479 
480 void get_ipar2(l2str *l2rec, float ipar[]) {
481  if (scan_processed != l2rec->l1rec->iscan || scan_processed == -1) {
482  get_par2(l2rec, para);
483  }
484  for (size_t ip = 0; ip < l2rec->l1rec->npix; ip++) {
485  if(par_planar_a_inst[ip]!=BAD_FLT)
486  ipar[ip] = par_planar_a_inst[ip] * 1e6;
487  }
488 }
489 
490 void get_ipar_below_surface(l2str *l2rec, float ipar[]) {
491  if (scan_processed != l2rec->l1rec->iscan || scan_processed == -1) {
492  get_par2(l2rec, para);
493  }
494  for (size_t ip = 0; ip < l2rec->l1rec->npix; ip++) {
495  if(par_planar_b_inst[ip]!=BAD_FLT)
496  ipar[ip] = par_planar_b_inst[ip] * 1e6;
497  }
498 }
499 
500 
501 void get_ipar_scalar(l2str *l2rec, float ipar[]) {
502  if (scan_processed != l2rec->l1rec->iscan || scan_processed == -1) {
503  get_par2(l2rec, para);
504  }
505  for (size_t ip = 0; ip < l2rec->l1rec->npix; ip++) {
506  if (para[ip] == BAD_FLT) {
507  ipar[ip] = BAD_FLT;
508  continue;
509  }
510  calc_scalar_inst_par(l2rec, ip, par_planar_a_inst[ip], ipar + ip);
511  ipar[ip]*=1e6;
512  }
513 }
514 /*
515  Subject:
516  PAR routine
517  Date:
518  Fri, 23 Jul 1999 08:55:29 -0700
519  From:
520  Robert Frouin <rfrouin@ucsd.edu>
521  To:
522  chuck@seawifs, gfargion@simbios, gene@seawifs, wang@simbios, franz@seawifs
523  CC:
524  jmcpherson@ucsd.edu
525 
526 
527 
528 
529  Greetings:
530 
531  A routine to compute daily PAR from SeaWiFS level 1b radiances is available
532  at the following address: http://genius.ucsd.edu/~john/SeaWiFS_dir/ under
533  the rubrique "PAR subroutine and test program".
534 
535  The routine requires as input year, month, day, time, latitude, longitude,
536  SeaWiFS radiances in the first 6 spectral bands, solar zenith angle,
537  viewing zenith angle, relative azimuth angle, aerosol optical thickness at
538  865 nm, Angstrom coefficient, ozone amount, and surface pressure. Routine
539  output is daily PAR.
540 
541  Thus a daily PAR value is computed for each instantaneous SeaWiFS
542  observation, clear or cloudy. Diurnal variations are taken into account
543  statistically. The algorithm is described succintly in the routine.
544 
545  During our discussion at GSFC in June, a first routine was supposed to be
546  developed to provide a normalized cloud/surface albedo and then a second
547  routine to compute daily PAR from the normalized albedo, and the second
548  routine was to be applied when binning to the 9 km resolution. Now daily
549  PAR is obtained using a single routine, which is more convenient.
550 
551  The binning to the 9 km resolution should be done as follows. First,
552  weight-average the daily PAR estimates obtained from all SeaWiFS
553  observations during the same day at each location (there might be several
554  SeaWiFS observations of a surface target during the same day). The weight
555  is the cosine of the sun zenith angle for the SeaWiFS observation. That is:
556 
557  PAR_avg = sum{cos[tetas(i)]*PAR(i)}/sum{cos[tetas(i)]}
558 
559  Second, simply average the values at all the locations within the 9 km bins.
560 
561  The routine requires aerosol data, ozone amount, surface pressure. If these
562  parameters are missing (-999 or less), default values are used. If Eric
563  Vermote's aerosol climatology (or Menghua's) is not available yet, please
564  use default values for tests.
565 
566  At this time, the statistical diurnal function does not depend on latitude,
567  longitude, and date, but will depend on these parameters in the second
568  version of the code. Creating a date and location dependent function
569  requires analysing several years of ISCCP data. We have the data, but a
570  couple of weeks is needed to accomplish the task.
571 
572  I will present the algorithm at the SeaWiFS atmospheric correction meeting
573  next week, and prepare a detailed documentation.
574 
575  Best, Robert.
576 
577 
578  Robert Frouin
579  Scripps Institution of Oceanography
580  University of California San Diego
581  9500 Gilman Drive
582  La Jolla, CA 92093-0221
583  Voice Tel.: 619/534-6243
584  Fax Tel.: 619/534-7452
585 
586 
587  */
int32 l1file(int32 sdfid, int32 *nsamp, int32 *nscans, int16 *dtynum)
Definition: l1stat_chk.c:586
#define MAX(A, B)
Definition: swl0_utils.h:25
const int bindx[3]
Definition: DbLutNetcdf.cpp:28
#define MIN(x, y)
Definition: rice.h:169
int smi_climatology_init(char *file, int day, int prodID)
int32_t day
void get_par_below_surface(l2str *l2rec, float par[])
Definition: get_par.c:51
#define INSTRUMENT_VIIRS
Definition: sensorDefs.h:81
float * par_planar_a_inst
Definition: get_par.c:38
#define FALSE
Definition: rice.h:164
#define NULL
Definition: decode_rs.h:63
float calc_par(l2str *l2rec, int ip, int nbands, float *Lt, float taua, float angstrom, float *wl, float *fo, float *ko3, float *taumolbar)
Definition: calc_par.c:192
void calc_scalar_inst_par(l2str *l2rec, int ip, float par_above_ins, float *par_scalar_ins)
Definition: calc_par.c:123
read l1rec
void get_par_scalar(l2str *l2rec, float par[])
Definition: get_par.c:40
#define TAUA865
void unix2ymds(double usec, int16_t *year, int16_t *mon, int16_t *day, double *secs)
Definition: unix2ymds.c:8
float mu
#define TRUE
Definition: rice.h:165
#define PRODFAIL
Definition: l2_flags.h:41
data_t lambda[NROOTS+1]
Definition: decode_rs.h:75
void get_clfr(l2str *l2rec, float clfr[])
Definition: get_par.c:315
#define INSTRUMENT_MERIS
Definition: sensorDefs.h:80
void get_taucld(l2str *l2rec, float taucld[])
Definition: get_par.c:292
instr * input
void get_par2(l2str *l2rec, float par[])
Definition: get_par.c:69
#define INSTRUMENT_OCIS
Definition: sensorDefs.h:98
float calc_par_impl_of_2023(l2str *l2rec, int ip, int nbands, float *Lt, float taua, float angstrom, float *wl, float *fo, float *ko3, float *taumolbar, float *parb, float *parc)
Definition: calc_par.c:613
#define INSTRUMENT_OCI
Definition: sensorDefs.h:97
#define INSTRUMENT_SEAWIFS
Definition: sensorDefs.h:71
#define FATAL_ERROR
Definition: swl0_parms.h:5
void get_mu_cosine(l2str *l2rec, float mu[])
Definition: get_par.c:59
void get_ipar_scalar(l2str *l2rec, float ipar[])
Definition: get_par.c:501
a context in which it is NOT documented to do so subscript which cannot be easily calculated when extracting TONS attitude data from the Terra L0 files Corrected several defects in extraction of entrained ephemeris and and as HDF file for both the L1A and Geolocation enabling retrieval of South Polar DEM data Resolved Bug by changing to opent the geolocation file only after a successful read of the L1A and also by checking for fatal errors from not restoring C5 and to report how many of those high resolution values were water in the new WaterPresent SDS Added valid_range attribute to Land SeaMask Changed to bilinearly interpolate the geoid_height to remove artifacts at one degree lines Made corrections to const qualification of pointers allowed by new version of M API library Removed casts that are no longer for same not the geoid Corrected off by one error in calculation of high resolution offsets Corrected parsing of maneuver list configuration parameter Corrected to set Height SDS to fill values when geolocation when for elevation and land water mask
Definition: HISTORY.txt:114
void unix2yds(double usec, short *year, short *day, double *secs)
subroutine diff(x, conec, n, dconecno, dn, dconecmk, units, u, inno, i, outno, o, input, deriv)
Definition: ffnet.f:205
#define INSTRUMENT_OCTS
Definition: sensorDefs.h:73
void get_par(l2str *l2rec, float par[])
Definition: get_par.c:338
#define LAND
Definition: l2_flags.h:12
float * par_planar_b_inst
Definition: get_par.c:38
#define SEAICE
Definition: l2_flags.h:35
#define BAD_FLT
Definition: jplaeriallib.h:19
float smi_climatology(float lon, float lat, int prodID)
int32_t nbands
#define fabs(a)
Definition: misc.h:93
#define INSTRUMENT_MODIS
Definition: sensorDefs.h:77
#define HIGLINT
Definition: l2_flags.h:14
void get_ipar2(l2str *l2rec, float ipar[])
Definition: get_par.c:480
#define EINSTEIN
Definition: par_utils.h:22
int npix
Definition: get_cmp.c:28
void get_ipar_below_surface(l2str *l2rec, float ipar[])
Definition: get_par.c:490
#define ALPHA510
void calc_scalar_par_mean_cosine(l2str *l2rec, int ip, float par_above, float par_c, float *scalar_par, float *mean_cosine)
Definition: calc_par.c:160
int sensorId2InstrumentId(int sensorId)
Definition: sensorInfo.c:343
#define NAVFAIL
Definition: l2_flags.h:36