16#include "wavefront.hpp"
22#define MXLIB_CCD_DETECTOR_LOCAL_BREAD_CRUMB
24#define BREAD_CRUMB std::cout << "DEBUG: " << __FILE__ << " " << __LINE__ << "\n";
42template <
typename _realT>
92 void qe(
const realT &q );
96 void darkCurrent(
const realT &dc );
100 void ron(
const realT &r );
104 void cic(
const realT &c );
108 void gain(
const realT &g );
112 void expTime(
const realT &dt );
116 void rows(
const int &r );
120 void cols(
const int &c );
122 void setSize(
const int &r,
const int &c );
126 void noNoise(
bool nn );
139 template<
typename imageTout,
typename imageTin>
145template <
typename realT>
146ccdDetector<realT>::ccdDetector()
178template <
typename realT>
184template <
typename realT>
190template <
typename realT>
191realT ccdDetector<realT>::darkCurrent()
193 return m_darkCurrent;
196template <
typename realT>
197void ccdDetector<realT>::darkCurrent(
const realT &dc )
202template <
typename realT>
203realT ccdDetector<realT>::ron()
208template <
typename realT>
209void ccdDetector<realT>::ron(
const realT &r )
214template <
typename realT>
215realT ccdDetector<realT>::cic()
220template <
typename realT>
221void ccdDetector<realT>::cic(
const realT &c )
226template <
typename realT>
227realT ccdDetector<realT>::gain()
232template <
typename realT>
233void ccdDetector<realT>::gain(
const realT &g )
238template <
typename realT>
239realT ccdDetector<realT>::expTime()
244template <
typename realT>
245void ccdDetector<realT>::expTime(
const realT &dt )
250template <
typename realT>
251int ccdDetector<realT>::rows()
256template <
typename realT>
257void ccdDetector<realT>::rows(
const int &r )
262template <
typename realT>
263int ccdDetector<realT>::cols()
268template <
typename realT>
269void ccdDetector<realT>::cols(
const int &c )
274template <
typename realT>
275void ccdDetector<realT>::setSize(
const int &r,
const int &c )
281template <
typename realT>
282bool ccdDetector<realT>::noNoise()
287template <
typename realT>
288void ccdDetector<realT>::noNoise(
bool nn )
293template <
typename realT>
294template<
typename imageTout,
typename imageTin>
298 using poisson_param_t =
typename std::poisson_distribution<int>::param_type;
299 using gamma_param_t =
typename std::gamma_distribution<realT>::param_type;
314 for(
int j = 0; j <
m_cols; ++j )
316 for(
int i = 0; i <
m_rows; ++i )
322 out( i, j ) = charge +
m_normVar * sqrt( charge );
326 m_poissonVar.distribution.param( poisson_param_t{ charge } );
356#ifdef MXLIB_CCD_DETECTOR_LOCAL_BREAD_CRUMB
358#undef MXLIB_CCD_DETECTOR_LOCAL_BREAD_CRUMB
realT m_ron
The readout noise, electrons per pixel per read.
realT m_darkCurrent
The dark current, per pixel per second.
realT m_qe
The quantum efficiency.
realT qe()
Get the current value of qe.
realT m_cic
EMCCD clock induced charge, electrons per pixel per read.
int m_cols
The detector size, in columns.
void exposeImage(imageTout &out, imageTin &in)
Rebin and add noise to the input image, placing the result in the output image.
realT m_expTime
The exposure time, in seconds.
norm_distT m_normVar
Gets normal-distributed variates.
gamma_distT m_gammaVar
Gets gamma distributed variates.
int m_rows
The detector size, in rows.
poisson_distT m_poissonVar
Gets Poisson distributed variates.
bool m_noNoise
If true no noise is added to the exposed image.
realT m_gain
Electron multiplication gain. If >1, then EMCCD is modeled.
A random number type, which functions like any other arithmetic type.
constexpr units::realT c()
The speed of light.
Defines a random number type.
Structure containing the phase and amplitude of a wavefront.