#######################################################################################
#                                                                                     #
#                                    ARAHMIS Input Settings                           #
#                                                                                     #
#                                                                                     #
#######################################################################################

#
Arahmis settings version: 0.8

# General settings
# ================

Database root directory: /share/apps/arahmis-databases/databases-2021 # If you installed the ARAHMIS databases elsewhere, please change this path accordingly.
Reference atmospheric model: Standard_Atmosphere/_3_ATM5.MDL
Measured atmospheric spectrum file: "" # path to a file containing two columns (wavenumbers and values). The output will be interpolated on the given wavenumbers.
                                       # If no file (an empty string) is given, the output wavenumbers will be computed from the spectral range settings.
Verbosity level: 2 # 0-silent, 1 or more - verbose
Hitran loading method: 1 # 1: sequential, 2: parallel (multithreaded). May be overriden by a command-line option
Type of observation: 1 # 1: downlooking, 2: uplooking, 3: limbs, 4: solar_occultation
Type of output: [ 1 ] # 1: Optical Thicknesses, 2: Radiances, 3: PseudoTransmittances, 4: Brightness Temperatures, 5: Measured data, empty list: everything (DO NOT REMOVE THE BRACKETS)
Profile of optical thicknesses: [ 1 ] # 1: per layer, 2: cumulated, empty list: no profile (DO NOT REMOVE THE BRACKETS)
Output Field Separator: "\t" # the separator between main text output files (files containing columns with one header line)
Matrix Element Separator: "," # the separator of elements in matrix files (mainly used by the Arahmis' Information Content and Retrieval extension)
Output format of wavenumbers: "%.5f" # exception: for technical reasons, wavenumbers of the channel selection output are formatted according to "Output format of values" (this might change in a future version)
Output format of values: "%.6e"
Output format of brightness temperatures: "%.3f"

# Atmosphere model summary
# ========================
# NB. air density or concentration (rho) can only be displayed in mol.cm-3 or mol.cm-2 (i.e, in mol.cm-3 times the width of crossed medium in cm)
# when ppm is chosen for the concentration of species, the air density will be displayed in cm-3 
Atmosphere model summary: [ ] # empty (no file), [ "levels" ], [ "layers" ] or [ "levels", "layers" ]
Atmosphere model units: [ ] # ppm, cm-2, cm-3 (one unit must be given for each value given in the former list)
Atmosphere model total columns: none # none, ppm, cm-2 (with a unit, total columns will be appended at this end of file)
Atmosphere model layer base index: 0 # index of the first layer in the model summary (usually 0 or 1)

# Line-by-Line
# ============
Enable Line-by-Line: yes
Spectroscopic database: HITRAN_2020/??_hit??.par # pattern of HITRAN files to load

# initialization can be sped up by loading less files, e.g. HITRAN_2012/0[1-9]_hit??.par for the first 9 molecules

# Continua: 0: no correction of continuum, 1: correction of continuum applied
# ===========================================================================
Molecular continua: {
 "H2O": 0,
 "CO2": 0,
}

Write continua: no # continua will be dumped to a file under the Continua Directory (see below) if this setting is set to yes
Continua Directory: CONTINUA # this directory will be created if necessary

# Line Mixing
# ===========

Enable Line Mixing: no
Path to the Line Mixing dataset: "/path/to/LINE_MIXING_H2O_CO2"

# specifies an extrapolation method for layers with concentrations of H2O and CO2 (in ppm)
# out of the boundaries of the line mixing look-up tables.
#
# Possible values:
# none: no extrapolation is allowed, an error will occur with out of range concentrations if the line mixing is enabled.
# closest-lut: the line mixing algorithm will select the available LUT (in the specified dataset)
# corresponding to the closest conditions in terms of concentrations of H2O and CO2 for each layer
# 
# (more extrapolation methods may be added in the future)
Line Mixing Extrapolation Method: none # none | closest-lut

# Cross-Sections
# ==============

Enable Molecular Rayleigh scattering: no
Enable Molecular Cross Sections: no
Relative path for cross-sections: Cross_Section

# Collision Induced Absorptions
# =============================

Enable CIA: no
Collision-Induced Absorption paths: [ "CIA/O2-CO2_2011.cia" ] # a comma separated list

# Fine Grid
# =========

# [wavenumberMin, wavenumberMax, stepOfFineGrid] - for each spectral interval
# for an automatic determination of the step of the fine grid, leave it to 0
# note: the third parameter after the interval represents the output spectral resolution,
# if the two conditions are satisfied:
# - the variable "Measured atmospheric spectrum file" is left empty
# - the variable "Convolution Method" is set to "none" 
#
# It can also be used for the computations if the
# variable "Use output spectral resolution for computations" is set to "yes" (or "true").

Use output spectral resolution for computations: no

