eradiate.scenes.atmosphere.HomogeneousAtmosphere

class eradiate.scenes.atmosphere.HomogeneousAtmosphere(id='atmosphere', geometry='plane_parallel', sigma_s=NOTHING, sigma_a=0.0, phase=NOTHING)[source]

Bases: Atmosphere

Homogeneous atmosphere scene element [homogeneous].

This class builds an atmosphere consisting of a homogeneous medium with customizable collision coefficients and phase function.

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.

  • sigma_s (Spectrum or float, default: AirScatteringCoefficientSpectrum()) – Atmosphere scattering coefficient value.

    Can be initialized with a dictionary processed by spectrum_factory.

  • sigma_a (Spectrum, default: 0.0 km**-1) – Atmosphere absorption coefficient value. Defaults disable absorption.

    Can be initialized with a dictionary processed by spectrum_factory.

  • phase (PhaseFunction, default: RayleighPhaseFunction()) – Scattering phase function.

    Can be initialized with a dictionary processed by phase_function_factory.

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

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

  • sigma_s (Spectrum or float) – Atmosphere scattering coefficient value.

  • sigma_a (Spectrum) – Atmosphere absorption coefficient value.

eval_albedo(si)[source]

Return albedo at given spectral index.

Parameters:

si (SpectralIndex) – Spectral index.

Returns:

quantity – Albedo.

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_sigma_a(si)[source]

Return absorption coefficient at given spectral index.

Parameters:

si (SpectralIndex) – Spectral index.

Returns:

quantity – Absorption coefficient.

eval_sigma_s(si)[source]

Return scattering coefficient at given spectral index.

Parameters:

si (SpectralIndex) – Spectral index.

Returns:

quantity – Scattering coefficient.

eval_sigma_t(si)[source]

Return extinction coefficient at given spectral index.

Parameters:

si (SpectralIndex) – Spectral index.

Returns:

quantity – 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]

Enforce internal state consistency. This method should be called when fields are modified. It is automatically called as a post-init step.

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, SceneParameter] 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 DictParameter instances which must be rendered.

property top_altitude
Returns:

quantity – Atmosphere top altitude.