eradiate.experiments.AtmosphereExperiment
eradiate.experiments.AtmosphereExperiment#
- class eradiate.experiments.AtmosphereExperiment(measures=_Nothing.NOTHING, illumination=_Nothing.NOTHING, geometry='plane_parallel', atmosphere=_Nothing.NOTHING, surface=_Nothing.NOTHING, dem=None, integrator=_Nothing.NOTHING)[source]#
Bases:
eradiate.experiments._core.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
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.illumination (
DirectionalIllumination
orConstantIllumination
ordict
, default:DirectionalIllumination()
) – Illumination specification. This parameter can be specified as a dictionary which will be interpreted byillumination_factory
.geometry (
str
ordict
orAtmosphereGeometry
, default:"plane_parallel"
) – Problem geometry.atmosphere (
Atmosphere
ordict
orNone
, 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
.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
.dem (
DEMSurface
ordict
, optional, default:None
) – Digital elevation model (DEM) specification. If set toNone
, no DEM will be added. This parameter can be specified as a dictionary which will be interpreted bysurface_factory
integrator (
Integrator
ordict
, default:VolPathIntegrator()
) – 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.illumination (
DirectionalIllumination
orConstantIllumination
) – Illumination specification.geometry (
PlaneParallelGeometry
orSphericalShellGeometry
) – Problem geometry.atmosphere (
Atmosphere
orNone
) – Atmosphere specification.surface (
BasicSurface
orNone
) – Surface specification.dem (
DEMSurface
orNone
) – Digital elevation model (DEM) specification.
Notes
A post-initialisation step will constrain the measure setup if a distant measure is used and no target is defined:
if an atmosphere is defined, the target will be set to [0, 0, TOA];
if no atmosphere is defined, the target will be 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, aValueError
will be raised during initialisation.
- classmethod from_dict(d)#
Instantiate from a dictionary. The default implementation raises an exception.
- Parameters
d (
dict
) – Dictionary to be converted to anExperiment
.- Returns
- kernel_dict(ctx)[source]#
Return a dictionary suitable for kernel scene configuration.
- Parameters
ctx (
KernelDictContext
) – A context data structure containing parameters relevant for kernel dictionary generation.- Returns
KernelDict
– Kernel dictionary which can be loaded as a Mitsuba object.
- kernel_dicts(measure)#
A generator which returns kernel dictionaries (and the associated context) relevant to a given measure.
- Parameters
measure (
Measure
orint
) – Measure for which kernel dictionaries are to be generated. Alternatively, the index in theself.measure
list can be passed.- Yields
kernel_dict (
KernelDict
) – Generated kernel dictionary.ctx (
KernelDictContext
) – Context used to generatekernel_dict
.
- pipeline(*measures)#
Request post-processing pipeline for a given measure.
- Parameters
*measures (
Measure
orint
) – One or several measures for which to get a post-processing pipeline. If integer values are passed, they are used to query the measure list.- Returns
pipelines (
Pipeline
ortuple
ofPipeline
) – If a single measure is passed, a singlePipeline
instance is returned; if multiple measures are passed, a tuple of pipelines is returned.
- postprocess(*measures, pipeline_kwargs=None)#
Post-process raw results stored in a measure’s
results
field. This requires a successful execution ofprocess()
. Post-processed results are stored inself.results
.- Parameters
*measures (
Measure
orint
) – One or several measures for which to perform post-processing. Alternatively, indexes in the measure array can be passed. If no value is passed, all measures are processed.pipeline_kwargs (
dict
, optional) – A dictionary of pipeline keyword arguments forwarded toPipeline.transform()
.
- Raises
ValueError – If
measure.results
isNone
, i.e. ifprocess()
has not been successfully run.
See also
- process(*measures, seed_state=None)#
Run simulation on the configured scene. Raw results yielded by the runner function are stored in
measure.results
.- Parameters
*measures (
Measure
orint
) – One or several measures for which to compute radiative transfer. Alternatively, indexes in the measure array can be passed. If no value is passed, all measures are processed.seed_state (
SeedState
, optional) – A RNG seed state used to generate the seeds used by Mitsuba’s random number generator. By default, Eradiate’sroot_seed_state
is used.
See also
- 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.