isofit.radiative_transfer.radiative_transfer_engine =================================================== .. py:module:: isofit.radiative_transfer.radiative_transfer_engine Attributes ---------- .. autoapisummary:: isofit.radiative_transfer.radiative_transfer_engine.Logger Classes ------- .. autoapisummary:: isofit.radiative_transfer.radiative_transfer_engine.RadiativeTransferEngine Functions --------- .. autoapisummary:: isofit.radiative_transfer.radiative_transfer_engine.streamSimulation Module Contents --------------- .. py:data:: Logger .. py:class:: RadiativeTransferEngine(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 = []) .. py:attribute:: _disable_makeSim :value: False .. py:attribute:: max_buffer_time :value: 0 .. py:attribute:: geometry_input_names :value: ['observer_azimuth', 'observer_zenith', 'solar_azimuth', 'solar_zenith', 'relative_azimuth',... .. py:attribute:: coszen .. py:attribute:: solar_irr .. py:attribute:: engine_config .. py:attribute:: interpolator_style :value: 'mlg' .. py:attribute:: overwrite_interpolator :value: False .. py:attribute:: treat_as_emissive .. py:attribute:: engine_base_dir .. py:attribute:: sim_path .. py:attribute:: rt_mode .. py:attribute:: coupling_terms :value: ['dir-dir', 'dif-dir', 'dir-dif', 'dif-dif'] .. py:attribute:: multipart_transmittance .. py:attribute:: glint_model .. py:attribute:: wl :value: [] .. py:attribute:: fwhm :value: [] .. py:attribute:: n_chan .. py:attribute:: n_point .. py:attribute:: cached .. py:attribute:: indices .. py:method:: __getitem__(key) Enables key indexing for easier access to the numpy object store in self.lut[key] .. py:method:: build_interpolators() Builds the interpolators using the LUT store TODO: optional load from/write to disk .. py:method:: preSim() 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 .. py:method:: makeSim(point: numpy.array, template_only: bool = False) Prepares and executes a radiative transfer engine's simulations :param point: conditions to alter in simulation :type point: np.array :param template_only: only write template file and then stop :type template_only: bool .. py:method:: readSim(point: numpy.array) Reads simulation results to standard form :param point: conditions to alter in simulation :type point: np.array .. py:method:: postSim() This is an optional function that can be defined by a subclass RTE to be called directly after runSim() is finished. A subclass may return a dict containing any single or non-dimensional variables to be saved to the LUT file .. py:method:: point_to_filename(point: numpy.array) -> str Change a point to a base filename :param point: conditions to alter in simulation :type point: np.array :returns: basename of the file to use for this point :rtype: str .. py:method:: get(x_RT: numpy.array, geom: Geometry) -> dict Retrieves the interpolation values for a given point :param x_RT: Radiative-transfer portion of the statevector :type x_RT: np.array :param geom: Local geometry conditions for lookup :type geom: Geometry :returns: **self.interpolate(point)** -- ... :rtype: dict .. py:method:: interpolate(point: numpy.array) -> dict Compiles the results of the interpolators for a given point .. py:method:: runSimulations() -> None Run all simulations for the LUT grid. .. py:method:: summarize(x_RT, *_) Pretty prints lut_name=value, ... .. py:method:: two_albedo_method(case_0: dict, case_1: dict, case_2: dict, coszen: float, rfl_1: float = 0.1, rfl_2: float = 0.5) -> dict :staticmethod: Calculates split transmittance values from a multipart file using the two-albedo method. See notes for further detail. :param case_0: MODTRAN output for a non-reflective surface (case 0 of the channel file) :type case_0: dict :param case_1: MODTRAN output for surface reflectance = rfl_1 (case 1 of the channel file) :type case_1: dict :param case_2: MODTRAN output for surface reflectance = rfl_2 (case 2 of the channel file) :type case_2: dict :param coszen: cosine of the solar zenith angle :type coszen: float :param rfl_1: surface reflectance for case 1 of the MODTRAN output :type rfl_1: float, defaults=0.1 :param rfl_2: surface reflectance for case 2 of the MODTRAN output :type rfl_2: float, defaults=0.5 :returns: **data** -- Relevant information :rtype: dict .. rubric:: Notes This implementation follows Guanter et al. (2009) (DOI:10.1080/01431160802438555), modified by Nimrod Carmon. It is called the "2-albedo" method, referring to running MODTRAN with 2 different surface albedos. Alternatively, one could also run the 3-albedo method, which is similar to this one with the single difference where the "path_radiance_no_surface" variable is taken from a zero-surface-reflectance MODTRAN run instead of being calculated from 2 MODTRAN outputs. There are a few argument as to why the 2- or 3-albedo methods are beneficial: (1) For each grid point on the lookup table you sample MODTRAN 2 or 3 times, i.e., you get 2 or 3 "data points" for the atmospheric parameter of interest. This in theory allows us to use a lower band model resolution for the MODTRAN run, which is much faster, while keeping high accuracy. (2) We use the decoupled transmittance products to expand the forward model and account for more physics, currently topography and glint. .. py:function:: streamSimulation(point: numpy.array, lut_names: list, simmer: Callable, reader: Callable, output: str, max_buffer_time: float = 0.5, rte_configure_and_exit: bool = False) Run a simulation for a single point and stream the results to a saved lut file. :param point: conditions to alter in simulation :type point: np.array :param lut_names: Dimension names aka lut_names :type lut_names: list :param simmer: function to run the simulation :type simmer: function :param reader: function to read the results of the simulation :type reader: function :param output: LUT store to save results to :type output: str :param max_buffer_time: _description_. Defaults to 0.5. :type max_buffer_time: float, optional :param rte_configure_and_exit: exit early if not executing simulations :type rte_configure_and_exit: bool, optional