optixstuff.optical_elements
===========================

.. py:module:: optixstuff.optical_elements

.. autoapi-nested-parse::

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



Classes
-------

.. autoapisummary::

   optixstuff.optical_elements.AbstractOpticalElement
   optixstuff.optical_elements.AbstractUniformElement
   optixstuff.optical_elements.ConstantThroughput
   optixstuff.optical_elements.SpectralThroughput


Module Contents
---------------

.. py:class:: AbstractOpticalElement

   Bases: :py:obj:`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().


   .. py:method:: get_throughput(wavelength_nm)
      :abstractmethod:


      Fractional throughput at a given wavelength.

      Args:
          wavelength_nm: Wavelength in nanometres.

      Returns:
          Scalar throughput in [0, 1].



   .. py:method:: apply(arr, wavelength_nm)
      :abstractmethod:


      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.



.. py:class:: AbstractUniformElement

   Bases: :py:obj:`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).


   .. py:method:: apply(arr, wavelength_nm)

      Apply uniform throughput to a photon array.



.. py:class:: ConstantThroughput

   Bases: :py:obj:`AbstractUniformElement`


   An optical element with wavelength-independent throughput.

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


   .. py:attribute:: throughput
      :type:  float


   .. py:attribute:: name
      :type:  str


   .. py:method:: get_throughput(wavelength_nm)

      Return constant throughput, ignoring wavelength.



   .. py:method:: __repr__()

      One-line summary of throughput value.



.. py:class:: SpectralThroughput(wavelengths_nm, throughputs)

   Bases: :py:obj:`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.


   .. py:attribute:: wavelengths_nm
      :type:  jaxtyping.Array


   .. py:attribute:: throughputs
      :type:  jaxtyping.Array


   .. py:attribute:: interp
      :type:  interpax.Interpolator1D


   .. py:method:: get_throughput(wavelength_nm)

      Interpolate throughput at the requested wavelength.



   .. py:method:: __repr__()

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



