Go to the documentation of this file.
18 static float undef = -2.0;
19 static int ibblue = -1;
20 static int ibred = -1;
21 static int ibnir = -1;
27 static float minval = -1000.0;
28 static float maxval = 1000.0;
36 if (ibred < 0 || ibnir < 0) {
37 printf(
"NDVI requires bands near 670 and 865nm\n");
41 for (ip = 0; ip <
l1rec->npix; ip++) {
44 ipb =
l1rec->l1file->nbands*ip;
46 nir =
l1rec->rhos[ipb + ibnir];
48 if (
l1rec->dem[ip] < -500 ||
50 red <= 0.0 || nir <= 0.0 ||
51 red > 1.0 || nir > 1.0) {
55 ndvi[ip] = (nir -
red)
58 ndvi[ip] =
MIN(
MAX(ndvi[ip], minval), maxval);
64 static float L = 1.0, c1 = 6.0, c2 = 7.5;
72 if (ibblue < 0 || ibred < 0 || ibnir < 0) {
73 printf(
"EVI requires bands near 412, 670, and 865nm\n");
77 for (ip = 0; ip <
l1rec->npix; ip++) {
80 ipb =
l1rec->l1file->nbands*ip;
81 blu =
l1rec->rhos[ipb + ibblue];
83 nir =
l1rec->rhos[ipb + ibnir];
85 if (
l1rec->dem[ip] < -500 ||
87 red <= 0.0 || nir <= 0.0 ||
88 red > 1.0 || nir > 1.0) {
94 if (blu > 0.0 && (blu <=
red ||
red <= nir)) {
98 if ((
val =
L + nir + c1 *
red - c2 * blu) == 0)
101 evi[ip] = 2.5 * (nir -
red) /
val;
107 if ((
val = 0.5 + nir +
red) == 0)
110 evi[ip] = 1.5 * (nir -
red) /
val;
112 evi[ip] =
MIN(
MAX(evi[ip], minval), maxval);
127 if (ibred < 0 || ibnir < 0) {
128 printf(
"EVI2 requires bands near 670, and 865nm\n");
132 for (ip = 0; ip <
l1rec->npix; ip++) {
135 ipb =
l1rec->l1file->nbands*ip;
137 nir =
l1rec->rhos[ipb + ibnir];
139 if (
l1rec->dem[ip] < -500 ||
141 red <= 0.0 || nir <= 0.0 ||
142 red > 1.0 || nir > 1.0) {
149 evi2[ip] = 2.5 * (nir -
red) / (nir + 2.4 *
red + 1);
151 evi2[ip] =
MIN(
MAX(evi2[ip], minval), maxval);
157 static float L = 1.0, c1 = 6.0, c2 = 7.5;
165 if (ibblue < 0 || ibred < 0 || ibnir < 0) {
166 printf(
"EVI requires bands near 412, 670, and 865nm\n");
170 for (ip = 0; ip <
l1rec->npix; ip++) {
173 ipb =
l1rec->l1file->nbands*ip;
174 blu =
l1rec->rhos[ipb + ibblue];
176 nir =
l1rec->rhos[ipb + ibnir];
178 if (
l1rec->dem[ip] < -500 ||
180 red <= 0.0 || nir <= 0.0 ||
181 red > 1.0 || nir > 1.0) {
188 if (blu > 0.0 && (blu <=
red ||
red <= nir)) {
192 if ((
val =
L + nir + c1 *
red - c2 * blu) == 0)
195 evi3[ip] = 2.5 * (nir -
red) /
val;
198 evi3[ip] =
MIN(
MAX(evi3[ip], minval), maxval);
205 static int firstCall = 1;
232 printf(
"Error: %s : Unknown product specifier: %d\n", __FILE__, prodnum);
void red(int iz1, int iz2, int jz1, int jz2, int jm1, int jm2, int jmf, int ic1, int jc1, int jcf, int kc, float ***c, float **s)
void get_ndvi(l1str *l1rec, float ndvi[])
void get_evi(l1str *l1rec, float evi[])
int bindex_get(int32_t wave)
void get_ndvi_evi(l1str *l1rec, int prodnum, float prod[])
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
void get_evi3(l1str *l1rec, float evi3[])
void get_evi2(l1str *l1rec, float evi2[])