fouriax.Detector#

class Detector(region_mask=None, sum_wavelengths=True, channel_resolved=False, noise_model=None)#

Bases: Sensor

Intensity detector integrated over a single region of the field grid.

Computes total intensity within an optional spatial mask, optionally summing over wavelengths and resolving polarisation channels.

The default output shape is a scalar per batch element (wavelengths summed, channels merged). Set sum_wavelengths=False to retain the wavelength axis. Set channel_resolved=True with Jones input to preserve the (Ex, Ey) split.

Parameters:
  • region_mask (Array | None) – Spatial weighting mask with shape (ny, nx), or None for a uniform mask covering the whole grid.

  • sum_wavelengths (bool) – Sum over the wavelength axis in the output.

  • channel_resolved (bool) – Preserve per-channel intensities for Jones fields.

  • noise_model (SensorNoiseModel | None) – Optional stochastic noise model applied during sampling.

__init__(region_mask=None, sum_wavelengths=True, channel_resolved=False, noise_model=None)#
Parameters:
  • region_mask (Array | None)

  • sum_wavelengths (bool)

  • channel_resolved (bool)

  • noise_model (SensorNoiseModel | None)

Return type:

None

Methods

__init__([region_mask, sum_wavelengths, ...])

expected(field)

Return the deterministic detector signal before noise sampling.

measure(field, *[, key])

Return the detector output, optionally with sampled noise.

sample(field, *, key)

Sample the detector output with the configured stochastic noise model.

validate_for(field)

Check that field is compatible with this sensor.

Attributes

region_mask: Array | None = None#
sum_wavelengths: bool = True#
channel_resolved: bool = False#
noise_model: SensorNoiseModel | None = None#
measure(field, *, key=None)#

Return the detector output, optionally with sampled noise.

Parameters:
Return type:

Array

expected(field)#

Return the deterministic detector signal before noise sampling.

Parameters:

field (Field | Intensity) – Input field or intensity. Field input is converted to spatial intensity before integration.

Returns:

Array with shape (*batch,), (*batch, num_wavelengths), (*batch, 2), or (*batch, num_wavelengths, 2) depending on sum_wavelengths and channel_resolved.

Return type:

Array

sample(field, *, key)#

Sample the detector output with the configured stochastic noise model.

Parameters:
Return type:

Array