#ifndef CONST_H
#define CONST_H

#include <math.h>


#define ST_VERSION "TBD skip_fv (Collection 2)"
#define ST_NO_DATA_VALUE (-9999.0)

#define ST_RADIANCE_UNITS "radiance (W m^(-2) sr^(-1) mu^(-1))"
#define ST_UNITLESS "unitless"

#define ST_THERMAL_RADIANCE_PRODUCT_NAME "st_intermediate"
#define ST_THERMAL_RADIANCE_BAND_NAME "st_thermal_radiance"
#define ST_THERMAL_RADIANCE_SHORT_NAME "ST_THERMAL_RADIANCE"
#define ST_THERMAL_RADIANCE_LONG_NAME "thermal band converted to radiance"

#define ST_ATMOS_TRANS_PRODUCT_NAME "st_intermediate"
#define ST_ATMOS_TRANS_BAND_NAME "st_atmospheric_transmittance"
#define ST_ATMOS_TRANS_SHORT_NAME "ST_ATMOSPHERIC_TRANSMITTANCE"
#define ST_ATMOS_TRANS_LONG_NAME "atmospheric transmittance"

#define ST_UPWELLED_RADIANCE_PRODUCT_NAME "st_intermediate"
#define ST_UPWELLED_RADIANCE_BAND_NAME "st_upwelled_radiance"
#define ST_UPWELLED_RADIANCE_SHORT_NAME "ST_UPWELLED_RADIANCE"
#define ST_UPWELLED_RADIANCE_LONG_NAME "upwelled radiance"

#define ST_DOWNWELLED_RADIANCE_PRODUCT_NAME "st_intermediate"
#define ST_DOWNWELLED_RADIANCE_BAND_NAME "st_downwelled_radiance"
#define ST_DOWNWELLED_RADIANCE_SHORT_NAME "ST_DOWNWELLED_RADIANCE"
#define ST_DOWNWELLED_RADIANCE_LONG_NAME "downwelled radiance"

#define DEGREES_PER_RADIAN (180.0 / PI)
#define RADIANS_PER_DEGREE (PI / 180.0)

#ifndef SUCCESS
    #define SUCCESS  0
#endif

#ifndef FAILURE
    #define FAILURE 1
#endif

#define MAX_STR_LEN 512
#define ST_UNC_L1_THERMAL_SATURATION 255 /* L1 TM/ETM thermal saturation */
#define ST_UNC_L1_THERMAL_SATURATION_OLI 65535 /* L1 OLI thermal saturation */ 
#define ST_UNC_INPUT_SATURATED 32766 /* Input saturation flag in ST_UNC band */
#define ST_UNC_INVALID_PIXEL 32767 /* UNC calculations couldn't be performed here,
                                     likely due to clouds (ST Uncertainty inputs 
                                     are based on ground emissivity and
				     elevation)*/

#define NUM_QA_COEFFS 3 /* Number of coefficients per atmospheric parameter
                           type */


/* Defines index locations in the array of grid points that specify the nine
   closest grid points */
typedef enum
{
    CC_GRID_POINT,
    LL_GRID_POINT,
    LC_GRID_POINT,
    UL_GRID_POINT,
    UC_GRID_POINT,
    UR_GRID_POINT,
    RC_GRID_POINT,
    LR_GRID_POINT,
    DC_GRID_POINT,
    NUM_GRID_POINTS
} GRID_POINT_INDEXES;


/* These are used in arrays, and they are position dependent */
typedef enum
{
    I_BAND_THERMAL,
    I_BAND_THERMAL_2,
    I_BAND_ELEVATION, /* This band and above are all from the XML */
    MAX_INPUT_BANDS
} Input_Bands_e;


#endif /* CONST_H */
