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
integrationTimeequals 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
sensorandgainare set appropriately.Quantisation — if
bitsis set, pixel values are rounded to the nearest digital number.Full Well Capacity — if
FWCis set, pixels saturate at that electron count.PSF sampling — when used as a PSF camera (
tel * cam), thepsf_samplingparameter 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_samplinginstead). DefaultNone.integrationTime (float or None) –
Frame integration time in seconds.
None— matchestel.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.
Nonedisables quantisation. DefaultNone.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.
Nonedisables saturation. DefaultNone.gain (int) – Detector gain. For
sensor='EMCCD', sets the EM multiplication gain. Default1.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. DefaultFalse.backgroundNoise (bool) – If
True, apply background noise usingbackgroundFlux. DefaultFalse.backgroundFlux (numpy.ndarray or None) – 2-D background photon map to add to each frame when
backgroundNoise=True. DefaultNone.backgroundMap (numpy.ndarray or None) – 2-D background map subtracted from each frame. Default
None.log_scale (bool) – If
True, the outputframeis displayed in log10 scale. DefaultFalse.
Key properties
- frame: numpy.ndarray¶
Current detector readout frame (in electrons or digital numbers, depending on
bits).
Operator summary
Expression
Effect
tel * camCompute PSF and store in
cam.framewfs * camForward WFS focal-plane image to camera