eradiate.scenes.phase.TabulatedPhaseFunction#

class eradiate.scenes.phase.TabulatedPhaseFunction(id='phase', *, data, force_polarized_phase=False, particle_shape='spherical')[source]#

Bases: PhaseFunction

Tabulated phase function [tab_phase].

A lookup table-based phase function. The data field is a DataArray with wavelength and angular dimensions.

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

  • data (DataArray) – Value table as a data array with wavelength (w), scattering angle cosine (mu), and scattering phase matrix row (i) and column (j) indices (integer) as coordinates. This parameter has no default.

  • force_polarized_phase (bool, default: False) – Flag that forces the use of a polarized phase function.

  • particle_shape ({"spherical", "spheroidal"}, default: "spherical") – Defines the shape of the particle. Only used in polarized mode.

    • "spherical": 4 coefficients considered [m11, m12, m33, m34].

    • "spheroidal": 6 coefficients considered [m11, m12, m22, m33, m34, m44].

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

  • data (DataArray) – Value table as a data array with wavelength (w), scattering angle cosine (mu), and scattering phase matrix row (i) and column (j) indices (integer) as coordinates.

  • force_polarized_phase (bool) – Flag that forces the use of a polarized phase function.

  • particle_shape (str) – Defines the shape of the particle.

Notes

  • The \(\mu\) coordinate must cover the \([-1, 1]\) interval but there is no constraint on value ordering or spacing. In particular, irregular \(\mu\) grids are supported.

  • For optimal performance, providing phase function data on a regular, sorted \(\mu\) grid is recommended.

eval(si, i, j)[source]#
eval(si, i, j)
eval(si, i, j)

Evaluate phase function at a given spectral index.

Parameters:

si (SpectralIndex) – Spectral index.

Returns:

ndarray – Evaluated phase function as a 1D array.

Notes

This method dispatches evaluation to specialized methods depending on the spectral index type.

eval_ckd(w, g, i, j)[source]#

Evaluate phase function in ckd modes.

Parameters:
  • w (pint.Quantity) – Spectral bin center wavelength.

  • i (int) – Phase matrix row index

  • j (int) – Phase matrix column index

  • g (float) – Absorption coefficient cumulative probability.

Returns:

ndarray – Evaluated phase function as a 1D or 2D array depending on the shape of w (angle dimension comes last).

eval_mono(w, i, j)[source]#

Evaluate phase function in momochromatic modes.

Parameters:
  • w (pint.Quantity) – Wavelength.

  • i (int) – Phase matrix row index

  • j (int) – Phase matrix column index

Returns:

ndarray – Evaluated phase function as a 1D or 2D array depending on the shape of w (angle dimension comes last).

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