isofit.utils.apply_oe ===================== .. py:module:: isofit.utils.apply_oe Attributes ---------- .. autoapisummary:: isofit.utils.apply_oe.EPS isofit.utils.apply_oe.CHUNKSIZE isofit.utils.apply_oe.UNCORRELATED_RADIOMETRIC_UNCERTAINTY isofit.utils.apply_oe.SUPPORTED_SENSORS isofit.utils.apply_oe.RTM_CLEANUP_LIST isofit.utils.apply_oe.INVERSION_WINDOWS Functions --------- .. autoapisummary:: isofit.utils.apply_oe.apply_oe isofit.utils.apply_oe.cli Module Contents --------------- .. py:data:: EPS :value: 1e-06 .. py:data:: CHUNKSIZE :value: 256 .. py:data:: UNCORRELATED_RADIOMETRIC_UNCERTAINTY :value: 0.01 .. py:data:: SUPPORTED_SENSORS :value: ['ang', 'avcl', 'neon', 'prism', 'emit', 'enmap', 'hyp', 'prisma', 'av3', 'gao', 'oci', 'tanager', 'av5'] .. py:data:: RTM_CLEANUP_LIST :value: ['*r_k', '*t_k', '*tp7', '*wrn', '*psc', '*plt', '*7sc', '*acd', '*.inp', '*.sh'] .. py:data:: INVERSION_WINDOWS :value: [[350.0, 1360.0], [1410, 1800.0], [1970.0, 2500.0]] .. py:function:: 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) 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 :type input_obs: str :param working_directory: Directory to stage multiple outputs, will contain subdirectories :type working_directory: str :param sensor: The sensor used for acquisition, will be used to set noise and datetime settings :type sensor: str :param surface_path: Path to surface model or json dict of surface model configuration :type surface_path: str :param copy_input_files: Flag to choose to copy input_radiance, input_loc, and input_obs locally into the working_directory :type copy_input_files: bool, default=False :param modtran_path: Location of MODTRAN utility. Alternately set with `MODTRAN_DIR` environment variable :type modtran_path: str, default=None :param wavelength_path: Location to get wavelength information from, if not specified the radiance header will be used :type wavelength_path: str, default=None :param surface_category: The type of ISOFIT surface priors to use. Default is multicomponent_surface :type surface_category: str, default="multicomponent_surface" :param aerosol_climatology_path: Specific aerosol climatology information to use in MODTRAN :type aerosol_climatology_path: str, default=None :param rdn_factors_path: Specify a radiometric correction factor, if desired :type rdn_factors_path: str, default=None :param atmosphere_type: Atmospheric profile to be used for MODTRAN simulations. Unused for other radiative transfer models. :type atmosphere_type: str, default="ATM_MIDLAT_SUMMER" :param channelized_uncertainty_path: Path to a channelized uncertainty file :type channelized_uncertainty_path: str, default=None :param dn_uncertainty_file: Path to a linearity .mat file to augment S matrix with linearity uncertainty :type dn_uncertainty_file: str, default=None :param model_discrepancy_path: Modifies S_eps in the OE formalism as the Gamma additive term, as: S_eps = Sy + Kb.dot(self.Sb).dot(Kb.T) + Gamma :type model_discrepancy_path: str, default=None :param lut_config_file: Path to a look up table configuration file, which will override defaults choices :type lut_config_file: str, default=None :param multiple_restarts: 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. :type multiple_restarts: bool, default=False :param logging_level: Logging level with which to run ISOFIT :type logging_level: str, default="INFO" :param log_file: File path to write ISOFIT logs to :type log_file: str, default=None :param n_cores: 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 :type n_cores: int, default=1 :param presolve: 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 :type presolve: int, default=False :param empirical_line: 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 :type empirical_line: bool, default=False :param analytical_line: 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 :type analytical_line: bool, default=False :param ray_temp_dir: Location of temporary directory for ray parallelization engine :type ray_temp_dir: str, default="/tmp/ray" :param emulator_base: 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 :type emulator_base: str, default=None :param segmentation_size: If empirical_line is enabled, sets the size of segments to construct :type segmentation_size: int, default=40 :param num_neighbors: Forced number of neighbors for empirical line extrapolation - overides default set from segmentation_size parameter :type num_neighbors: list[int], default=[] :param atm_sigma: 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. :type atm_sigma: list[int], default=[2] :param pressure_elevation: Flag to retrieve elevation :type pressure_elevation: bool, default=False :param prebuilt_lut: Use this pre-constructed look up table for all retrievals. Must be an ISOFIT-compatible RTE NetCDF :type prebuilt_lut: str, default=None :param no_min_lut_spacing: Don't allow the LUTConfig to remove a LUT dimension because of minimal spacing. :type no_min_lut_spacing: bool, default=False :param inversion_windows: Override the default inversion windows. Will supercede any sensor specific defaults that are in place. Must be in 2-item tuples :type inversion_windows: list[float], default=None :param config_only: Generates the configuration then exits before execution. If presolve is enabled, that run will still occur. :type config_only: bool, default=False :param interpolate_bad_rdn: 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 :type interpolate_bad_rdn: bool, default=False :param interpolate_inplace: 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. :type interpolate_inplace: bool, default=False :param skyview_factor: 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. :type skyview_factor: str, default=None :param resources: Enables the system resource tracker. Must also have the log_file set. :type resources: bool, default=False :param retrieve_co2: Flag to retrieve CO2 in the state vector. Only available with emulator at the moment. :type retrieve_co2: bool, default=False :param : .. rubric:: 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. .. py:function:: cli(debug_args, profile, **kwargs)