eradiate._mode.Mode#

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

Bases: object

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

Parameters:
  • id (str) – Mode identifier.

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

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

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

  • mi_polarized (ModeFlag or str) – Mitsuba polarized mode.

  • mi_double_precision (ModeFlag or str) – Mitsuba double precision.

Fields:
  • id (str) – Mode identifier.

  • spectral_mode (ModeFlag) – Spectral dimension handling.

  • mi_backend (ModeFlag) – Mitsuba computational backend.

  • mi_color_mode (ModeFlag) – Mitsuba color mode.

  • mi_polarized (ModeFlag) – Mitsuba polarized mode.

  • mi_double_precision (ModeFlag) – Mitsuba double precision.

Warning

Instances are immutable.

check(spectral_mode=<ModeFlag.NONE: 0>, mi_backend=<ModeFlag.NONE: 0>, mi_color_mode=<ModeFlag.NONE: 0>, mi_polarized=<ModeFlag.NONE: 0>, mi_double_precision=<ModeFlag.NONE: 0>)[source]#

Check if the currently active mode has the passed flags.

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

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

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

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

  • mi_double_precision (ModeFlag or 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: Alias to mono_double

  • ckd: Alias to ckd_double

  • mono_polarized: Alias to mono_polarized_double

  • ckd_polarized: Alias to ckd_polarized_double

  • mono_single: Monochromatic, single-precision

  • mono_polarized_single: Monochromatic, polarized, single-precision

  • mono_double: Monochromatic, double-precision

  • mono_polarized_double: Monochromatic, polarized, double-precision

  • ckd_single: CKD, single-precision

  • ckd_polarized_single: CKD, polarized, single-precision

  • ckd_double: CKD, double-precision

  • ckd_polarized_double: CKD, polarized, double-precision

Parameters:

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

Returns:

Mode – Created Mode instance.

property flags#

All flags combined.

property mi_flags#

Combined Mitsuba-specific flags.

property mi_variant#

Mitsuba variant associated with the selected mode.