Modtran
source module isofit.radiative_transfer.engines.modtran
Classes
-
ModtranRT — A model of photon transport including the atmosphere.
source class ModtranRT(engine_config: RadiativeTransferEngineConfig, lut_path: str = '', lut_grid: dict = None, wavelength_file: str = None, interpolator_style: str = 'mlg', build_interpolators: bool = True, overwrite_interpolator: bool = False, wl: np.array = [], fwhm: np.array = [], n_cores: int = 1)
Bases : RadiativeTransferEngine
A model of photon transport including the atmosphere.
Methods
-
parseTokens — Processes tokens returned by parseLine()
-
parseLine — Parses a single line of a .chn file into a list of token values
-
load_chn — Parses a MODTRAN channel file and extracts relevant data
-
load_tp6 — Parses relevant information from a tp6 file. Specifically, seeking a table in the unstructured text and extracting a column from it.
-
preSim — Post-initialized, pre-simulation setup
-
readSim — For a given point, parses the tp6 and chn file and returns the data
-
makeSim — Prepares the command to execute MODTRAN
-
modtran_driver — Write a MODTRAN 6.0 input file.
-
check_modtran_water_upperbound — Check to see what the max water vapor values is at the first point in the LUT
-
modtran_water_upperbound_polynomials — Polynomials as a function of ground altitude (km) to estimate upperbound of water column vapor (g/cm2).
-
modtran_aot_lowerbound_polynomials — Polynomials as a function of ground altitude (km) to estimate lowerbound of AOT at 550nm.
-
wl2flt — Helper function to generate Gaussian distributions around the center wavelengths.
source staticmethod ModtranRT.parseTokens(tokens: list, coszen: float) → dict
Processes tokens returned by parseLine()
Parameters
-
tokens : list — List of floats returned by parseLine()
-
coszen : float — cos(zenith(filename))
Returns
-
dict — Dictionary of calculated values using the tokens list
source staticmethod ModtranRT.parseLine(line: str) → list
Parses a single line of a .chn file into a list of token values
Parameters
-
line : str — Singular data line of a MODTRAN .chn file
Returns
-
list — List of floats parsed from the line
source method ModtranRT.load_chn(file: str, coszen: float, header: int = 5) → dict
Parses a MODTRAN channel file and extracts relevant data
Parameters
-
file : str — Path to a .chn file
-
coszen : float — ...
-
header : int, defaults=5 — Number of lines to skip for the header
Returns
-
chn : dict — Channel data
source staticmethod ModtranRT.load_tp6(file)
Parses relevant information from a tp6 file. Specifically, seeking a table in the unstructured text and extracting a column from it.
Parameters
-
tp6 : str — tp6 file path
Raises
-
ValueError
source method ModtranRT.preSim()
Post-initialized, pre-simulation setup
source method ModtranRT.readSim(point)
For a given point, parses the tp6 and chn file and returns the data
source method ModtranRT.makeSim(point, file=None, timeout=None)
Prepares the command to execute MODTRAN
source method ModtranRT.modtran_driver(overrides)
Write a MODTRAN 6.0 input file.
Raises
-
AttributeError
source method ModtranRT.check_modtran_water_upperbound() → float
Check to see what the max water vapor values is at the first point in the LUT
Returns
-
float — max water vapor value, or None if test fails
source staticmethod ModtranRT.modtran_water_upperbound_polynomials() → dict
Polynomials as a function of ground altitude (km) to estimate upperbound of water column vapor (g/cm2).
Returns
-
dict — 3rd degree polynomials to estimate upperbound of water column vapor
source staticmethod ModtranRT.modtran_aot_lowerbound_polynomials() → dict
Polynomials as a function of ground altitude (km) to estimate lowerbound of AOT at 550nm.
Returns
-
dict — 3rd degree polynomials to estimate lowerbound of AOT
source method ModtranRT.required_results_exist(filename_base)
source method ModtranRT.wl2flt(wavelengths: np.array, fwhms: np.array, outfile: str) → None
Helper function to generate Gaussian distributions around the center wavelengths.
Parameters
-
wavelengths : np.array — wavelength centers
-
fwhms : np.array — full width at half max
-
outfile : str — file to write to