eradiate.scenes.atmosphere.MolecularAtmosphere#

class eradiate.scenes.atmosphere.MolecularAtmosphere(id='atmosphere', geometry=None, scale=None, thermoprops=_Nothing.NOTHING, phase=_Nothing.NOTHING, has_absorption=True, has_scattering=True, absorption_data_sets=None)[source]#

Bases: eradiate.scenes.atmosphere._core.AbstractHeterogeneousAtmosphere

Molecular atmosphere scene element [molecular].

Class method constructors

afgl_1986([model, levels, concentrations])

Molecular atmosphere based on the AFGL (1986) atmospheric thermophysical properties profiles [ACC+86] (CKD mode only).

ussa_1976([levels, concentrations])

Molecular atmosphere based on the US Standard Atmosphere (1976) model [NNU76] (monochromatic mode only).

Parameters
  • id (str, optional, default: "atmosphere") – User-defined object identifier.

  • geometry (AtmosphereGeometry or dict or str, 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.

  • thermoprops (Dataset, default: us76.make_profile()) – Thermophysical properties.

  • phase (PhaseFunction or dict, default: RayleighPhaseFunction()) – Phase function.

  • has_absorption (bool, default: True) – Absorption switch. If True, the absorption coefficient is computed. Else, the absorption coefficient is not computed and instead set to zero.

  • has_scattering (bool, default: True) – Scattering switch. If True, the scattering coefficient is computed. Else, the scattering coefficient is not computed and instead set to zero.

  • absorption_data_sets (dict) – Mapping of species and absorption data set files paths. If None, the default absorption data sets are used to compute the absorption coefficient. If not None, the absorption data set files whose paths are provided in the mapping will be used to compute the absorption coefficient. If the mapping does not include all species from the atmospheric thermophysical profile, the default data sets will be used to compute the absorption coefficient of the corresponding species.

Fields
  • id (str or None) – User-defined object identifier.

  • geometry (AtmosphereGeometry or None) – Parameters defining the basic geometry of the atmosphere.

  • scale (float or None) – If set, the extinction coefficient is scaled by the corresponding amount during computation.

  • phase (PhaseFunction) – Phase function.

  • has_absorption (bool) – Absorption switch.

  • has_scattering (bool) – Scattering switch.

  • absorption_data_sets (dict) – Mapping of species and absorption data set files paths.

classmethod afgl_1986(model='us_standard', levels=None, concentrations=None, **kwargs)[source]#

Molecular atmosphere based on the AFGL (1986) atmospheric thermophysical properties profiles [ACC+86] (CKD mode only).

Parameters
  • model ({"us_standard", "tropical", "midlatitude_summer", "midlatitude_winter", "subarctic_summer", "subarctic_winter"}, optional, default: "us_standard") – AFGL (1986) model identifier.

  • levels (quantity) – Altitude levels.

  • concentrations (dict) – Molecular concentrations as a {str: quantity} mapping. This dictionary is interpreted by pinttr.util.ensure_units(), which allows for passing units as strings.

  • **kwargs – Keyword arguments passed to the MolecularAtmosphere constructor.

Returns

MolecularAtmosphere – AFGL (1986) molecular atmosphere.

Notes

[ACC+86] defines six models, listed in the table below.

AFGL (1986) atmospheric thermophysical properties profiles models#

Model number

Model identifier

Model name

1

tropical

Tropic (15N Annual Average)

2

midlatitude_summer

Mid-Latitude Summer (45N July)

3

midlatitude_winter

Mid-Latitude Winter (45N Jan)

4

subarctic_summer

Sub-Arctic Summer (60N July)

5

subarctic_winter

Sub-Arctic Winter (60N Jan)

6

us_standard

U.S. Standard (1976)

Attention

The original altitude mesh specified by [ACC+86] is a piecewise regular altitude mesh with an altitude step of 1 km from 0 to 25 km, 2.5 km from 25 km to 50 km and 5 km from 50 km to 120 km. Since the Eradiate kernel only supports regular altitude mesh, the original atmospheric thermophysical properties profiles were interpolated on the regular altitude mesh with an altitude step of 1 km from 0 to 120 km.

Although the altitude meshes of the interpolated [ACC+86] profiles is fixed, this class lets you define a custom altitude mesh (regular or irregular).

All six models include the following six absorbing molecular species: H2O, CO2, O3, N2O, CO, CH4 and O2. The concentrations of these species in the atmosphere is fixed by [ACC+86]. However, this class allows you to rescale the concentrations of each individual molecular species to custom concentration values. Custom concentrations can be provided in different units.

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 this atmospheric model.

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) – If True, export optional fields, not required for scene construction but useful for analysis and debugging.

Returns

Dataset – 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 or SphereShape) – Computed shape used as the medium stencil for kernel dictionary generation.

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 to 10 / self.eval_mfp(ctx) if ` self.geometry.width` is set to AUTO, self.geometry.width otherwise.

Raises

ValueError – When a geometry other than PlaneParallelGeometry is used.

update()[source]#

Update internal state.

classmethod ussa_1976(levels=None, concentrations=None, **kwargs)[source]#

Molecular atmosphere based on the US Standard Atmosphere (1976) model [NNU76] (monochromatic mode only).

Parameters
  • levels (quantity, optional) – Altitude levels. If None, defaults to [0, 1, …, 99, 100] km.

  • concentrations (dict) – Molecules concentrations as a {str: quantity} mapping.

  • **kwargs – Keyword arguments passed to the MolecularAtmosphere constructor.

Returns

MolecularAtmosphere – U.S. Standard Atmosphere (1976) molecular atmosphere object.

property bottom#

Atmosphere bottom altitude.

Type

pint.Quantity

property height#

Atmosphere height.

Type

pint.Quantity

property id_medium#

Kernel dictionary key of the atmosphere’s medium object.

Type

str

property id_phase#

Kernel dictionary key of the atmosphere’s phase function object.

Type

str

property id_shape#

Kernel dictionary key of the atmosphere’s shape object.

Type

str

property top#

Atmosphere top altitude.

Type

pint.Quantity