eradiate.experiments.CanopyAtmosphereExperiment¶
- class eradiate.experiments.CanopyAtmosphereExperiment(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, canopy=None, padding=0, surface=NOTHING)[source]¶
Bases:
EarthObservationExperimentSimulate radiation in a scene with an explicit canopy and atmosphere. This experiment assumes that the surface is plane and accounts for ground unit cell padding.
- Parameters:
measures (
listofMeasureorlistofdictorMeasureordict, default:MultiDistantMeasure()) – List of measure specifications. The passed list may contain dictionaries, which will be interpreted bymeasure_factory. Optionally, a singleMeasureor dictionary specification may be passed and will automatically be wrapped into a list.integrator (
IntegratorordictorAUTO, default:AUTO) – Monte Carlo integration algorithm specification. This parameter can be specified as a dictionary which will be interpreted byintegrator_factory.The integrator defaults toAUTO, which will choose the appropriate integrator depending on the experiment’s configuration.background_spectral_grid (
SpectralGridorAUTO, default:AUTO) – Background spectral grid. If the value isAUTO, the background spectral grid is automatically generated depending on the active mode and internal experiment constraints. Otherwise, the value must be convertible to aSpectralGridinstance.ckd_quad_config (
CKDQuadConfigordict) – CKD quadrature rule generation configuration.extra_objects (
dictorNone, 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 (
DirectionalIlluminationorConstantIlluminationordict, default:DirectionalIllumination()) – Illumination specification. This parameter can be specified as a dictionary which will be interpreted byillumination_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 (
strordictorPlaneParallelGeometry, default:"plane_parallel") – Problem geometry.atmosphere (
AtmosphereordictorNone, optional, default:HomogeneousAtmosphere()) – Atmosphere specification. If set toNone, no atmosphere will be added. This parameter can be specified as a dictionary which will be interpreted byatmosphere_factory.canopy (
CanopyordictorNone, optional, default:None) – Canopy specification. This parameter can be specified as a dictionary which will be interpreted bybiosphere_factory.padding (
int, optional, default:0) – Padding level. The canopy 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 (
SurfaceorBSDFordictorNone, optional, default:BasicSurface(bsdf=LambertianBSDF())) – Surface specification. ASurfaceobject may be passed: its shape specifications will be bypassed and the surface size will be computed automatically upon kernel dictionary generation. ABSDFmay also be passed: it will be wrapped automatically in aBasicSurfaceinstance. If a dictionary is passed, it will be first interpreted as aBSDF; if this fails, it will then be interpreted as aSurface. Finally, this field can be set toNone: in that case, no surface will be added.
- Fields:
measures (
MeasureRegistry) – List of measure specifications.integrator (
IntegratororAUTO) – Monte Carlo integration algorithm specification.ckd_quad_config (
CKDQuadConfig) – CKD quadrature rule generation configuration.extra_objects (
dict) – Dictionary of extra objects to be added to the scene.illumination (
AbstractDirectionalIlluminationorConstantIllumination) – Illumination specification.kdict (
KernelDict) – Additional kernel dictionary template appended to the experiment-controlled template.kpmap (
KernelSceneParameterMap) – Additional scene parameter update map template appended to the experiment-controlled template.geometry (
PlaneParallelGeometry) – Problem geometry.atmosphere (
AtmosphereorNone) – Atmosphere specification.padding (
int) – Padding level.
Warning
Canopy padding is controlled using the padding parameter: do not pad the canopy itself manually.
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 according to the atmosphere (i.e. to [0, 0, toa] where toa is the top-of-atmosphere altitude);
if neither atmosphere nor canopy are defined, the target is set 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, aValueErrorwill be raised during initialization.Currently this experiment is limited to the plane-parallel geometry.
- clear()¶
Clear previous experiment results and reset internal state.
- context_init()¶
Return a single context used for scene initialization.
- Returns:
- contexts(measures=None)¶
Return a list of contexts used for processing.
- init(drop_parameters=True)¶
Generate kernel dictionary and initialize Mitsuba scene.
- Parameters:
drop_parameters (
bool) – IfTrue, 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.
- process(measures=None, spp=0, seed_state=None)¶
Run simulation and collect raw results.
- Parameters:
measures (
intorlistofint, 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’sroot seed stateis 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
SceneElementinstances 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_objectsdictionary to initialize the underlying kernel scene. If you are writing your ownEarthObservationExperimentsubclass, this property is critical.
- property spectral_grids¶
A dictionary mapping measure index to the associated spectral grid.