eradiate.scenes.measure.MultiDistantMeasure#

class eradiate.scenes.measure.MultiDistantMeasure(id='measure', spectral_cfg=_Nothing.NOTHING, sampler='independent', spp=1000, target=None, ray_offset=None, *, direction_layout=_Nothing.NOTHING)[source]#

Bases: DistantMeasure

Multi-distant radiance measure scene element [distant, mdistant, multi_distant].

This scene element creates a measure consisting of an array of radiancemeters positioned at an infinite distance from the scene. In practice, it can be used to compute the radiance leaving a scene at the top of the atmosphere (or canopy if there is no atmosphere). Coupled to appropriate post-processing operations, scene reflectance can be derived from the radiance values it produces.

Class method constructors

aring(zenith, azimuths, **kwargs)

Construct using an azimuth ring viewing direction layout.

grid(zeniths, azimuths, **kwargs)

Construct using a gridded viewing direction layout, defined as the Cartesian product of zenith and azimuth arrays.

hplane(zeniths, azimuth, **kwargs)

Construct using a hemisphere plane cut viewing direction layout.

from_angles(angles, **kwargs)

Construct using a direction layout defined by explicit (zenith, azimuth) pairs.

from_directions(directions, **kwargs)

Construct using a direction layout defined by explicit direction vectors.

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

  • spectral_cfg (MeasureSpectralConfig or dict, default: MeasureSpectralConfig.new()) – Spectral configuration of the measure. Must match the current operational mode. Can be passed as a dictionary, which will be interpreted by MeasureSpectralConfig.from_dict().

  • sampler ({"independent", "stratified", "multijitter", "orthogonal", "ldsampler"}, default: "independent") – Mitsuba sampler used to generate pseudo-random number sequences.

  • spp (int, default: 1000) – Number of samples per pixel.

  • target (Target or dict or array-like, optional) – Target specification. The target can be specified using an array-like with 3 elements (which will be converted to a TargetPoint) or a dictionary interpreted by Target.convert(). If set to None (not recommended), the default target point selection method is used: rays will not target a particular region of the scene.

  • ray_offset (float or quantity, optional, default: None) – Manually control the distance between the target and ray origins. If unset, ray origins are positioned outside of the scene and this measure is rigorously distant.

  • direction_layout (dict or array-like or Layout, optional, default: DirectionLayout(directions=[0, 0, 1])) – A viewing direction layout. Specification through a dictionary or arrays, as documented by Layout.convert(), is also possible. The constructor methods provide a convenient interface to configure this parameter automatically.

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

  • spectral_cfg (MeasureSpectralConfig) – Spectral configuration of the measure.

  • sampler (str) – Mitsuba sampler used to generate pseudo-random number sequences.

  • spp (int) – Number of samples per pixel.

  • target (Target or None) – Target specification.

  • ray_offset (quantity or None) – Manually control the distance between the target and ray origins.

  • direction_layout (Layout) – A viewing direction layout.

Notes

  • Setting the target parameter is required to get meaningful results. Experiment classes should take care of setting it appropriately.

classmethod aring(zenith, azimuths, **kwargs)[source]#

Construct using an azimuth ring viewing direction layout.

Parameters:
  • zenith (float or quantity) – Azimuth ring zenith value. Unitless values are converted to ucc['angle'].

  • azimuths (array-like) – List of azimuth values. Unitless values are converted to ucc['angle'].

  • azimuth_convention (AzimuthConvention or str, optional) – The azimuth convention applying to the viewing direction layout. If unset, the global default convention is used.

  • **kwargs – Remaining keyword arguments are forwarded to the MultiDistantMeasure constructor.

Returns:

MultiDistantMeasure

classmethod from_angles(angles, **kwargs)[source]#

Construct using a direction layout defined by explicit (zenith, azimuth) pairs.

Parameters:
  • angles (array-like) – A sequence of (zenith, azimuth), interpreted as (N, 2)-shaped array.

  • azimuth_convention (AzimuthConvention or str, optional) – The azimuth convention applying to the viewing direction layout. If unset, the global default convention is used.

  • **kwargs – Remaining keyword arguments are forwarded to the MultiDistantMeasure constructor.

Returns:

MultiDistantMeasure

classmethod from_directions(directions, **kwargs)[source]#

Construct using a direction layout defined by explicit direction vectors.

Parameters:
  • directions (array-like) – A sequence of direction vectors, interpreted as (N, 3)-shaped array.

  • azimuth_convention (AzimuthConvention or str, optional) – The azimuth convention applying to the viewing direction layout. If unset, the global default convention is used.

  • **kwargs – Remaining keyword arguments are forwarded to the MultiDistantMeasure constructor.

Returns:

MultiDistantMeasure

Warning

Viewing directions are defined pointing outwards the target location.

classmethod from_viewing_angles(zeniths, azimuths, auto_hplane=True, **kwargs)[source]#

Construct a MultiDistantMeasure using viewing angles instead of raw directions.

Deprecated since version 0.22.6: This will be removed in 0.23.1. Transition to using the direction layout or other class method constructors.

Parameters:
  • zeniths (array-like) – List of zenith values (can be a quantity). Scalar values are broadcast to the same shape as azimuths. Unitless values are converted to ucc['angle'].

  • azimuths (array-like) – List of azimuth values (can be a quantity). Scalar values are broadcast to the same shape as zeniths. Unitless values are converted to ucc['angle'].

  • auto_hplane (bool, optional) – If True, passing a scalar as azimuths will automatically set the measure’s hplane parameter, unless an hplane keyword argument is also passed.

  • **kwargs – Any keyword argument (except direction) to be forwarded to MultiDistantMeasure(). The hplane keyword argument takes precedence over auto_hplane.

Returns:

MultiDistantMeasure

classmethod grid(zeniths, azimuths, **kwargs)[source]#

Construct using a gridded viewing direction layout, defined as the Cartesian product of zenith and azimuth arrays.

Parameters:
  • azimuths (array-like) – List of azimuth values.

  • zeniths (array-like) – List of zenith values.

  • azimuth_convention (AzimuthConvention or str, optional) – The azimuth convention applying to the viewing direction layout. If unset, the global default convention is used.

  • **kwargs – Remaining keyword arguments are forwarded to the MultiDistantMeasure constructor.

Returns:

MultiDistantMeasure

classmethod hplane(zeniths, azimuth, **kwargs)[source]#

Construct using a hemisphere plane cut viewing direction layout.

Parameters:
  • zeniths (array-like) – List of zenith values. Negative values are mapped to the azimuth + 180° half-plane. Unitless values are converted to ucc['angle'].

  • azimuth (float or quantity) – Hemisphere plane cut azimuth value. Unitless values are converted to ucc['angle'].

  • azimuth_convention (AzimuthConvention or str, optional) – The azimuth convention applying to the viewing direction layout. If unset, the global default convention is used.

  • **kwargs – Remaining keyword arguments are forwarded to the MultiDistantMeasure constructor.

Returns:

MultiDistantMeasure

is_distant()#

Return True iff measure records radiometric quantities at infinite distance.

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()#

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

property film_resolution#

Getter for film resolution as a (int, int) pair.

Type:

tuple

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 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 var#

Post-processing variable field name and metadata.

Type:

str, dict

property viewing_angles#

Viewing angles computed from stored directions as a (N, 1, 2) array, where N is the number of directions. The last dimension is ordered as (zenith, azimuth).

Type:

quantity