eradiate.scenes.measure.DistantMeasure#

class eradiate.scenes.measure.DistantMeasure(id='measure', srf=NOTHING, sampler='independent', rfilter='box', spp=1000, spp_allocation=None, spp_min=2, target=None, ray_offset=None, azimuth_convention=None, direction=[0, 0, 1])#

Bases: AbstractDistantMeasure

Single-pixel distant measure scene element [distant]

This scene element records radiance leaving the scene in a single direction defined by its direction parameter. Most users will however find the MultiDistantMeasure class more flexible.

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

  • srf (path-like or str or SpectralResponseFunction or dict, default: DeltaSRF(wavelengths=550.0 * ureg.nm)) – Spectral response function (SRF). If a path is passed, it attempts to load a dataset from that location. If a keyword is passed, e.g. 'sentinel_2a-msi-4', the corresponding dataset is looked up through the file resolver.

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

  • rfilter ({"box", "gaussian", "tent", "mitchell", "catmullrom", "lanczos"}, default: "box") – Reconstruction filter used to scatter samples on sensor pixels. By default, using a box filter is recommended.

  • spp (int, default: 1000) – Sample count target. With the default "weighted" allocation policy (see spp_allocation), it is the number of samples per pixel spent on each output value: every wavelength (mono), every spectral bin (CKD, split across its g-points), or the band as a whole for a BandSRF in CKD mode. With the "uniform" policy, it applies in full to every spectral loop iteration. Samplers other than "independent" may round per-iteration counts up. See srf_spp_distribution() and Sample allocation for details.

  • spp_allocation (SampleAllocation or {"weighted", "uniform"}, optional, default: None) – Policy distributing spp across spectral loop iterations. If unset, the sample_allocation setting (environment variable ERADIATE_SAMPLE_ALLOCATION) is used when processing.

  • spp_min (int, default: 2) – Minimum sample count per spectral loop iteration when the "weighted" allocation policy splits spp (e.g. in CKD mode). Ignored in mono mode and by the "uniform" policy. A value of 1 may leave variance outputs undefined (NaN). Raising it raises the minimum valid spp: in CKD mode with a BandSRF, spp_min times the total number of g-points.

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

  • azimuth_convention (AzimuthConvention or str, optional, default: None) – Azimuth convention. If None, the global default configuration is used (see Configuration).

  • direction (array-like, default: [0, 0, 1]) – A 3-vector defining the direction observed by the sensor, pointing outwards the target.

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

  • srf (SpectralResponseFunction) – Spectral response function (SRF).

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

  • rfilter (str) – Reconstruction filter used to scatter samples on sensor pixels.

  • spp (int) – Sample count target.

  • spp_allocation (SampleAllocation or None) – Policy distributing spp across spectral loop iterations.

  • spp_min (int) – Minimum sample count per spectral loop iteration when the "weighted" allocation policy splits spp (e.g. in CKD mode).

  • target (Target or None) – Target specification.

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

  • azimuth_convention (AzimuthConvention) – Azimuth convention.

  • direction (ndarray) – A 3-vector defining the direction observed by the sensor, pointing outwards the target.

classmethod from_angles(angles, **kwargs)#

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

Parameters:
  • angles (array-like) – A (zenith, azimuth) pair, either as a quantity or a unitless array-like. In the latter case, the default angle units are applied.

  • 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 DistantMeasure constructor.

Returns:

DistantMeasure

dataset_attrs()#

Return metadata to be published as global attributes of the result dataset. Subclasses override this to describe aspects of the measurement that are not captured by data variables and coordinates. Values must be NetCDF-serializable: strings, numbers, or flat lists of numbers.

Returns:

dict – Dataset attributes. Holds by default the sample_allocation policy used to compute mi_results, if the measure was processed.

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

property var#

Post-processing variable field name and metadata.

Type:

str, dict

property viewing_angles#

Viewing angles computed from the direction parameter as (1, 1, 2) array. The last dimension is ordered as (zenith, azimuth).

Type:

quantity