Detector

Overview

The Detector simulates the effects of a real camera — including photon noise, readout noise, dark current, background, quantisation, pixel saturation, and integration time. It is used both as a standalone PSF camera (propagated from tel) and as the built-in camera inside the WFS classes (wfs.cam).

Key concepts

  • Integration time — if integrationTime equals the AO sampling time, each frame is independent. If longer, frames are co-added into a buffer and read out once integration is complete.

  • Noise model — photon noise is Poisson-distributed; readout noise is Gaussian. EMCCD and CMOS excess noise are modelled when sensor and gain are set appropriately.

  • Quantisation — if bits is set, pixel values are rounded to the nearest digital number.

  • Full Well Capacity — if FWC is set, pixels saturate at that electron count.

  • PSF sampling — when used as a PSF camera (tel * cam), the psf_sampling parameter controls the FFT zero-padding factor.

Quick start

from OOPAO.Detector import Detector

# Simple noise-free detector
cam = Detector()

# Detector with noise
cam = Detector(
    readoutNoise = 1.5,     # e-/pixel/frame
    photonNoise  = True,
    darkCurrent  = 0.1,     # e-/pixel/s
    QE           = 0.9,
)

# Use as a PSF camera
src * tel * cam
import matplotlib.pyplot as plt
plt.imshow(cam.frame)

# EMCCD with gain
emccd = Detector(sensor='EMCCD', gain=100, readoutNoise=50)

API reference

class OOPAO.Detector.Detector(nRes=None, integrationTime=None, bits=None, output_precision=None, FWC=None, gain=1, sensor='CCD', QE=1.0, binning=1, psf_sampling=2.0, darkCurrent=0.0, readoutNoise=0, photonNoise=False, backgroundNoise=False, backgroundFlux=None, backgroundMap=None, log_scale=False)[source]

Camera model with configurable noise, quantisation, and integration.

Parameters:
  • nRes (int or None) – Detector resolution in pixels. Ignored for PSF computation (controlled by psf_sampling instead). Default None.

  • integrationTime (float or None) –

    Frame integration time in seconds.

    • None — matches tel.samplingTime (one AO frame per readout, default).

    • >= samplingTime — frames are buffered and summed until the integration is complete.

    • < samplingTime — raises an error.

  • bits (int or None) – Pixel quantisation in bits. None disables quantisation. Default None.

  • output_precision (int or None) – Output array dtype precision override. Default None.

  • FWC (int or None) – Full Well Capacity in electrons. Pixels exceeding this value saturate. None disables saturation. Default None.

  • gain (int) – Detector gain. For sensor='EMCCD', sets the EM multiplication gain. Default 1.

  • sensor (str) – Sensor type for noise modelling. One of 'CCD' (default), 'CMOS', or 'EMCCD'.

  • QE (float) – Quantum efficiency (0–1). Applied as a multiplicative factor on photon counts. Default 1.0.

  • binning (int) – Pixel binning factor. Default 1.

  • psf_sampling (float) – Zero-padding factor for FFT when computing PSFs from a Telescope. 2 = Shannon sampling (default).

  • darkCurrent (float) – Dark current in electrons per pixel per second. Default 0.0.

  • readoutNoise (float) – Readout noise standard deviation in electrons per pixel. Default 0.

  • photonNoise (bool) – If True, apply Poisson photon noise to each frame. Default False.

  • backgroundNoise (bool) – If True, apply background noise using backgroundFlux. Default False.

  • backgroundFlux (numpy.ndarray or None) – 2-D background photon map to add to each frame when backgroundNoise=True. Default None.

  • backgroundMap (numpy.ndarray or None) – 2-D background map subtracted from each frame. Default None.

  • log_scale (bool) – If True, the output frame is displayed in log10 scale. Default False.

Key properties

frame: numpy.ndarray

Current detector readout frame (in electrons or digital numbers, depending on bits).

buffer_frames: list

Accumulated frames during long integrations (cleared on readout).

photonNoise: bool

Toggle Poisson photon noise on or off between frames.

readoutNoise: float

Readout noise in electrons per pixel. Can be updated at runtime.

Operator summary

Expression

Effect

tel * cam

Compute PSF and store in cam.frame

wfs * cam

Forward WFS focal-plane image to camera