eradiate_disort

Classes:

DisortBackend([nstr, nmom, ...])

Eradiate DISORT backend.

DisortMeasure([id, srf, sampler, rfilter, ...])

DISORT measurement [disort].

class eradiate_disort.DisortBackend(nstr: int = 16, nmom: int = 16, intensity_correction: str = 'buras_emde', verbose: bool = False, state: DisortState = NOTHING, results: dict[Hashable, dict] = NOTHING, postprocess_ctx: dict = NOTHING, name: str = 'CDISORT')[source]

Bases: object

Eradiate DISORT backend.

This class implements an experimental Eradiate radiometric backend that uses the CDISORT implementation of the DISORT algorithm. It supports 1D scenes with atmospheres featuring an arbitrary number of components and can generally be used as a fast alternative to the Monte Carlo ray tracing backend on plane-parallel geometries.

Parameters:
  • nstr (int, default: 16) – Number of streams (angular discretization).

  • nmom (int, default: 16) – Number of Legendre moments used to represent scattering distributions (phase functions and BRDFs).

  • verbose (bool, default: False) – If False, silence CDISORT terminal output.

  • intensity_correction ({"nakajima_tanaka", "buras_emde"}, default: "buras_emde") – Intensity correction method. "nakajima_tanaka" uses only Legendre moments and is always available. "buras_emde" additionally requires the actual phase function values and is more accurate for sharply peaked phase functions.

Methods:

postprocess(exp[, measure])

Run the postprocessing step and return a DataTree.

process(exp[, measure])

Run the processing step for a given Experiment configuration.

run(exp[, measure])

Run validation, processing, and postprocessing in sequence.

validate(exp)

Check internal state consistency and compatibility with the passed Experiment configuration.

postprocess(exp: AtmosphereExperiment, measure: None | int | str = None) DataTree[source]

Run the postprocessing step and return a DataTree.

Returns a DataTree with one subtree per measure, keyed by measure ID. The measure argument is accepted for API compatibility but ignored; all measures are always included in the output.

Parameters:
  • exp (AtmosphereExperiment) – Processed experiment configuration.

  • measure (int or str, optional) – Ignored. Present for API compatibility.

Returns:

One subtree per measure, keyed by /{measure.id}/.

Return type:

DataTree

process(exp: AtmosphereExperiment, measure: None | int | str = None) None[source]

Run the processing step for a given Experiment configuration.

All measures in the experiment are processed together in a single spectral loop. The spectral grid is taken from measure (default: the first measure).

Parameters:
  • exp (AtmosphereExperiment) – Processed experiment configuration.

  • measure (int or str, optional) – Index or string ID of the measure whose spectral grid drives the loop. Defaults to the first measure.

run(exp: AtmosphereExperiment, measure: None | int | str = None) DataTree[source]

Run validation, processing, and postprocessing in sequence.

Parameters:
  • exp (AtmosphereExperiment) – Processed experiment configuration.

  • measure (int or str, optional) – Index or string ID of the measure whose spectral grid drives the processing loop. Defaults to the first measure.

Returns:

Post-processed results, one subtree per measure.

Return type:

DataTree

validate(exp: AtmosphereExperiment)[source]

Check internal state consistency and compatibility with the passed Experiment configuration.

Parameters:

exp (AtmosphereExperiment) – Processed experiment configuration.

Raises:

TypeError – If validation fails.

class eradiate_disort.DisortMeasure(id: str | None = 'measure', srf=NOTHING, sampler: str = 'independent', rfilter: str = 'box', spp=1000, *, direction_layout: HemispherePlaneLayout | AzimuthRingLayout | GridLayout | None = None, z_levels: Quantity | None = None, utau: ndarray | None = None)[source]

Bases: Measure

DISORT measurement [disort].

Records irradiance (flux) and intensity quantities at user-specified altitudes or optical depths. When a direction layout is specified, also records the full spectral radiance field uu(umu, utau, phi).

When no direction_layout is given (the default), DISORT runs with onlyfl = True, skipping angular radiance computation for speed.

The following irradiance and intensity quantities are always recorded:

  • rfldir: direct-beam downward irradiance

  • rfldn: diffuse downward irradiance

  • flup: diffuse upward irradiance

  • dfdt: flux divergence d(net flux)/d(tau)

  • uavg: intensity (direct + diffuse)

  • uavgdn: diffuse downward intensity

  • uavgup: diffuse upward intensity

  • uavgso: direct-beam intensity

