eradiate._mode.Mode#

class eradiate._mode.Mode(id, spectral_mode, mi_backend, mi_color_mode, mi_polarized=False, mi_double_precision=True)[source]#

Bases: object

Data structure describing Eradiate’s operational mode and associated ancillary data.

Parameters:
  • id (str) – Mode identifier.

  • spectral_mode (SpectralMode or str) – Spectral dimension handling.

  • mi_backend (MitsubaBackend or str) – Mitsuba computational backend.

  • mi_color_mode (MitsubaColorMode or str) – Mitsuba color mode.

  • mi_polarized (bool, default: False) – Mitsuba polarized mode.

  • mi_double_precision (bool, default: True) – Mitsuba double precision.

Fields:
  • id (str) – Mode identifier.

  • spectral_mode (SpectralMode) – Spectral dimension handling.

  • mi_backend (MitsubaBackend) – Mitsuba computational backend.

  • mi_color_mode (MitsubaColorMode) – Mitsuba color mode.

  • mi_polarized (bool) – Mitsuba polarized mode.

  • mi_double_precision (bool) – Mitsuba double precision.

Warning

Instances are immutable.

check(spectral_mode=None, mi_backend=None, mi_color_mode=None, mi_polarized=None, mi_double_precision=None)[source]#

Check if the currently active mode has the passed flags.

Parameters:
  • spectral_mode (SpectralMode or str, optional) – Spectral mode to check. If unset, the check is skipped.

  • mi_backend (MitsubaBackend or str, optional) – Mitsuba backend to check. If unset, the check is skipped.

  • mi_color_mode (MitsubaColorMode or str, optional) – Mitsuba color mode to check. If unset, the check is skipped.

  • mi_polarized (bool, optional) – Mitsuba polarized mode to check. If unset, the check is skipped.

  • mi_double_precision (bool, optional) – Mitsuba double precision mode to check. If unset, the check is skipped.

Returns:

boolTrue if current mode has the passed flags, False otherwise.

static new(mode_id)[source]#

Create a Mode instance given its identifier. Available modes are:

  • mono_single: Monochromatic, single-precision

  • mono_double: Monochromatic, double-precision

  • mono: Alias to mono_double

  • ckd_single: CKD, single-precision

  • ckd_double: CKD, double-precision

  • ckd: Alias to ckd_double

Parameters:

mode_id (str) – String identifier for the created Mode instance.

Returns:

Mode – Created Mode instance.

property mi_variant#

Mitsuba variant associated with the selected mode.

property spectral_coord_label#

Spectral coordinate label.