eradiate.scenes.atmosphere.MolecularAtmosphere#

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

Bases: 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 [Anderson et al., 1986] (CKD mode only).

ussa_1976([levels, concentrations, ...])

Molecular atmosphere based on the US Standard Atmosphere (1976) model [NASA et al., 1976] (monochromatic mode only).

Parameters:
  • id (str, optional, default: "atmosphere") – Identifier of the current scene element.

  • geometry (SceneGeometry or dict or str, optional, default: "plane_parallel") – Parameters defining the basic geometry of the scene.

  • scale (float, optional) – 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_dataset (PathLike or Dataset, default: None) – Absorption coefficient dataset. If None, the absorption coefficient is set to zero.

Fields:
  • id (str or None) – Identifier of the current scene element.

  • geometry (SceneGeometry) – Parameters defining the basic geometry of the scene.

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

  • has_absorption (bool) – Absorption switch.

  • has_scattering (bool) – Scattering switch.

  • absorption_dataset (Dataset) – Absorption coefficient dataset.

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

Molecular atmosphere based on the AFGL (1986) atmospheric thermophysical properties profiles [Anderson et al., 1986] (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.

  • binset (str) – Wavelength bin set identifier. Either "10nm" or "1nm".

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

Returns:

MolecularAtmosphere – AFGL (1986) molecular atmosphere.

Notes

[Anderson et al., 1986] 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 [Anderson et al., 1986] 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 [Anderson et al., 1986] 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 [Anderson et al., 1986]. 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_albedo(si, zgrid=None)[source]#

Evaluate albedo spectrum based on a spectral context. This method dispatches evaluation to specialized methods depending on the active mode.

Parameters:
  • si (SpectralIndex) – Spectral index.

  • zgrid (ZGrid, optional) – Altitude grid on which evaluation is performed. If unset, an instance-specific default is used (see zgrid).

Returns:

quantity – Evaluated spectrum as an array with length equal to the number of layers.

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 (KernelContext) – A context data structure containing parameters relevant for kernel dictionary generation.

Returns:

mfp (quantity) – Mean free path estimate.

eval_radprops(si, zgrid=None, optional_fields=False)#

Evaluate the extinction coefficients and albedo profiles.

Parameters:
  • si (SpectralIndex) – Spectral index.

  • zgrid (ZGrid, optional) – Altitude grid on which evaluation is performed. If unset, an instance-specific default is used (see zgrid).

  • optional_fields (bool, optional, default: False) – If True, also output the absorption and scattering coefficients, not required for scene setup but useful for analysis and debugging.

Returns:

Dataset – A dataset with the following variables:

  • sigma_t: extinction coefficient;

  • albedo: albedo;

  • sigma_a: absorption coefficient (optional);

  • sigma_s: scattering coefficient (optional).

and coordinates:

  • z: altitude.

eval_sigma_a(si, zgrid=None)[source]#

Evaluate absorption coefficient given a spectral context.

Parameters:
  • si (SpectralIndex) – Spectral index.

  • zgrid (ZGrid, optional) – Altitude grid on which evaluation is performed. If unset, an instance-specific default is used (see zgrid).

Returns:

quantity – Particle layer extinction coefficient.

eval_sigma_s(si, zgrid=None)[source]#

Evaluate scattering coefficient given a spectral context.

Parameters:
  • si (SpectralIndex) – Spectral index.

  • zgrid (ZGrid, optional) – Altitude grid on which evaluation is performed. If unset, an instance-specific default is used (see zgrid).

Returns:

quantity – Particle layer scattering coefficient.

eval_sigma_t(si, zgrid=None)[source]#

Evaluate extinction coefficient given a spectral context.

Parameters:
  • si (SpectralIndex) – Spectral index.

  • zgrid (ZGrid, optional) – Altitude grid on which evaluation is performed. If unset, an instance-specific default is used (see zgrid).

Returns:

quantity – Particle layer extinction coefficient.

traverse(callback)#

Traverse this scene element and collect kernel dictionary template and parameter update map contributions.

Parameters:

callback (SceneTraversal) – Callback data structure storing the collected data.

update()[source]#

Update internal state.

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

Molecular atmosphere based on the US Standard Atmosphere (1976) model [NASA et al., 1976] (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.

  • wavelength_range (quantity) – Wavelength range wherein the atmosphere radiative properties are expected to be computed. This information is used to select the monochromatic absorption dataset(s) to open. If None, defaults to [545.0, 555.0] nm.

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

Returns:

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

property bottom_altitude#
Returns:

quantity – Atmosphere bottom altitude.

property height#
Returns:

quantity – Atmosphere height.

property medium_id#
Returns:

str – ID of the medium associated with the atmosphere in the Mitsuba scene tree.

property objects#

Map of child objects associated with this scene element.

Returns:

dict – A dictionary mapping object names to a corresponding object to be inserted in the Eradiate scene graph.

property params#
Returns:

dict[str, UpdateParameter] or None – A dictionary mapping parameter paths, consisting of dot-separated strings, to a corresponding update protocol.

property phase#
Returns:

PhaseFunction – Phase function associated with the atmosphere.

property phase_id#
Returns:

str – ID of the phase function associated with the atmosphere in the Mitsuba scene tree.

property shape#
Returns:

Shape – Shape associated with this atmosphere, based on the scene geometry.

property shape_id#
Returns:

str – ID of the shape associated with the atmosphere in the Mitsuba scene tree.

property spectral_set#

The spectral set emitted by the atmosphere (optional).

Notes

Typically, absorbing molecular atmosphere are characterised by an absorption dataset which tabulates the absorption coefficient over some spectral set, e.g. wavelengths, CKD bin, etc. This property returns the spectral set associated with the absorption dataset. In experiments, the spectral set emitted by the atmosphere is given highest priority, when creating the experiment’s spectral set.

property template#

Kernel dictionary template contents associated with this scene element.

Returns:

dict – A flat dictionary mapping dot-separated strings describing the path of an item in the nested scene dictionary to values. Values may be objects which can be directly used by the mitsuba.load_dict() function, or InitParameter instances which must be rendered.

property top_altitude#
Returns:

quantity – Atmosphere top altitude.