Parameters:
  • direction_layout (HemispherePlaneLayout or AzimuthRingLayout or GridLayout, optional) –

    Viewing direction specification. Only structured layouts are accepted:

    Defaults to None (flux-only mode). Use the hplane(), aring(), or grid() class-method constructors for convenience.

  • z_levels (quantity, optional) – Output altitudes. Each value is snapped to the nearest zgrid level boundary. Mutually exclusive with utau. If neither is set, defaults to TOA and BOA.

  • utau (array-like, optional) – Output optical depths from TOA. Mutually exclusive with z_levels. If neither is set, defaults to TOA and BOA.

Notes

The kernel_type and template properties are not implemented; this measure type is only usable with the DISORT backend.

Methods:

aring(zenith, azimuths, **kwargs)

Construct using an azimuth-ring viewing direction layout.

grid(zeniths, azimuths, **kwargs)

Construct using a gridded (Cartesian product) viewing direction layout.

hplane(zeniths, azimuth, **kwargs)

Construct using a hemisphere-plane viewing direction layout.

is_distant()

Return True iff measure records radiometric quantities at infinite distance.

traverse(callback)

Traverse this scene element and collect kernel dictionary template and parameter update map contributions.

update()

Enforce internal state consistency.

Attributes:

film_resolution

Getter for film resolution as a (int, int) pair.

objects

Map of child objects associated with this scene element.

params

returns: A dictionary mapping parameter paths, consisting of dot-separated

template

Kernel dictionary template contents associated with this scene element.

var

Post-processing variable field name and metadata.

classmethod aring(zenith: float | Quantity, azimuths: ArrayLike, **kwargs) DisortMeasure[source]

Construct using an azimuth-ring viewing direction layout.

Parameters:
  • zenith (float or quantity) – Ring zenith angle. Unitless values are converted to ucc['angle'].

  • azimuths (array-like) – Azimuth values. Unitless values are converted to ucc['angle'].

  • azimuth_convention (AzimuthConvention or str, optional) – Azimuth convention for the layout.

  • **kwargs – Forwarded to DisortMeasure.

property film_resolution: tuple[int, int]

Getter for film resolution as a (int, int) pair.

Type:

tuple

classmethod grid(zeniths: ArrayLike, azimuths: ArrayLike, **kwargs) DisortMeasure[source]

Construct using a gridded (Cartesian product) viewing direction layout.

Parameters:
  • zeniths (array-like) – Zenith values.

  • azimuths (array-like) – Azimuth values.

  • azimuth_convention (AzimuthConvention or str, optional) – Azimuth convention for the layout.

  • **kwargs – Forwarded to DisortMeasure.

classmethod hplane(zeniths: ArrayLike, azimuth: float | Quantity, **kwargs) DisortMeasure[source]

Construct using a hemisphere-plane viewing direction layout.

Parameters:
  • zeniths (array-like) – Zenith angle values. Negative values map to the azimuth + 180° half-plane. Unitless values are converted to ucc['angle'].

  • azimuth (float or quantity) – Azimuth of the hemisphere plane cut.

  • azimuth_convention (AzimuthConvention or str, optional) – Azimuth convention for the layout.

  • **kwargs – Forwarded to DisortMeasure.

is_distant() bool

Return True iff measure records radiometric quantities at infinite distance.

property objects: dict[str, NodeSceneElement] | None

Map of child objects associated with this scene element.

Returns:

A dictionary mapping object names to a corresponding object to be inserted in the Eradiate scene graph.

Return type:

dict

property params: dict[str, SceneParameter] | None
returns: A dictionary mapping parameter paths, consisting of dot-separated

strings, to a corresponding update protocol.

Return type:

dict[str, SceneParameter] or None

See also

SceneParameter, KernelSceneParameterMap

property template: dict

Kernel dictionary template contents associated with this scene element.

Returns:

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 DictParameter instances which must be rendered.

Return type:

dict

See also

DictParameter, KernelDict

traverse(callback: SceneTraversal) None

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() None

Enforce internal state consistency. This method should be called when fields are modified. It is automatically called as a post-init step.

property var: tuple[str, dict]

Post-processing variable field name and metadata.

Type:

str, dict