isofit.radiative_transfer.radiative_transfer_engine
Attributes
Classes
Functions
|
Run a simulation for a single point and stream the results to a saved lut file. |
Module Contents
- class RadiativeTransferEngine(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: numpy.array = [], fwhm: numpy.array = [])[source]
-
- geometry_input_names = ['observer_azimuth', 'observer_zenith', 'solar_azimuth', 'solar_zenith', 'relative_azimuth',...[source]
- __getitem__(key)[source]
Enables key indexing for easier access to the numpy object store in self.lut[key]
- build_interpolators()[source]
Builds the interpolators using the LUT store
TODO: optional load from/write to disk
- preSim()[source]
This is an optional function that can be defined by a subclass RTE to be called directly before runSim() is executed. A subclass may return a dict containing any single or non-dimensional variables to be saved to the LUT file
- makeSim(point: numpy.array, template_only: bool = False)[source]
Prepares and executes a radiative transfer engine’s simulations
- Parameters:
point (np.array) – conditions to alter in simulation
template_only (bool) – only write template file and then stop
- readSim(point: numpy.array)[source]
Reads simulation results to standard form
- Parameters:
point (np.array) – conditions to alter in simulation
- postSim()[source]
This is an optional function that can be defined by a subclass RTE to be called directly after runSim() is finished. A subclass may return a dict containing any single or non-dimensional variables to be saved to the LUT file
- point_to_filename(point: numpy.array) str[source]
Change a point to a base filename
- Parameters:
point (np.array) – conditions to alter in simulation
- Returns:
basename of the file to use for this point
- Return type:
- get(x_RT: numpy.array, geom: Geometry) dict[source]
Retrieves the interpolation values for a given point
- interpolate(point: numpy.array) dict[source]
Compiles the results of the interpolators for a given point
- static two_albedo_method(case_0: dict, case_1: dict, case_2: dict, coszen: float, rfl_1: float = 0.1, rfl_2: float = 0.5) dict[source]
Calculates split transmittance values from a multipart file using the two-albedo method. See notes for further detail.
- Parameters:
case_0 (dict) – MODTRAN output for a non-reflective surface (case 0 of the channel file)
case_1 (dict) – MODTRAN output for surface reflectance = rfl_1 (case 1 of the channel file)
case_2 (dict) – MODTRAN output for surface reflectance = rfl_2 (case 2 of the channel file)
coszen (float) – cosine of the solar zenith angle
rfl_1 (float, defaults=0.1) – surface reflectance for case 1 of the MODTRAN output
rfl_2 (float, defaults=0.5) – surface reflectance for case 2 of the MODTRAN output
- Returns:
data – Relevant information
- Return type:
Notes
This implementation follows Guanter et al. (2009) (DOI:10.1080/01431160802438555), modified by Nimrod Carmon. It is called the “2-albedo” method, referring to running MODTRAN with 2 different surface albedos. Alternatively, one could also run the 3-albedo method, which is similar to this one with the single difference where the “path_radiance_no_surface” variable is taken from a zero-surface-reflectance MODTRAN run instead of being calculated from 2 MODTRAN outputs.
There are a few argument as to why the 2- or 3-albedo methods are beneficial:
For each grid point on the lookup table you sample MODTRAN 2 or 3 times, i.e., you get 2 or 3 “data points” for the atmospheric parameter of interest. This in theory allows us to use a lower band model resolution for the MODTRAN run, which is much faster, while keeping high accuracy.
We use the decoupled transmittance products to expand the forward model and account for more physics, currently topography and glint.
- streamSimulation(point: numpy.array, lut_names: list, simmer: Callable, reader: Callable, output: str, max_buffer_time: float = 0.5, rte_configure_and_exit: bool = False)[source]
Run a simulation for a single point and stream the results to a saved lut file.
- Parameters:
point (np.array) – conditions to alter in simulation
lut_names (list) – Dimension names aka lut_names
simmer (function) – function to run the simulation
reader (function) – function to read the results of the simulation
output (str) – LUT store to save results to
max_buffer_time (float, optional) – _description_. Defaults to 0.5.
rte_configure_and_exit (bool, optional) – exit early if not executing simulations