eradiate.scenes.atmosphere.MolecularAtmosphere#

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

Bases: AbstractHeterogeneousAtmosphere

Molecular atmosphere scene element [molecular].

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. Note if the atmosphere is used in a simulation, the experiment has all control over the atmosphere’s geometry and is going to set it. Therefore, in such a case it is best to define the geometry at the experiment level. When the atmosphere is used standalone, care must be taken to ensure that the geometry is consistent with the vertical extent of the atmosphere.

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

  • absorption_data (Dataset or list of Dataset or str or path-like or tuple[str, quantity]) – Absorption coefficient data. If a file path, the absorption coefficient is loaded from the specified file (must be a NetCDF file). If a tuple, the first element is the dataset codename and thesecond is the desired working wavelength range.

  • thermoprops (Dataset or path-like or dict) – Thermophysical property dataset. If a path is passed, Eradiate will look it up and load it. If a dictionary is passed, it will be passed as keyword argument to joseki.make(). The default is joseki.make(identifier="afgl_1986-us_standard",  z=np.linspace(0.0, 120.0, 121) * ureg.km). See the Joseki docs for details.

  • 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 set to zero.

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

  • error_handler_config (dict, default: DEFAULT_HANDLER_CONFIG) – Error handler configuration for absorption data interpolation.

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.

  • absorption_data (dict[tuple[quantity, quantity], Dataset]) – Absorption coefficient data.

  • has_absorption (bool) – Absorption switch.

  • has_scattering (bool) – Scattering switch.

  • error_handler_config (dict) – Error handler configuration for absorption data interpolation.

Notes

This is commonly referred to as a clear-sky atmosphere, namely the atmosphere is free of clouds, aerosols or any other type of liquid or solid particles in suspension.

It describes a gaseous mixture (air) whose thermophysical properties, namely pressure, temperature and constituent mole fractions, are allowed to vary with altitude (see the thermoprops attribute).

The corresponding radiative properties are computed with this thermophysical profile as input.

Special care must be taken that the absorption data is able to accomodate the specified thermophysical profile, especially along the constituent mole fractions axes (see also error_handler_config). Note that the absoprtion data is able to support one spectral mode at a time. As a result, the Eradiate mode must be selected before instantiating this class, and the relevant absorption data must be provided.

The Rayleigh scattering theory is used to compute the air volume scattering coefficient.

The scattering phase function defaults to the Rayleigh scattering phase function but can be set to other values.

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, **kwargs)[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.

eval_transmittance(si, interaction='extinction')#

Evaluate the atmosphere’s transmittance with respect to specific interaction.

Parameters:
  • si (SpectralIndex) – Spectral index.

  • interaction (str, optional, default: "extinction") – Interaction type. One of "extinction", "absorption", "scattering".

Returns:

quantity – Total atmosphere transmittance.

eval_transmittance_accross_spectral_set(interaction='extinction', quad_spec=None)#

Evaluate the atmosphere’s transmittance with respect to extinction accross the spectral set emitted by the atmosphere.

Parameters:

quad_spec (QuadSpec, optional) – Quadrature specifications.

Returns:

DataArray – Atmosphere’s transmittance with respect to extinction tabulated against the spectral coordinate.

spectral_set(quad_spec=None)[source]#

The spectral set emitted by the atmosphere (optional).

Notes

Typically, absorbing molecular atmosphere are characterized 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 the highest priority when creating the experiment’s spectral set.

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.

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 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.