eradiate.scenes.atmosphere.HeterogeneousAtmosphere¶
- class eradiate.scenes.atmosphere.HeterogeneousAtmosphere(id='atmosphere', geometry='plane_parallel', extremum_resolution=(1, 1, 1), molecular_atmosphere=None, particle_layers=NOTHING, zgrid=None, *, use_rrt=True, scale=None, force_majorant=False)¶
Bases:
AbstractHeterogeneousAtmosphereHeterogeneous atmosphere scene element [
heterogeneous].- Parameters:
id (
str, optional, default:"atmosphere") – Identifier of the current scene element.geometry (
SceneGeometryordictorstr, 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.use_rrt (
bool) – If set to true, prescribe the use of residual ratio tracking to estimate transmittance for integrators that allow it. Otherwise, falls back to ratio tracking. Residual ratio tracking generally reduces variance and can improve performance for high optical thickness.scale (
float, optional) – If set, the extinction coefficient is scaled by the corresponding amount during computation.force_majorant (
bool, optional) – If set to true, uses heterogeneous medium, which is compatible with all integrators except PiecewiseVolpathIntegrator. Otherwise, uses a piecewise medium which is compatible with PiecewiseVolPathIntegrator and other integrators. This setting only affects PlaneParallelGeometry, other geometries use heterogeneous mediums.extremum_resolution (
tuple[int,int,int], default:(1,1,1)) – [EXPERIMENTAL] Resolution of the extremum structure. Applies to both plane parallel and spherical shell geometries but the latter only accepts a resolution greater than one along its radial dimension (first dimension). Also note than in plane parallel the dimensions are [x, y, z] and in spherical shell [r, theta, phi]. The default value (1, 1, 1) falls back to a global majorant. In plane parallel, set to (0,0,0) to trigger an adaptive search of the optimalresolution. Note that this is an expensive search that triggers at spectral update.molecular_atmosphere (
MolecularAtmosphereordict, optional, default:None) – Molecular atmosphere. May be specified as a dictionary interpreted byatmosphere_factory; in that case, the"type"parameter may be omitted and will automatically be set to"molecular".particle_layers (
listofParticleLayer, optional, default:[]) – List of particle layers. Elements may be specified as dictionaries interpreted byatmosphere_factory; in that case, thetypeparameter may be omitted and will automatically be set to"particle_layer".zgrid (
ZGrid, optional) – A high-resolution layer altitude mesh on which the radiative properties of the components are interpolated. If unset, a default grid with one layer per 100 m (or 10 layers if the atmosphere object height is less than 100 m) is used.
- Fields:
geometry (
SceneGeometry) – Parameters defining the basic geometry of the scene.use_rrt (
bool) – If set to true, prescribe the use of residual ratio tracking to estimate transmittance for integrators that allow it.scale (
floatorNone) – If set, the extinction coefficient is scaled by the corresponding amount during computation.force_majorant (
bool) – If set to true, uses heterogeneous medium, which is compatible with all integrators except PiecewiseVolpathIntegrator.extremum_resolution (
tuple[int,int,int]) – [EXPERIMENTAL] Resolution of the extremum structure.molecular_atmosphere (
MolecularAtmosphereorNone) – Molecular atmosphere.particle_layers (
listofParticleLayer) – List of particle layers.
- eval_albedo(si, zgrid=None)¶
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 (seezgrid).
- Returns:
quantity– Evaluated spectrum as an array with length equal to the number of layers.
- eval_mfp(ctx)¶
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 (seezgrid).optional_fields (
bool, optional, default:False) – IfTrue, 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)¶
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 (seezgrid).
- Returns:
quantity– Particle layer extinction coefficient.
- eval_sigma_s(si, zgrid=None)¶
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 (seezgrid).
- Returns:
quantity– Particle layer scattering coefficient.
- eval_sigma_t(si, zgrid=None)¶
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 (seezgrid).
- 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 (
{"extinction", "absorption", "scattering"}, optional, default:"extinction") – Interaction type.
- Returns:
quantity– Total atmosphere transmittance.
- 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()¶
Update internal state.
- property absorption_data¶
- Returns:
AbsorptionDatabaseorNone– If relevant, the molecular absorption database associated with this atmosphere.
- property components¶
- Returns:
listofAbstractHeterogeneousAtmosphere– The list of all registered atmospheric components.
- 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] orNone– A dictionary mapping parameter paths, consisting of dot-separated strings, to a corresponding update protocol.
See also
- 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 themitsuba.load_dict()function, orDictParameterinstances which must be rendered.
See also