optixstuff.optical_elements#

Optical element abstractions (throughput, filters, field stops).

Classes#

AbstractOpticalElement

Abstract interface for an optical element in the beam path.

AbstractUniformElement

Base for elements with spatially uniform throughput.

ConstantThroughput

An optical element with wavelength-independent throughput.

SpectralThroughput

Wavelength-dependent throughput defined by sampled (wavelength, throughput) pairs.

Module Contents#

class optixstuff.optical_elements.AbstractOpticalElement[source]#

Bases: equinox.Module

Abstract interface for an optical element in the beam path.

Elements reduce photon flux via wavelength-dependent throughput. The ETC calls get_throughput() for scalar efficiency calculations. The simulator calls apply() to attenuate 2D photon arrays.

Both methods are abstract: use AbstractUniformElement for elements with spatially uniform throughput, which provides a default apply().

abstractmethod get_throughput(wavelength_nm)[source]#

Fractional throughput at a given wavelength.

Args:

wavelength_nm: Wavelength in nanometres.

Returns:

Scalar throughput in [0, 1].

Parameters:

wavelength_nm (jax.typing.ArrayLike)

Return type:

jax.typing.ArrayLike

abstractmethod apply(arr, wavelength_nm)[source]#

Apply this element to a 2D photon array.

Args:

arr: Input photon rate array [ph/s/pixel]. wavelength_nm: Wavelength in nanometres.

Returns:

Attenuated photon rate array, same shape as arr.

Parameters:
  • arr (jaxtyping.Array)

  • wavelength_nm (jax.typing.ArrayLike)

Return type:

jaxtyping.Array

class optixstuff.optical_elements.AbstractUniformElement[source]#

Bases: AbstractOpticalElement

Base for elements with spatially uniform throughput.

Provides a default apply() that multiplies the array by the scalar throughput. Override apply() for elements with spatially varying transmission (e.g., field-dependent filter transmission maps).

apply(arr, wavelength_nm)[source]#

Apply uniform throughput to a photon array.

Parameters:
  • arr (jaxtyping.Array)

  • wavelength_nm (jax.typing.ArrayLike)

Return type:

jaxtyping.Array

class optixstuff.optical_elements.ConstantThroughput[source]#

Bases: AbstractUniformElement

An optical element with wavelength-independent throughput.

Useful for modeling simple attenuators, beamsplitters, or as a placeholder during instrument design studies.

throughput: float#
name: str#
get_throughput(wavelength_nm)[source]#

Return constant throughput, ignoring wavelength.

Parameters:

wavelength_nm (jax.typing.ArrayLike)

Return type:

jax.typing.ArrayLike

__repr__()[source]#

One-line summary of throughput value.

Return type:

str

class optixstuff.optical_elements.SpectralThroughput(wavelengths_nm, throughputs)[source]#

Bases: AbstractUniformElement

Wavelength-dependent throughput defined by sampled (wavelength, throughput) pairs.

Linear interpolation between samples; throughput is zero outside the defined wavelength range.

Represents any tabulated wavelength-dependent throughput in the optical path: bandpass filters, dichroics, mirror reflectivity, coating losses, ADCs, blocking filters, etc.

Parameters:
  • wavelengths_nm (jaxtyping.Array)

  • throughputs (jaxtyping.Array)

wavelengths_nm: jaxtyping.Array#
throughputs: jaxtyping.Array#
interp: interpax.Interpolator1D#
get_throughput(wavelength_nm)[source]#

Interpolate throughput at the requested wavelength.

Parameters:

wavelength_nm (jax.typing.ArrayLike)

Return type:

jax.typing.ArrayLike

__repr__()[source]#

One-line summary of throughput-table extent and sample count.

Return type:

str