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") – User-defined object identifier.

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

Fields
• id (str or None) – User-defined object identifier.

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

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(spectral_ctx)[source]#

Evaluate phase function based on a spectral context. This method dispatches evaluation to specialised methods depending on the active mode.

Parameters

spectral_ctx (SpectralContext) – A spectral context data structure containing relevant spectral parameters (e.g. wavelength in monochromatic mode, bin and quadrature point index in CKD mode).

Returns

ndarray – Evaluated phase function as a 1D array.

eval_ckd(*bindexes)[source]#

Evaluate phase function in CKD modes.

Parameters

*bindexes (Bindex) – One or several CKD bindexes for which to evaluate the phase function.

Returns

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

eval_mono(w)[source]#

Evaluate phase function in monochromatic modes.

Parameters

w (pint.Quantity) – Wavelength values at which the phase function is to be evaluated.

Returns

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

kernel_dict(ctx)[source]#

Return a dictionary suitable for kernel scene configuration.

Parameters

ctx (KernelDictContext) – A context data structure containing parameters relevant for kernel dictionary generation.

Returns

KernelDict – Kernel dictionary which can be loaded as a Mitsuba object.