eradiate.experiments.CanopyExperiment#

class eradiate.experiments.CanopyExperiment(measures=NOTHING, integrator=AUTO, results=NOTHING, background_spectral_grid=AUTO, ckd_quad_config=NOTHING, extra_objects=None, illumination=NOTHING, canopy=None, padding=0, surface=NOTHING)[source]#

Bases: EarthObservationExperiment

Simulate radiation in a scene with an explicit canopy and no atmosphere. This experiment assumes that the surface is plane and accounts for ground unit cell padding.

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.

  • canopy (Canopy or dict or None, default: None) – Canopy specification. This parameter can be specified as a dictionary which will be interpreted by biosphere_factory.

  • padding (int, default: 0) – Padding level. The scene will be padded with copies to account for adjacency effects. This, in practice, has effects similar to making the scene periodic.A value of 0 will yield only the defined scene. A value of 1 will add one copy in every direction, yielding a 3×3 patch. A value of 2 will yield a 5×5 patch, etc. The optimal padding level depends on the scene.

  • 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. If relevant, the surface size will be adjusted automatically upon kernel. dictionary generation.

Fields:

Notes

A post-initialization step will constrain the measure setup if a distant measure is used and no target is defined:

  • if a canopy is defined, the target will be set to the top of the canopy unit cell (i.e. without its padding);

  • if no canopy is defined, the target will be set to [0, 0, 0].

clear()#

Clear previous experiment results and reset internal state.

init()#

Generate kernel dictionary and initialize Mitsuba scene.

pipeline(measure)#

Return the post-processing pipeline for a given measure.

Parameters:

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

Returns:

hamilton.driver.Driver

postprocess()#

Post-process raw results and store them in results.

process(spp=0, seed_state=None)#

Run simulation and collect raw results.

Parameters:
  • 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 context_init#

Return a single context used for scene initialization.

property contexts#

Return a list of contexts used for processing.

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 spectral_grids#

A dictionary mapping measure index to the associated spectral grid.