eradiate.scenes.phase.ParticlePhaseFunction¶
- class eradiate.scenes.phase.ParticlePhaseFunction(id='phase', *, particle_properties, force_polarized=False)¶
Bases:
PhaseFunctionScattering particle phase function [
particlephase].This class provides an interface to generate kernel dictionaries and define scene parameter updates for the phase function associated with scattering particles described by the
ParticlePropertiesclass.- Parameters:
- Fields:
- eval_mu(si)¶
- eval_mu(si)
- eval_mu(si)
Evaluate the scattering angle cosine grid at a given spectral index.
- Parameters:
si (
SpectralIndex) – Spectral index.- Returns:
ndarray– Scattering angle cosine grid at the requested spectral index.
Notes
This method dispatches evaluation to specialized methods depending on the spectral index type. The default implementation raises an exception.
The underlying implementation caches the output based on the object ID of the
si.wargument: this avoids recomputations when calling this method repeatedly during a spectral loop iteration.
- eval_phase(si, phamat=None)¶
- eval_phase(si, phamat=None)
- eval_phase(si, phamat=None)
Evaluate phase function at a given spectral index, for a given phase matrix component.
- Parameters:
si (
SpectralIndex) – Spectral index.phamat (
int, optional) – Index of the requested phase matrix coefficient. If unset, all coefficients are returned.
- Returns:
phase (
ndarray) – Phase function values for all available phase matrix components, shape(n_phamat,).
Notes
This method dispatches evaluation to specialized methods depending on the spectral index type. The default implementation raises an exception.
The underlying implementation caches the output based on the object ID of the
si.wargument: this avoids recomputations when calling this method repeatedly during a spectral loop iteration.Coefficient indices map to phase matrix components as follows:
0 → m11
1 → m12
2 → m33
3 → m34
4 → m22
5 → m44
- eval_pmom(si)¶
- eval_pmom(si)
- eval_pmom(si)
Evaluate the Legendre moments of the (1,1) phase matrix element at a given spectral index.
- Parameters:
si (
SpectralIndex) – Spectral index.- Returns:
pmom (
ndarray) – Legendre moments for the (1,1) phase matrix element, shape(nleg,).
Notes
This method dispatches evaluation to specialized methods depending on the spectral index type. The default implementation raises an exception.
The underlying implementation caches the output based on the object ID of the
si.wargument: this avoids recomputations when calling this method repeatedly during a spectral loop iteration.
- 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,SceneParameter] 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, orDictParameterinstances which must be rendered.
See also