isofit.utils.wavelength_cal =========================== .. py:module:: isofit.utils.wavelength_cal Functions --------- .. autoapisummary:: isofit.utils.wavelength_cal.add_wavelength_elements isofit.utils.wavelength_cal.average_columns isofit.utils.wavelength_cal.wavelength_cal isofit.utils.wavelength_cal.get_wavelength_adjustment isofit.utils.wavelength_cal.cli_get_wavelength_adjustment isofit.utils.wavelength_cal.cli_wavelength_cal Module Contents --------------- .. py:function:: add_wavelength_elements(config_path, state_type='shift', spline_indices=[]) .. py:function:: average_columns(input_radiance_file: str, input_loc_file: str, input_obs_file: str, output_radiance_file: str, output_loc_file: str, output_obs_file: str, start_column: int = None, end_column: int = None, column_interval: int = 1) Averages the columns of input radiance, location, and observation files and saves the results to output files. :param input_radiance_file: Path to the input radiance file. :type input_radiance_file: str :param input_loc_file: Path to the input location file. :type input_loc_file: str :param input_obs_file: Path to the input observation file. :type input_obs_file: str :param output_radiance_file: Path to the output radiance file. :type output_radiance_file: str :param output_loc_file: Path to the output location file. :type output_loc_file: str :param output_obs_file: Path to the output observation file. :type output_obs_file: str :param start_column: Starting column index for averaging. Defaults to None, which means start from the first column. :type start_column: int, optional :param end_column: Ending column index for averaging. Defaults to None, which means average until the last column. :type end_column: int, optional :param column_interval: Step size over columns; skips, doesn't average. Useful to increase runtime speeds. :type column_interval: int, optional :returns: The number of rows in the averaged output files. :rtype: rows (int) .. py:function:: wavelength_cal(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', rdn_factors_path=None, atmosphere_type='ATM_MIDLAT_SUMMER', channelized_uncertainty_path=None, model_discrepancy_path=None, lut_config_file=None, logging_level='INFO', log_file=None, n_cores=1, ray_temp_dir='/tmp/ray', emulator_base=None, prebuilt_lut=None, inversion_windows=None, wl_state_type='shift', spline_indices=[], force_with_geo=False, start_column=None, end_column=None, column_interval=1) Runs a wavelength calibration on an input scene. 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 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 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 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 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 model folder (or h5 file) of 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 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 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 force_with_geo: If True, will allow the wavelength_cal to run on georeferenced data. Not recommended, unless you *really* know what you are doing, or know your metadata is odd. :type force_with_geo: bool, default=False :param start_column: Starting column index for averaging. Defaults to None, which means start from the first column. :type start_column: int, default=None :param end_column: Ending column index for averaging. Defaults to None, which means average until the last column. :type end_column: int, default=None :param column_interval: Step size over columns; skips, doesn't average. Useful to increase runtime speeds. :type column_interval: int, default=1 .. py:function:: get_wavelength_adjustment(config_file: str, output_file: str = None, filter_edges: int = 0) Get the wavelength adjustment based on a previous isofit wavelength_cal run. :param config_file: The configuration file for the wavelength_cal run. :type config_file: str :param output_file: The file to write the wavelength adjustment to. :type output_file: str :param filter_edges: number of edge columns to trim from average :type filter_edges: int :returns: None .. py:function:: cli_get_wavelength_adjustment(debug_args, profile, **kwargs) .. py:function:: cli_wavelength_cal(debug_args, profile, **kwargs)