eradiate.scenes.measure.DistantFluxMeasure#
- class eradiate.scenes.measure.DistantFluxMeasure(id='measure', srf=NOTHING, sampler='independent', rfilter='box', spp=1000, target=None, ray_offset=None, azimuth_convention=None, direction=[0, 0, 1], film_resolution=(32, 32))[source]#
Bases:
AbstractDistantMeasure
Distant radiosity measure scene element [
distantflux
,distant_flux
].This measure records the [spectral] radiosity (in W/m²[/nm]) at an infinite distance in a hemisphere defined by its
direction
parameter.When used with a backward tracing algorithm, rays traced by the sensor target a shape which can be controlled through the
target
parameter. This feature is useful if one wants to compute the average flux leaving a particular subset of the scene.- Parameters:
id (
str
, optional, default:"measure"
) – Identifier of the current scene element.srf (
Path-like
orstr
orSpectralResponseFunction
ordict
, 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'
it tries to serve the corresponding dataset from the Eradiate data store.sampler (
{"independent", "stratified", "multijitter", "orthogonal", "ldsampler"}
, default:"independent"
) – Mitsuba sampler used to generate pseudo-random number sequences.rfilter (
{"box", "gaussian"}
, default:"box"
) – Reconstruction filter used to scatter samples on sensor pixels. By default, using a box filter is recommended.spp (
int
, default:1000
) – Number of samples per pixel.target (
Target
ordict
or array-like, optional) – Target specification. The target can be specified using an array-like with 3 elements (which will be converted to aTargetPoint
) or a dictionary interpreted byTarget.convert()
. If set toNone
(not recommended), the default target point selection method is used: rays will not target a particular region of the scene.ray_offset (
float
orquantity
, 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
orstr
, optional, default:None
) – Azimuth convention. IfNone
, the global default configuration is used (see Configuration).direction (array-like, default:
[0
,0
,1]
) – A 3-vector defining the normal to the reference surface for which the exitant flux density is computed.film_resolution (array-like, default:
(32
,32)
) – Film resolution as a (width, height) 2-tuple.
- Fields:
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
) – Number of samples per pixel.ray_offset (
quantity
orNone
) – Manually control the distance between the target and ray origins.azimuth_convention (
AzimuthConvention
) – Azimuth convention.direction (array-like) – A 3-vector defining the normal to the reference surface for which the exitant flux density is computed.
Notes
Setting the
target
parameter is required to get meaningful results. Experiment classes should take care of setting it appropriately.The film resolution can be adjusted to manually stratify film sampling and reduce variance in results. The default 32x32 is generally a good choice, but scenes with sharp reflection lobes may benefit from higher values.
- 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 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
] orNone
– A dictionary mapping parameter paths, consisting of dot-separated strings, to a corresponding update protocol.
See also
- 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, orInitParameter
instances which must be rendered.
See also
- property viewing_angles#
Viewing angles computed from stored film coordinates as a (width, height, 2) array. The last dimension is ordered as (zenith, azimuth).
- Type:
quantity