OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
get_es.c
Go to the documentation of this file.
1 /* --------------------------------------------------------------- */
2 /* get_es.c - compute surface irradiance (Ed(0+)) */
3 /* */
4 /* Inputs: */
5 /* l2rec - level-2 structure containing one complete scan */
6 /* after atmospheric correction. */
7 /* band - band number (0-7) */
8 /* */
9 /* Outputs: */
10 /* Es for specified band */
11 /* */
12 /* Algorithm Provided By: M. Wang */
13 /* Written By: B. A. Franz, SAIC GSC, SIMBIOS Project, 4 Aug 1999 */
14 /* */
15 /* --------------------------------------------------------------- */
16 
17 #include <stdlib.h>
18 #include <math.h>
19 #include "l12_proto.h"
20 
24 void get_es(l2str *l2rec, int band, float Es[]) {
25  static float radeg = 3.141592654 / 180.;
26  int32_t ip;
27  int32_t ipb;
28 
29  l1str *l1rec = l2rec->l1rec;
30  int32_t nbands = l1rec->l1file->nbands;
31 
32  for (ip = 0; ip < l1rec->npix; ip++) {
33  ipb = ip * nbands + band;
34  if (l2rec->La[ipb] > 0.0) {
35  Es[ip] = l1rec->Fo[band]
36  * l1rec->tg_sol[ipb]
37  * l1rec->t_sol[ipb]
38  * cos(l1rec->solz[ip] * radeg)
39  * 10.0;
40  } else
41  Es[ip] = 0.0;
42  }
43 
44  return;
45 }
46 
read l1rec
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
void get_es(l2str *l2rec, int band, float Es[])
Definition: get_es.c:24
int32_t nbands