isofit.radiative_transfer.modtran

exception FileExistsError(message)[source]

Bases: Exception

FileExistsError with a message.

class ModtranRT(engine_config, lut_path='', lut_grid=None, wavelength_file=None, interpolator_style='mlg', build_interpolators=True, overwrite_interpolator=False, wl=[], fwhm=[])[source]

Bases: RadiativeTransferEngine

A model of photon transport including the atmosphere.

static parseTokens(tokens, coszen)[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)[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, coszen, header=5)[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()[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

required_results_exist(filename_base)[source]
wl2flt(wavelengths, fwhms, outfile)[source]

Helper function to generate Gaussian distributions around the center wavelengths.

Parameters:
  • wavelengths (array) – wavelength centers

  • fwhms (array) – full width at half max

  • outfile (str) – file to write to

Return type:

None