eradiate.scenes.atmosphere.ParticleLayer
eradiate.scenes.atmosphere.ParticleLayer#
- class eradiate.scenes.atmosphere.ParticleLayer(id='atmosphere', geometry=None, scale=None, bottom=<Quantity(0.0, 'kilometer')>, top=<Quantity(1.0, 'kilometer')>, distribution='uniform', w_ref=<Quantity(550, 'nanometer')>, tau_ref=<Quantity(0.2, 'dimensionless')>, n_layers=16, dataset='spectra/particles/govaerts_2021-continental.nc')[source]#
Bases:
eradiate.scenes.atmosphere._core.AbstractHeterogeneousAtmosphere
Particle layer scene element [
particle_layer
].The particle layer has a vertical extension specified by a bottom altitude (set by
bottom
) and a top altitude (set bytop
). Inside the layer, the particles number is distributed according to a distribution (set bydistribution
). Seeparticle_dist
for the available distribution types and corresponding parameters. The particle layer is itself divided into a number of (sub-)layers (n_layers
) to allow to describe the variations of the particles number with altitude. The particle density in the layer is adjusted so that the particle layer’s optical thickness at a specified reference wavelength (w_ref
) meets a specified value (tau_ref
). The particles radiative properties are specified by a data set (dataset
).- Parameters
id (
str
, optional, default:"atmosphere"
) – User-defined object identifier.geometry (
AtmosphereGeometry
ordict
orstr
, optional, default:None
) – Parameters defining the basic geometry of the atmosphere.scale (
float
, optional, default:None
) – If set, the extinction coefficient is scaled by the corresponding amount during computation.bottom (
float
orquantity
, default:0 km
) – Bottom altitude of the particle layer.Unit-enabled field (default: ucc[length])
top (
float
orquantity
, default:1 km.
) – Top altitude of the particle layer.Unit-enabled field (default: ucc[length]).
distribution (
ParticleDistribution
ordict
or{"uniform", "gaussian", "exponential"}
, optional, default:"uniform"
) – Particle distribution. Simple defaults can be set using a string:"uniform"
(resp."gaussian"
,"exponential"
) is converted toUniformParticleDistribution()
(resp.GaussianParticleDistribution()
,ExponentialParticleDistribution()
).w_ref (
quantity
orfloat
, default:550.0
) – Reference wavelength at which the extinction optical thickness is specified.Unit-enabled field (default: ucc[length]).
tau_ref (
quantity
orfloat
, default:0.2
) – Extinction optical thickness at the reference wavelength.Unit-enabled field (default: ucc[dimensionless]).
n_layers (
int
, default:16
) – Number of layers in which the particle layer is discretised.dataset (
Dataset
or path-like, optional, default:spectra/particles/govaerts_2021-continental.nc
) – Particle radiative property data set. If a path is passed, the converter tries to open the corresponding file on the hard drive; if this fails, it tries to load a resource from the data store. Refer to the data guide for the format requirements of this data set.
- Fields
geometry (
AtmosphereGeometry
orNone
) – Parameters defining the basic geometry of the atmosphere.scale (
float
orNone
) – If set, the extinction coefficient is scaled by the corresponding amount during computation.distribution (
ParticleDistribution
) – Particle distribution.w_ref (
quantity
) – Reference wavelength at which the extinction optical thickness is specified.tau_ref (
quantity
) – Extinction optical thickness at the reference wavelength.n_layers (
int
) – Number of layers in which the particle layer is discretised.dataset (
Dataset
) – Particle radiative property data set.
- eval_albedo(spectral_ctx)[source]#
Evaluate albedo spectrum based on a spectral context. This method dispatches evaluation to specialised methods depending on the active mode.
- Parameters
spectral_ctx (
SpectralContext
) – A spectral context data structure containing relevant spectral parameters (e.g. wavelength in monochromatic mode, bin and quadrature point index in CKD mode).- Returns
quantity
– Evaluated spectrum as an array with length equal to the number of layers.
- eval_fractions()[source]#
Compute the particle number fraction in the particle layer.
- Returns
ndarray
– Particle fractions.
- eval_mfp(ctx)[source]#
Compute a typical scattering mean free path. This rough estimate can be used e.g. to compute a distance guaranteeing that the medium can be considered optically thick.
- Parameters
ctx (
KernelDictContext
) – A context data structure containing parameters relevant for kernel dictionary generation.- Returns
mfp (
quantity
) – Mean free path estimate.
- eval_radprops(spectral_ctx, optional_fields=False)[source]#
Return a dataset that holds the radiative properties profile of the particle layer.
- Parameters
spectral_ctx (
SpectralContext
) – A spectral context data structure containing relevant spectral parameters (e.g. wavelength in monochromatic mode, bin and quadrature point index in CKD mode).optional_fields (
bool
, optional, default:False
) – IfTrue
, extra the optionalsigma_a
andsigma_s
fields, not required for scene construction but useful for analysis and debugging.
- Returns
Dataset
– Particle layer radiative properties profile dataset.
- eval_shape(ctx)#
Return the shape enclosing the atmosphere’s volume.
- Parameters
ctx (
KernelDictContext
) – A context data structure containing parameters relevant for kernel dictionary generation.- Returns
shape (
CuboidShape
orSphereShape
) – Computed shape used as the medium stencil for kernel dictionary generation.
- eval_sigma_a(spectral_ctx)[source]#
Evaluate absorption coefficient given a spectral context.
- Parameters
spectral_ctx (
SpectralContext
) – A spectral context data structure containing relevant spectral parameters (e.g. wavelength in monochromatic mode, bin and quadrature point index in CKD mode).- Returns
quantity
– Particle layer extinction coefficient.
- eval_sigma_s(spectral_ctx)[source]#
Evaluate scattering coefficient given a spectral context.
- Parameters
spectral_ctx (
SpectralContext
) – A spectral context data structure containing relevant spectral parameters (e.g. wavelength in monochromatic mode, bin and quadrature point index in CKD mode).- Returns
quantity
– Particle layer scattering coefficient.
- eval_sigma_t(spectral_ctx)[source]#
Evaluate extinction coefficient given a spectral context.
- Parameters
spectral_ctx (
SpectralContext
) – A spectral context data structure containing relevant spectral parameters (e.g. wavelength in monochromatic mode, bin and quadrature point index in CKD mode).- Returns
quantity
– Particle layer extinction coefficient.
- kernel_dict(ctx)#
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_media(ctx)#
Return medium plugin specifications only.
- Parameters
ctx (
KernelDictContext
) – A context data structure containing parameters relevant for kernel dictionary generation.- Returns
kernel_dict (
KernelDict
) – A kernel dictionary containing all the media attached to the atmosphere.
- kernel_phase(ctx)[source]#
Return phase function plugin specifications only.
- Parameters
ctx (
KernelDictContext
) – A context data structure containing parameters relevant for kernel dictionary generation.- Returns
kernel_dict (
KernelDict
) – A kernel dictionary containing all the phase functions attached to the atmosphere.
- kernel_shapes(ctx)#
Return shape plugin specifications only.
- Parameters
ctx (
KernelDictContext
) – A context data structure containing parameters relevant for kernel dictionary generation.- Returns
kernel_dict (
KernelDict
) – A kernel dictionary containing all the shapes attached to the atmosphere.
- kernel_width_plane_parallel(ctx)#
When using a plane parallel geometry, compute the size of the cuboid shape enclosing the participating medium representing the atmosphere.
- Parameters
ctx (
KernelDictContext
) – A context data structure containing parameters relevant for kernel dictionary generation.- Returns
width (
quantity
) – Computed cuboid width, eval to10 / self.eval_mfp(ctx)
if ` self.geometry.width` is set toAUTO
,self.geometry.width
otherwise.- Raises
ValueError – When a geometry other than
PlaneParallelGeometry
is used.
- property bottom#
Atmosphere bottom altitude.
- Type
- property height#
Atmosphere height.
- Type
- property top#
Atmosphere top altitude.
- Type