Go to the documentation of this file.
9 return (
Rrs / (0.52 + 1.7 *
Rrs));
17 return (
Rrs * 0.52 / (1 - 1.7 *
Rrs));
35 void rhown_red(
char *fqfile,
float chl,
float aw[],
float bbw[],
float Rrs[],
36 float wave[], int32_t nwave, int32_t ib_red,
float rhown[]) {
37 static int firstCall = 1;
39 static float eta = 0.5;
40 float static chl_min = 0.2;
41 float static chl_max = 30.;
43 float aw_red, apg_red, bb5;
51 ib5 =
windex(555, wave, nwave);
52 if (
fabs(555 - wave[ib5]) > 15) {
53 printf(
"%s line %d: can't find reasonable green band\n", __FILE__, __LINE__);
54 printf(
"looking for 555, found %f\n", wave[ib5]);
61 chl_in =
MAX(
MIN(chl, chl_max), chl_min);
70 foqint_morel(fqfile, wave, nwave, 0.0, 0.0, 0.0, chl_in, foq);
74 apg_red = exp(log(chl) * 0.9389 - 3.7589);
75 apg_red =
MIN(
MAX(apg_red, 0.0), 0.5);
80 bb5 = (-0.00182 + 2.058 * Rrs5);
83 bb = bb5 * pow((wave[ib5] / wave[ib_red]), eta) + bbw[ib_red];
86 salbedo = bb / (
a + bb);
87 Rrs_red = foq[ib_red] * salbedo;
90 rhown[ib_red] =
PI*Rrs_red;
108 void rhown_nir(
char *fqfile,
float chl,
float aw[],
float bbw[],
float Rrs[],
float wave[],
109 int32_t nwave,
float solz,
float senz,
float phi,
110 int32_t nir_s, int32_t nir_l,
float rhown[]) {
111 static int firstCall = 1;
116 float a6, aw6, apg6, bbp6;
118 float static chl_min = 0.2;
119 float static chl_max = 30.;
123 float Rrs2, Rrs5, Rrs6, Rrs6_star;
125 int32_t dnir =
MAX(nir_l - nir_s, 1);
128 ib6 =
windex(670, wave, nwave);
129 if (
fabs(670 - wave[ib6]) > 50) {
130 printf(
"%s line %d: can't find reasonable red band\n", __FILE__, __LINE__);
131 printf(
"looking for 670, found %f\n", wave[ib6]);
135 ib5 =
windex(555, wave, nwave);
136 if (
fabs(555 - wave[ib5]) > 15) {
137 printf(
"%s line %d: can't find reasonable green band\n", __FILE__, __LINE__);
138 printf(
"looking for 555, found %f\n", wave[ib5]);
141 ib2 =
windex(443, wave, nwave);
142 if (
fabs(443 - wave[ib2]) > 5) {
143 printf(
"%s line %d: can't find reasonable blue band\n", __FILE__, __LINE__);
144 printf(
"looking for 443, found %f\n", wave[ib2]);
155 for (ib = nir_s; ib <= nir_l; ib += dnir)
160 chl =
MAX(
MIN(chl, chl_max), chl_min);
163 apg6 = exp(log(chl) * 0.9389 - 3.7589);
164 apg6 =
MIN(
MAX(apg6, 0.0), 0.5);
180 if (Rrs5 > 0.0 && Rrs2 > 0.0) {
181 eta = 2.0 * (1. - 1.2 * exp(-0.9 * (Rrs2 / Rrs5)));
182 eta =
MIN(
MAX(eta, 0.0), 1.0);
186 Rrs6_star = Rrs6 / foq[ib6];
187 bbp6 = (Rrs6_star * a6 / (1. - Rrs6_star)) - bbw[ib6];
190 for (ib = nir_s; ib <= nir_l; ib += dnir) {
198 bb = bbp6 * pow((wave[ib6] / wave[ib]), eta) + bbw[ib];
201 salbedo = bb / (
a + bb);
202 Rrs_nir = foq[ib6] * salbedo;
205 rhown[ib] =
PI*Rrs_nir;
219 int32_t nwave,
float aw[],
float bbw[],
float chl,
220 float solz,
float senz,
float phi,
float rhown[]) {
223 rhown_red(fqfile, chl, aw, bbw,
Rrs, wave, nwave, nir_l, rhown);
225 rhown_nir(fqfile, chl, aw, bbw,
Rrs, wave, nwave,
solz,
senz, phi, nir_s, nir_l, rhown);
void rhown_red(char *fqfile, float chl, float aw[], float bbw[], float Rrs[], float wave[], int32_t nwave, int32_t ib_red, float rhown[])
float above_to_below(float Rrs)
void foqint_morel(char *file, float wave[], int32_t nwave, float solz, float senzp, float phi, float chl, float brdf[])
void get_rhown_eval(char *fqfile, float Rrs[], float wave[], int32_t nir_s, int32_t nir_l, int32_t nwave, float aw[], float bbw[], float chl, float solz, float senz, float phi, float rhown[])
int windex(float wave, float twave[], int ntwave)
void rhown_nir(char *fqfile, float chl, float aw[], float bbw[], float Rrs[], float wave[], int32_t nwave, float solz, float senz, float phi, int32_t nir_s, int32_t nir_l, float rhown[])
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
float below_to_above(float Rrs)