isofit.radiative_transfer.engines

Submodules

Attributes

Engines

Classes

KernelFlowsRT

Radiative transfer emulation based on KernelFlows.jl and VSWIREmulator.jl. A description of

ModtranRT

A model of photon transport including the atmosphere.

SixSRT

A model of photon transport including the atmosphere.

SimulatedModtranRT

A hybrid surrogate-model and emulator of MODTRAN-like results. A description of

Package Contents

class KernelFlowsRT(engine_config: RadiativeTransferEngineConfig, **kwargs)[source]

Bases: isofit.radiative_transfer.radiative_transfer_engine.RadiativeTransferEngine

Radiative transfer emulation based on KernelFlows.jl and VSWIREmulator.jl. A description of the model can be found in:

O. Lamminpää, J. Susiluoto, J. Hobbs, J. McDuffie, A. Braverman, and H. Owhadi. Forward model emulator for atmospheric radiative transfer using Gaussian processes and cross validation (2024). Submitted to Atmospheric Measurement Techniques.

f
emulator_wl
emulator_internal_idx
emulator_names
points_bound_min
points_bound_max
input_transfs
output_transfs
rt_mode = 'rdn'
assign_bounds()[source]
h5_to_dict(file)[source]
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(in_point)[source]

Since KF doesn’t need to run simulations, readSim is where we actually do the work

Parameters:

in_point (np.array) – Input point - organized based on lut_grid, not emulator

Returns:

Dictionary of output values

Return type:

dict

predict(points)[source]
predict_single_MVM(MVM, points, transfs)[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: numpy.array = [], fwhm: numpy.array = [])[source]

Bases: isofit.radiative_transfer.radiative_transfer_engine.RadiativeTransferEngine

A model of photon transport including the atmosphere.

max_buffer_time = 0.5
static parseTokens(tokens: list, coszen: float) dict[source]

Processes tokens returned by parseLine()

Parameters:
  • tokens (list) – List of floats returned by parseLine()

  • coszen (float) – cos(zenith(filename))

Returns:

Dictionary of calculated values using the tokens list

Return type:

dict

static parseLine(line: str) list[source]

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 of floats parsed from the line

Return type:

list

load_chn(file: str, coszen: float, header: int = 5) dict[source]

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 – Channel data

Return type:

dict

static load_tp6(file)[source]

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

preSim()[source]

Post-initialized, pre-simulation setup

readSim(point)[source]

For a given point, parses the tp6 and chn file and returns the data

makeSim(point, file=None, timeout=None)[source]

Prepares the command to execute MODTRAN

modtran_driver(overrides)[source]

Write a MODTRAN 6.0 input file.

check_modtran_water_upperbound() float[source]

Check to see what the max water vapor values is at the first point in the LUT

Returns:

max water vapor value, or None if test fails

Return type:

float

static modtran_water_upperbound_polynomials() dict[source]

Polynomials as a function of ground altitude (km) to estimate upperbound of water column vapor (g/cm2).

Returns:

3rd degree polynomials to estimate upperbound of water column vapor

Return type:

dict

static modtran_aot_lowerbound_polynomials() dict[source]

Polynomials as a function of ground altitude (km) to estimate lowerbound of AOT at 550nm.

Returns:

3rd degree polynomials to estimate lowerbound of AOT

Return type:

dict

required_results_exist(filename_base)[source]
wl2flt(wavelengths: numpy.array, fwhms: numpy.array, outfile: str) None[source]

Helper function to generate Gaussian distributions around the center wavelengths.

Parameters:
  • wavelengths – wavelength centers

  • fwhms – full width at half max

  • outfile – file to write to

class SixSRT(engine_config: RadiativeTransferEngineConfig, modtran_emulation=False, **kwargs)[source]

Bases: isofit.radiative_transfer.radiative_transfer_engine.RadiativeTransferEngine

A model of photon transport including the atmosphere.

modtran_emulation = False
wl
fwhm
engine_base_dir
exe
co2_mode = False
preSim()[source]

Add the 6S executable in the LUT attributes

makeSim(point: numpy.array)[source]

Perform 6S simulations

Parameters:

point (np.array) – Point to process

readSim(point: numpy.array)[source]

Parses a 6S output simulation file for a given point

Parameters:

point (np.array) – Point to process

Returns:

data – Simulated data results. These keys correspond with the expected keys of ISOFIT’s LUT files

Return type:

dict

postSim()[source]

Update solar_irr after simulations

rebuild_cmd(point, wlinf, wlsup) str[source]

Build the simulation command file.

Parameters:
  • point (np.array) – conditions to alter in simulation

  • wlinf (float) – shortest wavelength to run simulation for

  • wlsup – (float): longest wavelength to run simulation for

Returns:

execution command

Return type:

str

load_esd()[source]

Loads the earth-sun distance file

static parse_file(file, wl, multipart_transmittance=False, wl_size=0) dict[source]

Parses a 6S sim file

Parameters:
  • file (str) – Path to simulation file to parse

  • wl (np.array) – Simulation wavelengths

  • multipart_transmittance (bool) – Flag to tell program to parse up-down split transmittances

  • wl_size (int, default=0) – Size of the wavelengths dim, will trim data to this size. If zero, does no trimming

Returns:

data – Simulated data results. These keys correspond with the expected keys of ISOFIT’s LUT files

Return type:

dict

Examples

>>> from isofit.data import env
>>> from isofit.radiative_transfer.engines import SixSRT
>>> SixSRT.parse_file(f'{env.examples}/20151026_SantaMonica/lut/AOT550-0.0000_H2OSTR-0.5000', wl_size=3)
{'sphalb': array([0.3116, 0.3057, 0.2999]),
 'rhoatm': array([0.2009, 0.1963, 0.1916]),
 'transm_down_dif': array([0.53211358, 0.53993346, 0.54736113]),
 'solzen': 55.21,
 'coszen': 0.5705702414191993}
class SimulatedModtranRT(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]

Bases: isofit.radiative_transfer.radiative_transfer_engine.RadiativeTransferEngine

A hybrid surrogate-model and emulator of MODTRAN-like results. A description of the model can be found in:

P.G. Brodrick, D.R. Thompson, J.E. Fahlen, M.L. Eastwood, C.M. Sarture, S.R. Lundeen, W. Olson-Duvall, N. Carmon, and R.O. Green. Generalized radiative transfer emulation for imaging spectroscopy reflectance retrievals. Remote Sensing of Environment, 261:112476, 2021.doi: 10.1016/j.rse.2021.112476.

lut_quantities
aux_quantities
_disable_makeSim = True
preSim()[source]

sRTMnet leverages 6S to simulate results which is best done before sRTMnet begins simulations itself

makeSim(point)[source]

sRTMnet does not implement a makeSim because it leverages 6S as its simulator As such, preSim() to create 6S, readSim() to process the 6S results

readSim(point)[source]

Resamples the predicts produced by preSim to be saved in self.lut_path

postSim()[source]

Post-simulation adjustments for sRTMnet.

Engines[source]