#! /usr/bin/env python

'''
    File: st_rttov_defines.py

    Purpose: Defines a number of RTTOV values, to be shared by all RTTOV
             scripts.

    Project: Land Satellites Data Systems Science Research and Development
             (LSRD) at the USGS EROS

    License: NASA Open Source Agreement 1.3
'''


# Location of RTTOV binaries within RTTOV directory
RTTOV_BIN_DIR = 'bin'

# Location of RTTOV coefficients within RTTOV directory
RTTOV_COEF_DIR = 'rtcoef_rttov13/rttov8pred54L'

# We aren't putting the RTTOV coefficients within the RTTOV directory, so
# identify the base directory we're using
RTTOV_COEF_BASE_DIR = '/usr/local/src'

# RTTOV satellite/sensor coefficient file
RTTOV_L4_COEF_FILENAME = 'rtcoef_landsat_4_tm.dat'
RTTOV_L5_COEF_FILENAME = 'rtcoef_landsat_5_tm.dat'
RTTOV_L7_COEF_FILENAME = 'rtcoef_landsat_7_tm.dat'
RTTOV_L8_COEF_FILENAME = 'rtcoef_landsat_8_tirs.dat'
RTTOV_L9_COEF_FILENAME = 'rtcoef_landsat_9_tirs.dat'

# Name of file with profile(s)
RTTOV_BINARY_PROFILE_FILENAME = 'st_rttov_profile.bin'
RTTOV_ASCII_PROFILE_FILENAME = 'st_rttov_profile.ascii'

# Name of the RTTOV wrapper program
RTTOV_WRAPPER_FILENAME = 'st_rttov_wrapper.exe'

# Name of the file output by RTTOV
RTTOV_OUTPUT_FILENAME = 'rad_out.dat'

# Name of the RTTOV wrapper log file
RTTOV_LOG_FILENAME = 'st_rttov_wrapper.log'

# Number of profiles defined in profile file (not used in binary case)
NPROF = 0

# Number of profile levels (not used in binary case)
NLEVELS = 0

# 0 = solar off / 1 = solar on
DO_SOLAR = 0

# File type: 0 = binary / 1 = ascii
FTYPE = 0

# Parameters for separate thermal channels
CHANNEL1_PARMS = \
    '1, 1, 0.0001, 0.0 , channel 1, valid, emissivity=0.0, BRDF=0.0'
CHANNEL2_PARMS = \
    '2, 1, 0.0001, 0.0 , channel 2, valid, emissivity=0.0, BRDF=0.0'

# Set default values for use outside the scene or in nodata regions
ELEVATION_DEFAULT = 0
ZENITH_ANGLE_DEFAULT = 0

# Decimal value for land in qa_pixel.  In binary it's 00000010 which is clear
# bit set.  Since the water bit isn't set we interpret it as land
LAND_WATER_DEFAULT = 2

# Emissivity input close to 0, but not 0 so RTTOV doesn't try to calculate it
RTTOV_EMIS_INPUT = 0.000001

# Clamp certain values input to RTTOV to these limits.  RTTOV will not accept
# them outside the limits.
MIN_SURFACE_ELEVATION = -0.4000
MAX_SURFACE_ELEVATION = 8.8400
MIN_PRESSURE = 400.0
MAX_PRESSURE = 1100.0
MIN_TEMPERATURE = 150.0
MAX_TEMPERATURE = 350.0
MIN_WATER_VAPOR = 0.0001
MAX_WATER_VAPOR = 600000.0
MIN_ZENITH_ANGLE = 0.0
MAX_ZENITH_ANGLE = 75.0

# Constants for RBF extrapolation to populate satellite zenith angle band fill
VALID_SAMPLES = 5000
SEED = 79
NEIGHBORS = 50

