eradiate.experiments.CanopyExperiment#
- class eradiate.experiments.CanopyExperiment(measures=_Nothing.NOTHING, results=_Nothing.NOTHING, default_spectral_set=AUTO, quad_spec=_Nothing.NOTHING, extra_objects=None, illumination=_Nothing.NOTHING, canopy=None, padding=0, surface=_Nothing.NOTHING, integrator=_Nothing.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
ofMeasure
orlist
ofdict
orMeasure
ordict
, default:MultiDistantMeasure()
) – List of measure specifications. The passed list may contain dictionaries, which will be interpreted bymeasure_factory
. Optionally, a singleMeasure
or dictionary specification may be passed and will automatically be wrapped into a list.default_spectral_set (
BinSet
orWavelengthSet
orAUTO
, default:AUTO
) – Default spectral set. This attribute is used to set the default value forspectral_set
.If the value isAUTO
, the default spectral set is selected based on the active mode. Otherwise, the value must be aBinSet
orWavelengthSet
instance.extra_objects (
dict
orNone
, 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
ordict
, default:DirectionalIllumination()
) – Illumination specification. This parameter can be specified as a dictionary which will be interpreted byillumination_factory
.canopy (
Canopy
ordict
orNone
, default:None
) – Canopy specification. This parameter can be specified as a dictionary which will be interpreted bybiosphere_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
orBSDF
ordict
, optional, default:BasicSurface(bsdf=LambertianBSDF())
) – Surface specification. If set toNone
, no surface will be added. This parameter can be specified as a dictionary which will be interpreted bysurface_factory
andbsdf_factory
. If relevant, the surface size will be adjusted automatically upon kernel. dictionary generation.integrator (
Integrator
ordict
, default:PathIntegrator()
) – Monte Carlo integration algorithm specification. This parameter can be specified as a dictionary which will be interpreted byintegrator_factory
.
- Fields:
measures (
list
ofMeasure
) – List of measure specifications.default_spectral_set (
BinSet
orWavelengthSet
) – Default spectral set.extra_objects (
dict
) – Dictionary of extra objects to be added to the scene.illumination (
DirectionalIllumination
) – Illumination specification.padding (
int
) – Padding level.surface (
BasicSurface
orNone
) – Surface specification.
Notes
A post-initialisation 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 initialise Mitsuba scene.
- pipeline(measure)#
Return the post-processing pipeline for a given measure.
- process(spp=0, seed_state=None)#
Run simulation and collect raw results.
- Parameters:
- 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 context_init#
Return a single context used for scene initialization.
- property contexts#
Return a list of contexts used for processing.
- property integrator#
Integrator used to solve the radiative transfer equation.
- Type:
- 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_set#
A dictionary mapping measure index to the associated spectral set.