mxlib
c++ tools for analyzing astronomical data and other tasks by Jared R. Males. [git repo]
mx::AO::sim::ccdDetector< _realT > Class Template Reference

template<typename _realT>
class mx::AO::sim::ccdDetector< _realT >

A simulated CCD detector.

A simulated CCD detector, including an optional EMCCD noise model.

Definition at line 38 of file ccdDetector.hpp.

#include <ao/sim/ccdDetector.hpp>

Public Member Functions

realT qe ()
 Get the current value of qe. More...
 
void exposeImage (imageT &out, imageT &in)
 Rebin and add noise to the input image, placing the result in the output image. More...
 

Protected Attributes

norm_distT m_normVar
 Gets normal-distributed variates. More...
 
poisson_distT m_poissonVar
 Gets Poisson distributed variates. More...
 
gamma_distT m_gammaVar
 Gets gamma distributed variates. More...
 
realT m_qe {1}
 The quantum efficiency. More...
 
realT m_darkCurrent {0}
 The dark current, per pixel per second. More...
 
realT m_ron {0}
 The readout noise, electrons per pixel per read #include "mx/randomT.hpp". More...
 
realT m_cic {0}
 EMCCD clock induced charge, electrons per pixel per read. More...
 
realT m_gain {1}
 Electron multiplication gain. If >1, then EMCCD is modeled. More...
 
realT m_expTime {1}
 The exposure time, in seconds. More...
 
int m_rows {0}
 The detector size, in rows. More...
 
int m_cols {0}
 The detector size, in columns. More...
 
bool m_noNoise {false}
 If true no noise is added to the exposed image. More...
 

Member Function Documentation

◆ exposeImage()

template<typename realT >
void mx::AO::sim::ccdDetector< realT >::exposeImage ( imageT &  out,
imageT &  in 
)

Rebin and add noise to the input image, placing the result in the output image.

The output image must be the same size or smaller than the input image. The output image is resized only if necessary. The input image is multiplied by expTime, so its flux should be in photons/sec. Noise is modeled as follows:

  1. The number of input photons for pixel (i,j) is \( n_{ie} = (in(i,j) + darkCurrent)*expTime + cic \)
  2. The Poisson distribution with mean and variance \( n_{ie} \) is sampled.
  3. If gain > 1, the gamma distribution is sampled
  4. Read noise is applied
  5. Result is rounded to nearest whole integer.
Parameters
[out]outThe output image, after all above steps applied.
[in]inthe input image, in photons/sec flux units.

Definition at line 303 of file ccdDetector.hpp.

References mx::improc::imageDownSample().

◆ qe()

template<typename realT >
realT mx::AO::sim::ccdDetector< realT >::qe

Get the current value of qe.

Returns
the current value of m_qe

Definition at line 185 of file ccdDetector.hpp.

Member Data Documentation

◆ m_cic

template<typename _realT >
realT mx::AO::sim::ccdDetector< _realT >::m_cic {0}
protected

EMCCD clock induced charge, electrons per pixel per read.

Definition at line 71 of file ccdDetector.hpp.

◆ m_cols

template<typename _realT >
int mx::AO::sim::ccdDetector< _realT >::m_cols {0}
protected

The detector size, in columns.

Definition at line 77 of file ccdDetector.hpp.

◆ m_darkCurrent

template<typename _realT >
realT mx::AO::sim::ccdDetector< _realT >::m_darkCurrent {0}
protected

The dark current, per pixel per second.

Definition at line 68 of file ccdDetector.hpp.

◆ m_expTime

template<typename _realT >
realT mx::AO::sim::ccdDetector< _realT >::m_expTime {1}
protected

The exposure time, in seconds.

Definition at line 74 of file ccdDetector.hpp.

◆ m_gain

template<typename _realT >
realT mx::AO::sim::ccdDetector< _realT >::m_gain {1}
protected

Electron multiplication gain. If >1, then EMCCD is modeled.

Definition at line 72 of file ccdDetector.hpp.

◆ m_gammaVar

template<typename _realT >
gamma_distT mx::AO::sim::ccdDetector< _realT >::m_gammaVar
protected

Gets gamma distributed variates.

Definition at line 64 of file ccdDetector.hpp.

◆ m_noNoise

template<typename _realT >
bool mx::AO::sim::ccdDetector< _realT >::m_noNoise {false}
protected

If true no noise is added to the exposed image.

Definition at line 79 of file ccdDetector.hpp.

◆ m_normVar

template<typename _realT >
norm_distT mx::AO::sim::ccdDetector< _realT >::m_normVar
protected

Gets normal-distributed variates.

Definition at line 62 of file ccdDetector.hpp.

◆ m_poissonVar

template<typename _realT >
poisson_distT mx::AO::sim::ccdDetector< _realT >::m_poissonVar
protected

Gets Poisson distributed variates.

Definition at line 63 of file ccdDetector.hpp.

◆ m_qe

template<typename _realT >
realT mx::AO::sim::ccdDetector< _realT >::m_qe {1}
protected

The quantum efficiency.

Definition at line 66 of file ccdDetector.hpp.

◆ m_ron

template<typename _realT >
realT mx::AO::sim::ccdDetector< _realT >::m_ron {0}
protected

The readout noise, electrons per pixel per read #include "mx/randomT.hpp".

Definition at line 69 of file ccdDetector.hpp.

◆ m_rows

template<typename _realT >
int mx::AO::sim::ccdDetector< _realT >::m_rows {0}
protected

The detector size, in rows.

Definition at line 76 of file ccdDetector.hpp.


The documentation for this class was generated from the following file: