NASA Logo
Ocean Color Science Software

ocssw V2022
vegetation_indices.h
Go to the documentation of this file.
1 
8 #include <stdlib.h>
9 #include <stdbool.h>
10 #include <genutils.h>
11 
12 #define VI_MINVAL -1000.0 // A bound to clamp to, per C. Tucker (11/2014)
13 #define VI_MAXVAL 1000.0 // A bound to clamp to, per C. Tucker (11/2014)
14 #define MIN_PIXEL_ELEVATION -500
15 #define DEFAULT_BAND_INDEX -0x444249 // Indicator that bands were not set (Hex values for "DBI")
16 #define UNDEFINED BAD_FLT // Fill value for products
17 #define LAND_MASK LAND
18 
19 // Hyperspectral band constants
20 extern const int32_t blu_min; // band boundary for hyperspectral instruments
21 extern const int32_t blu_max; // band boundary for hyperspectral instruments
22 extern const int32_t red_min; // band boundary for hyperspectral instruments
23 extern const int32_t red_max; // band boundary for hyperspectral instruments
24 extern const int32_t nir_min; // band boundary for hyperspectral instruments
25 extern const int32_t nir_max; // band boundary for hyperspectral instruments
26 extern const int32_t grn_min; // band boundary for hyperspectral instruments
27 extern const int32_t grn_max; // band boundary for hyperspectral instruments
28 extern const int32_t modis_b11_min; // MODIS Green
29 extern const int32_t modis_b11_max; // MODIS Green
30 extern const int32_t modis_b4_min; // MODIS Green
31 extern const int32_t modis_b4_max; // MODIS Green
32 
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36 
44 float average_rhos_values(float rhos_values[], size_t length);
45 
54 bool invalid_pixel(double pixel_elevation, double pixel_mask, double rhos_values[], int len_rhos_values);
55 
63 float clamp(float pixel_value, int minimum, int maximum);
64 
65 bool instrument_is_hyperspectral(int32_t num_bands);
66 
67 #ifdef __cplusplus
68 }
69 #endif
const int32_t blu_max
const int32_t nir_min
float average_rhos_values(float rhos_values[], size_t length)
Get the average of rho_s values from a hyperspectral measurement to approximate a multi-band measurem...
const int32_t grn_max
const int32_t modis_b11_max
const int32_t blu_min
bool invalid_pixel(double pixel_elevation, double pixel_mask, double rhos_values[], int len_rhos_values)
Check pixel attributes for validity.
const int32_t nir_max
const int32_t modis_b4_max
float clamp(float pixel_value, int minimum, int maximum)
Clamp the value of a pixel between minval and maxval.
const int32_t grn_min
bool instrument_is_hyperspectral(int32_t num_bands)
const int32_t red_min
const int32_t red_max
const int32_t modis_b11_min
const int32_t modis_b4_min