# this variable is deprecated. Use "Spectral range" instead.
# Spectral ranges (with a s) will be removed in arahmis 0.9.x
# multi-intervals will be implemented with a higher level script above arahmis.
#Spectral ranges: [
#  [ 698., 5200., 0.0 ],
#  [ 698., 1260., 0.0 ],
#  [ 4700., 5160., 0.0 ],
#]
#TODO
Spectral range: [ 6666.666400, 7692.307600, 0.01 ]

Spectral offset: 0.0 # spectral offset alpha: nu = nu0*(1 + alpha) where nu0 = wavenumber of the fine grid (offset applied just after convolution)
Base line factor: 1.0
Base line slope: 0.0

# these settings are here for documentation. The user is not expected to change them.
TruncationWidth(H2O,CO2): 25 #WARNING: MT_CKD routine forces ARAHMIS to set this value to 25 cm-1
TruncationWidthByDefault(*): 45

# Spatio-temporal settings
# ========================
Time: 1970-01-01T00:00:00Z # YYYY-MM-DDThh:mm:ssZ (date and time in ISO 8601 format, the 'Z' suffix means 'Zulu' or 'Zero Greenwich', i.e. UTC time)
Latitude: -19.948 # 
Longitude: 174.954 # 
Solar elevation: 80.00 # For Zenith viewing
Solar zenith angle: 00.00 # For Nadir and Limb viewing
Solar azimuth angle: 00.00 # For Nadir and Limb viewing
Satellite zenith angle: 00.00 # For Nadir and Limb viewing
Satellite azimuth angle: 00.00 # For Nadir and Limb viewing
Hsat: 800 # altitude of satellite, in km (optional, used in downlooking mode only)
Psat: 0 # pressure at the satellite level, in hPa (optional)
Tsat: 360 # temperature at the satellite level, in K (optional)
Htan: 20 # tangent altitude, in km (used in limb mode only)

# Emissivities and Planck's function
# ==================================
Precision of the solar radiation: 1 # Planck's blackbody law (1), Measured Planck's function (2)
T_sun: 5800 # K, for (1) only
Solar Planck's function file: "" # for (2) only

Precision of the Earth radiation: 1 # Planck's blackbody law (1), Atmospheric Model value (2)
T_Earth: 290 # K, for (1) only

Solar spectrum file: Solar_Data/solar_merged_20160127_600_26316_000.dat # single value or path to a file

Source emissivity: 0.95 # single value or path to a file; For Nadir viewing
Solar specular reflectivity: 0.05 # single value or path to a file; For Nadir viewing

# Spectrometry
# ============
Relative Threshold on the cross-section min to max ratio: 0.0E-6 # (should be positive) increasing this may speed up the code significantly, but removes smallest contributions and potentially introduces an error
Value of intensity cutoff: 0.0E-7 # (should be positive) the actual cutoff is the previous value divided by concentration(molecule/cm3)*layer_width(cm)
LorentzToVoigtSwitchingAltitude: 0.0 # altitude (in km) below which the profile shape is Lorentz, otherwise Voigt
VoigtToDopplerSwitchingAltitude: 130.0 # altitude (in km) above which the profile shape is Doppler, otherwise Voigt
Enable Chi Factors: false # relevant only for CO2 and its interactions with N2 and O2

# Convolution
# ===========
Convolution Method: none # currently supported methods include: none, sinc, gaussian, triangle, Lorentz, Norton-Beer weak, Norton-Beer medium, Norton-Beer strong, ils
delta_max: 4.42 # cm (parameter involved in the convolution by a cardinal sine)
HWHM: 0.13 # cm^-1 (half width at half maximum - parameter involved in the convolution by a gaussian, triangle, Lorentz, Norton-Beer weak, Norton-Beer medium, Norton-Beer strong)
apodizationHalfWidth: 5.0 # cm^-1 (the apodization range will be within nu0 +/- apodizationHalfWidth)
ILS file: "" # a text file with two columns (separated by spaces or tabulation), used if the chosen convolution method is "ils"

# Instrumental noise
# ==================
Random Seed: 0 # seed for the generation of random numbers (set it to -1 for a time dependent seed)
               # if the seed is positive or null, the pseudorandom number generator will be initialized with this seed value and the noise will be the same for each run
               # if the seed is negative, the pseudorandom number generator will be initialized with the current time and the noise will be different for each run
Noise Magnitude File: "" # a file of noise magnitudes (wavenumbers and magnitudes separated by tabulations); set it to an empty string in order to use the SNR parameter
#Noise Magnitude File: "${this_file_directory}/noise.txt" # a file of noise magnitudes (wavenumbers and magnitudes separated by tabulations); set it to an empty string in order to use the SNR parameter
SNR: 760 # Signal/Noise ratio (Signal corresponds to the maximum value in the spectral window) # will be ignored if a Noise Magnitude File is provided; if SNR is set to 0 and no file is provided, no noise will be added to the simulated radiances

