signal#

optika.sensors.signal(photons_expected, wavelength, absorbance=None, absorption=None, thickness_implant=<Quantity 2317. Angstrom>, cce_backsurface=0.21, temperature=<Quantity 300. K>, method='exact', shape_random=None)[source]#

A random sample from the approximate distribution of measured electrons given the expected number of photons incident on the front surface of the sensor.

This function adds shot noise to the expected number of photons, and then adds Fano noise and recombination noise using electrons_measured().

Parameters:
  • photons_expected (Quantity | AbstractScalar) – The expected number of photons incident on the detector surface.

  • wavelength (Quantity | ScalarArray) – The vacuum wavelength of the absorbed photons.

  • absorbance (None | float | AbstractScalar) – The fraction of incident energy absorbed by the light-sensitive layer of the detector computed using the average of absorbance(). If None (the default), the result of absorbance() called with default values will be used.

  • absorption (None | Quantity | AbstractScalar) – The absorption coefficient of the light-sensitive material for the wavelength of interest. If None (the default), the result of optika.chemicals.Chemical.absorption() for silicon will be used.

  • thickness_implant (Quantity | AbstractScalar) – The thickness of the implant layer. Default is the value given in Stern et al. [1994].

  • cce_backsurface (Quantity | AbstractScalar) – The differential charge collection efficiency on the back surface of the sensor. Default is the value given in Stern et al. [1994].

  • temperature (Quantity | ScalarArray) – The temperature of the light-sensitive silicon layer.

  • method (Literal['exact', 'approx', 'expected']) – The method used to generate random samples of measured electrons. The exact method simulates every photon so it is accurate for low photon counts but slow for high photon counts. The approx method is much faster, but is only accurate if the number of photons is high. The expected method does not add any noise to the signal and just returns the expected number of electrons.

  • shape_random (None | dict[str, int]) – Additional shape used to specify the number of samples to draw.

Return type:

AbstractScalar

Examples

Plot the variance-to-mean ratio of the number of electrons measured by the sensor as a function of wavelength.

import matplotlib.pyplot as plt
import astropy.units as u
import named_arrays as na
import optika

# Define the number of experiments to perform
num_experiments = 1000

# Define the expected number of photons
# for each experiment
photons_expected = 100 * u.photon

# Define a grid of wavelengths
wavelength = na.geomspace(10, 10000, axis="wavelength", num=1001) * u.AA

# Compute the actual number of electrons measured for each experiment
electrons = optika.sensors.signal(
    photons_expected=photons_expected,
    wavelength=wavelength,
    shape_random=dict(experiment=num_experiments),
)

# Plot the variance-to-mean ratio of the result
# as a function of wavelength.
fig, ax = plt.subplots(constrained_layout=True)
na.plt.plot(
    wavelength,
    electrons.vmr("experiment"),
    ax=ax,
);
ax.set_xscale("log");
ax.set_yscale("log");
ax.set_xlabel(f"wavelength ({wavelength.unit:latex_inline})");
ax.set_ylabel(f"variance-to-mean ratio ({electrons.unit:latex_inline})");
../_images/optika.sensors.signal_0_2.png