eradiate.experiments.AtmosphereExperiment

class eradiate.experiments.AtmosphereExperiment(measures=NOTHING, integrator=AUTO, results=NOTHING, background_spectral_grid=AUTO, ckd_quad_config=NOTHING, extra_objects=None, illumination=NOTHING, kdict=NOTHING, kpmap=NOTHING, geometry='plane_parallel', atmosphere=NOTHING, surface=NOTHING)[source]

Bases: EarthObservationExperiment

Simulate radiation in a one-dimensional scene. This experiment approximates a one-dimensional setup using a 3D geometry set up to reproduce the effect of invariances typical of 1D geometries. It supports the so-called plane parallel and spherical shell geometries.

Parameters:
  • measures (list of Measure or list of dict or Measure or dict, default: MultiDistantMeasure()) – List of measure specifications. The passed list may contain dictionaries, which will be interpreted by measure_factory. Optionally, a single Measure or dictionary specification may be passed and will automatically be wrapped into a list.

  • integrator (Integrator or dict or AUTO, default: AUTO) – Monte Carlo integration algorithm specification. This parameter can be specified as a dictionary which will be interpreted by integrator_factory.The integrator defaults to AUTO, which will choose the appropriate integrator depending on the experiment’s configuration.

  • background_spectral_grid (SpectralGrid or AUTO, default: AUTO) – Background spectral grid. If the value is AUTO, the background spectral grid is automatically generated depending on the active mode and internal experiment constraints. Otherwise, the value must be convertible to a SpectralGrid instance.

  • ckd_quad_config (CKDQuadConfig or dict) – CKD quadrature rule generation configuration.

  • extra_objects (dict or None, default: None) – Dictionary of extra objects to be added to the scene. The keys of this dictionary are used to identify the objects in the kernel dictionary.

  • illumination (DirectionalIllumination or ConstantIllumination or dict, default: DirectionalIllumination()) – Illumination specification. This parameter can be specified as a dictionary which will be interpreted by illumination_factory.

  • kdict (mapping, default: {}) – Additional kernel dictionary template appended to the experiment-controlled template.

  • kpmap (mapping, default: {}) – Additional scene parameter update map template appended to the experiment-controlled template.

  • geometry (str or dict or SceneGeometry, default: "plane_parallel") – Problem geometry. Can be specified as a simple string ("plane_parallel" or "spherical_shell"), a dictionary interpreted by SceneGeometry.convert(), or a SceneGeometry instance.

  • atmosphere (Atmosphere or dict or None, default: HomogeneousAtmosphere()) – Atmosphere specification. If set to None, no atmosphere will be added. This parameter can be specified as a dictionary which will be interpreted by atmosphere_factory.

  • surface (BasicSurface or BSDF or dict, optional, default: BasicSurface(bsdf=LambertianBSDF())) – Surface specification. If set to None, no surface will be added. This parameter can be specified as a dictionary which will be interpreted by surface_factory and bsdf_factory.

Fields:

Notes

  • A post-initialization step will constrain the measure setup if a distant measure is used and set the target to [0, 0, 0].

  • This experiment supports arbitrary measure positioning, except for MultiRadiancemeterMeasure, for which subsensor origins are required to be either all inside or all outside of the atmosphere. If an unsuitable configuration is detected, a ValueError will be raised during initialization.

clear()

Clear previous experiment results and reset internal state.

context_init()

Return a single context used for scene initialization.

Returns:

KernelContext

contexts(measures=None)

Return a list of contexts used for processing.

Parameters:

measures (int or list of int, optional) – A list of the indexes of the measures to account for when emitting kernel contexts. If unset, all measures are accounted for.

Returns:

list of KernelContext

init(drop_parameters=True)

Generate kernel dictionary and initialize Mitsuba scene.

Parameters:

drop_parameters (bool) – If True, drop Mitsuba scene parameters that are not used (i.e. that do not have an updater associated).

pipeline(measure)

Return the post-processing pipeline for a given measure.

Parameters:

measure (Measure or int) – Measure for which the pipeline is generated.

Returns:

Pipeline

postprocess(measures=None)

Post-process raw results and store them in results.

Parameters:

measures (int or list of int, optional) – Indices of the measures that will be processed. By default, all measures are processed.

process(measures=None, spp=0, seed_state=None)

Run simulation and collect raw results.

Parameters:
  • measures (int or list of int, optional) – Indices of the measures that will be processed. By default, all measures are processed.

  • spp (int, optional) – Sample count. If set to 0, the value set in the original scene definition takes precedence.

  • seed_state (SeedState, optional) – Seed state used to generate seeds to initialize Mitsuba’s RNG at every iteration of the parametric loop. If unset, Eradiate’s root seed state is used.

spectral_indices(measure_index)

Generate spectral indices for a given measure.

Parameters:

measure_index (int) – Measure index for which spectral indices are generated.

Yields:

SpectralIndex – Spectral index.

property ckd_quads

A dictionary mapping measure index to the associated CKD quadrature rule (if relevant).

property results

Post-processed simulation results.

Returns:

dict[str, Dataset] – Dictionary mapping measure IDs to xarray datasets.

property scene

Return a scene object used for kernel dictionary template and parameter table generation.

property scene_objects

Return a dictionary of string identifiers to the SceneElement instances generated by this experiment.

Notes

These elements make up the core scene contents for this experiment, and are merged together with the contents of the extra_objects dictionary to initialize the underlying kernel scene. If you are writing your own EarthObservationExperiment subclass, this property is critical.

property spectral_grids

A dictionary mapping measure index to the associated spectral grid.