# Ancillary Data
# ==============
# if this variable is set to 'yes', the parameters of the ground level in the atmospheric (.MDL) file
# will be overriden by the values here
Override Surface Parameters: no
Psurf: 1015 # hPa
Tsurf: 300 # K
RH: 50 # Relative Humidity in %

# Line-by-Line Molecular Layers
# =============================
# column 1: layer base altitude (in km)
# column 2: layer top altitude (in km)
# column 3: standard (*) VMR scale factor. * e.g. from the standard atmospheric model
#
# NOTE: all molecules (and their isotopologues) must share the same layering of
# the atmosphere. This defines the common atmospheric model of ARAHMIS.
LBL Molecular Layers: [
  {
    Molecules: [ "H2O" ], # list of molecule names or "..." (for the rest of the molecules)
    Isotopologues: [
      {
        # AveragingMethodOfVMR: linear # linear or logarithmic (linear by default if the line is missing)
        #Ranks: [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ], # ranks of abundance of the isotopologues (list of ranks or "all")
	Ranks: [ all ],
        Layers: [
#         [  0.0,    1.0,    1.2 ],
#         [  1.0,    2.0,    1.2 ],
#         [  2.0,    3.0,    1.2 ],
#         [  3.0,    4.0,    1.2 ],
#         [  4.0,    5.0,    1.2 ],
#         [  5.0,    6.0,    1.2 ],
#         [  6.0,    7.0,    1.2 ],
#         [  7.0,    8.0,    1.2 ],
#         [  8.0,    9.0,    1.2 ],
#         [  9.0,   10.0,    1.2 ],
#         [ 10.0,   11.0,    1.2 ],
#         [ 11.0,   12.0,    1.2 ],
#         [ 12.0,   13.0,    1.2 ],
#         [ 13.0,   14.0,    1.2 ],
#         [ 14.0,   15.0,    1.2 ],
#         [ 15.0,   16.0,    1.2 ],
#         [ 16.0,   17.0,    1.2 ],
#         [ 17.0,   18.0,    1.2 ],
#         [ 18.0,   19.0,    1.2 ],
#         [ 19.0,   20.0,    1.2 ],
#         [ 20.0,   21.0,    1.2 ],
#         [ 21.0,   22.0,    1.2 ],
#         [ 22.0,   23.0,    1.2 ],
#         [ 23.0,   24.0,    1.2 ],
#         [ 24.0,   25.0,    1.2 ],
#         [ 25.0,   27.5,    1.2 ],
#         [ 27.5,   30.0,    1.2 ],
#         [ 30.0,   32.5,    1.2 ],
#         [ 32.5,   35.0,    1.2 ],
#         [ 35.0,   37.5,    1.2 ],
#         [ 37.5,   40.0,    1.2 ],
#         [ 40.0,   42.5,    1.2 ],
        ] # End of layers
      } # End of isotopologue subset
    ] # End of of Isotopologues
  }, # End of specification for the Molecule(s)
]
# Non LBL Molecular Layers
# ========================
# column 1: layer base altitude (in km)
# column 2: layer top altitude (in km)
# column 3: VMR (in ppm) - WARNING: species are not considered in standard atmospheric model
#
# NOTE 1: There is no specification for different isotopologues, molecules are too complex
# NOTE 2: the non LBL layers must contain a whole number of LBL layers (as define in the LBL blocks above).
# It is currently not allowed to define non LBL layers containing fractional LBL layers.

Non LBL Molecular Layers: [
#  {
#    Molecule: CFC-11,
#    Layers: [
#      #[  0.0,   10.0,    4.40E-02 ],
#      #[ 10.0,   20.0,    1.64E-03 ]
#    ]
#  }
]
# Aerosol Layers
# ==============
# column 1: layer base altitude (in km)
# column 2: layer top altitude (in km)
# column 3: Volume Mixing Ratio (in ppm) - WARNING: species are not considered in standard atmospheric model
# column 4: Geometric diameter (in um) 
#
# NOTE: the aerosol layers must contain a whole number of LBL layers (as defined in the LBL blocks above).
# It is currently not allowed to define aerosol layers containing fractional LBL layers.

Enable aerosols: no
Aerosol relative path: "Aerosols" # folder relative to the database root directory
Aerosol Layers: [
#  {
#    Aerosol: Ash, # put a filename here, or the name of an aerosol to look under Aerosol relative path (without the kext_ prefix)
#    Layers: [
#      #[  0.0,   10.0,    0.00E-00,    0.00E-00 ],
#      #[ 10.0,   11.0,    1.64E-14,    0.70E-00 ],
#      #[ 11.0,   20.0,    0.00E-00,    0.00E-00 ]
#    ]
#  }
]
