eradiate.scenes.atmosphere.Atmosphere#

class eradiate.scenes.atmosphere.Atmosphere(id='atmosphere', geometry=None)[source]#

Bases: eradiate.scenes.core.SceneElement, abc.ABC

An abstract base class defining common facilities for all atmospheres.

An atmosphere consists of a kernel medium (with a phase function) attached to a kernel shape.

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.

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

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

abstract 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_shape(ctx)[source]#

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)[source]#

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.

abstract kernel_media(ctx)[source]#

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.

abstract 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)[source]#

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)[source]#

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.

abstract 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

abstract property top#

Atmosphere top altitude.

Type

pint.Quantity