isofit.utils.apply_oe
Attributes
Functions
|
Applies OE over a flightline using a radiative transfer engine. This executes |
|
Module Contents
- SUPPORTED_SENSORS = ['ang', 'avcl', 'neon', 'prism', 'emit', 'enmap', 'hyp', 'prisma', 'av3', 'gao', 'oci', 'tanager', 'av5'][source]
- RTM_CLEANUP_LIST = ['*r_k', '*t_k', '*tp7', '*wrn', '*psc', '*plt', '*7sc', '*acd', '*.inp', '*.sh'][source]
- apply_oe(input_radiance, input_loc, input_obs, working_directory, sensor, surface_path, copy_input_files=False, modtran_path=None, wavelength_path=None, surface_category='multicomponent_surface', surface_class_file=None, classify_multisurface=False, aerosol_climatology_path=None, rdn_factors_path=None, atmosphere_type='ATM_MIDLAT_SUMMER', channelized_uncertainty_path=None, dn_uncertainty_file=None, model_discrepancy_path=None, lut_config_file=None, multiple_restarts=False, logging_level='INFO', log_file=None, n_cores=1, presolve=False, empirical_line=False, analytical_line=False, ray_temp_dir='/tmp/ray', emulator_base=None, segmentation_size=40, num_neighbors=[], atm_sigma=[2], pressure_elevation=False, prebuilt_lut=None, no_min_lut_spacing=False, inversion_windows=None, config_only=False, interpolate_bad_rdn=False, interpolate_inplace=False, skyview_factor=None, resources=False, retrieve_co2=False)[source]
Applies OE over a flightline using a radiative transfer engine. This executes ISOFIT in a generalized way, accounting for the types of variation that might be considered typical.
Observation (obs) and location (loc) files are used to determine appropriate geometry lookup tables and provide a heuristic means of determining atmospheric water ranges.
:param input_radiance: Radiance data cube. Expected to be ENVI format :type input_radiance: str :param input_loc: Location data cube of shape (Lon, Lat, Elevation). Expected to be ENVI format :type input_loc: str :param input_obs:
- Observation data cube of shape:
(path length, to-sensor azimuth, to-sensor zenith, to-sun azimuth, to-sun zenith, phase, slope, aspect, cosine i, UTC time)
Expected to be ENVI format
- Parameters:
working_directory (str) – Directory to stage multiple outputs, will contain subdirectories
sensor (str) – The sensor used for acquisition, will be used to set noise and datetime settings
surface_path (str) – Path to surface model or json dict of surface model configuration
copy_input_files (bool, default=False) – Flag to choose to copy input_radiance, input_loc, and input_obs locally into the working_directory
modtran_path (str, default=None) – Location of MODTRAN utility. Alternately set with MODTRAN_DIR environment variable
wavelength_path (str, default=None) – Location to get wavelength information from, if not specified the radiance header will be used
surface_category (str, default="multicomponent_surface") – The type of ISOFIT surface priors to use. Default is multicomponent_surface
aerosol_climatology_path (str, default=None) – Specific aerosol climatology information to use in MODTRAN
rdn_factors_path (str, default=None) – Specify a radiometric correction factor, if desired
atmosphere_type (str, default="ATM_MIDLAT_SUMMER") – Atmospheric profile to be used for MODTRAN simulations. Unused for other radiative transfer models.
channelized_uncertainty_path (str, default=None) – Path to a channelized uncertainty file
dn_uncertainty_file (str, default=None) – Path to a linearity .mat file to augment S matrix with linearity uncertainty
model_discrepancy_path (str, default=None) – Modifies S_eps in the OE formalism as the Gamma additive term, as: S_eps = Sy + Kb.dot(self.Sb).dot(Kb.T) + Gamma
lut_config_file (str, default=None) – Path to a look up table configuration file, which will override defaults choices
multiple_restarts (bool, default=False) – Use multiple initial starting poitns for each OE ptimization run, using the corners of the atmospheric variables as starting points. This gives a more robust, albeit more expensive, solution.
logging_level (str, default="INFO") – Logging level with which to run ISOFIT
log_file (str, default=None) – File path to write ISOFIT logs to
n_cores (int, default=1) – Number of cores to run ISOFIT with. Substantial parallelism is available, and full runs will be very slow in serial. Suggested to max this out on the available system
presolve (int, default=False) – Flag to use a presolve mode to estimate the available atmospheric water range. Runs a preliminary inversion over the image with a 1-D LUT of water vapor, and uses the resulting range (slightly expanded) to bound determine the full LUT. Advisable to only use with small cubes or in concert with the empirical_line setting, or a significant speed penalty will be incurred
empirical_line (bool, default=False) – Use an empirical line interpolation to run full inversions over only a subset of pixels, determined using a SLIC superpixel segmentation, and use a KDTREE of local solutions to interpolate radiance->reflectance. Generally a good option if not trying to analyze the atmospheric state at fine scale resolution. Mutually exclusive with analytical_line
analytical_line (bool, default=False) – Use an analytical solution to the fixed atmospheric state to solve for each pixel. Starts by running a full OE retrieval on each SLIC superpixel, then interpolates the atmospheric state to each pixel, and closes with the analytical solution. Mutually exclusive with empirical_line
ray_temp_dir (str, default="/tmp/ray") – Location of temporary directory for ray parallelization engine
emulator_base (str, default=None) – Location of emulator base path. Point this at the 3C or 6C .h5 files. sRTMnet to use the emulator instead of MODTRAN. An additional file with the same basename and the extention _aux.npz must accompany e.g. /path/to/emulator.h5 /path/to/emulator_aux.npz
segmentation_size (int, default=40) – If empirical_line is enabled, sets the size of segments to construct
num_neighbors (list[int], default=[]) – Forced number of neighbors for empirical line extrapolation - overides default set from segmentation_size parameter
atm_sigma (list[int], default=[2]) – A list of smoothing factors to use during the atmospheric interpolation, one for each atmospheric parameter (or broadcast to all if only one is provided). Only used with the analytical line.
pressure_elevation (bool, default=False) – Flag to retrieve elevation
prebuilt_lut (str, default=None) – Use this pre-constructed look up table for all retrievals. Must be an ISOFIT-compatible RTE NetCDF
no_min_lut_spacing (bool, default=False) – Don’t allow the LUTConfig to remove a LUT dimension because of minimal spacing.
inversion_windows (list[float], default=None) – Override the default inversion windows. Will supercede any sensor specific defaults that are in place. Must be in 2-item tuples
config_only (bool, default=False) – Generates the configuration then exits before execution. If presolve is enabled, that run will still occur.
interpolate_bad_rdn (bool, default=False) – Flag to perform a per-pixel interpolation across no-data and NaN data bands. Does not interpolate vectors that are entire no-data or NaN, only partial. Currently only designed for wavelength interpolation on spectra. Does NOT do any spatial interpolation
interpolate_inplace (bool, default=False) – Flag to tell interpolation to work on the file in place, or generate a new interpolated rdn file. The location of the new file will be in the “input” directory within the working directory.
skyview_factor (str, default=None) – Flag to determine method to account for skyview factor. Default is None, creating an array of 1s. Other option is “slope” which will approx. based on cos^2(slope/2). Other option is a path to a skyview ENVI file computed via skyview.py utility or other source. Please note data must range from 0-1.
resources (bool, default=False) – Enables the system resource tracker. Must also have the log_file set.
retrieve_co2 (bool, default=False) – Flag to retrieve CO2 in the state vector. Only available with emulator at the moment.
References
D.R. Thompson, A. Braverman,P.G. Brodrick, A. Candela, N. Carbon, R.N. Clark,D. Connelly, R.O. Green, R.F. Kokaly, L. Li, N. Mahowald, R.L. Miller, G.S. Okin, T.H.Painter, G.A. Swayze, M. Turmon, J. Susilouto, and D.S. Wettergreen. Quantifying Uncertainty for Remote Spectroscopy of Surface Composition. Remote Sensing of Environment, 2020. doi: https://doi.org/10.1016/j.rse.2020.111898.
sRTMnet emulator: 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.