[220] | 1 | /* Caracteristique du CCD Reza 03/95 -*- C++ -*- */
|
---|
| 2 |
|
---|
| 3 | #ifndef DYNCCD_H_SEEN
|
---|
| 4 | #define DYNCCD_H_SEEN
|
---|
| 5 |
|
---|
[244] | 6 | #include "machdefs.h"
|
---|
| 7 | #include "pexceptions.h"
|
---|
[1104] | 8 | #include "cimage.h"
|
---|
[220] | 9 | #include "ppersist.h"
|
---|
| 10 |
|
---|
[896] | 11 | namespace SOPHYA {
|
---|
| 12 |
|
---|
[220] | 13 |
|
---|
[2808] | 14 | //! Readout and photon noise calculation for images
|
---|
[896] | 15 | class DynCCD
|
---|
[220] | 16 | {
|
---|
| 17 | public :
|
---|
[2808] | 18 | enum {kConstantNoise = 0, kPhotonNoise, kSigFondNoise, kSqrtADUNoise};
|
---|
[220] | 19 |
|
---|
[1110] | 20 | int_4 TypNoise; // Type de calcul du bruit
|
---|
[1104] | 21 | r_8 MinADU,MaxADU; // Valeur min et max des pixels
|
---|
| 22 | r_8 Gain; // Gain en electron/ADU
|
---|
| 23 | r_8 RONoise; // Bruit de lecture en electron
|
---|
| 24 | r_8 RefFond; // Fond de ciel de ref (TypNoise=2)
|
---|
| 25 | r_8 RefSFond; // Sigma du fond (TypNoise=2) */
|
---|
[220] | 26 |
|
---|
| 27 | /* ===> Les methodes */
|
---|
[1104] | 28 | DynCCD(int_4 typ=0, r_8 min=-9.e19, r_8 max=9.e19,
|
---|
| 29 | r_8 g=1., r_8 ron=0., r_8 rf=0., r_8 rfs=0.);
|
---|
[220] | 30 |
|
---|
[1104] | 31 | void Set(int_4 typ=0, r_8 min=-9.e19, r_8 max=9.e19,
|
---|
| 32 | r_8 g=1., r_8 ron=0., r_8 rf=0., r_8 rfs=0.);
|
---|
[220] | 33 | void Print();
|
---|
[1104] | 34 | r_8 Noise(r_8 pixel) const;
|
---|
[220] | 35 | };
|
---|
| 36 |
|
---|
[896] | 37 | } // Fin du namespace
|
---|
| 38 |
|
---|
[220] | 39 |
|
---|
[2808] | 40 | //! Return an image corresponding to the noise described by \b dynccd
|
---|
[220] | 41 | template <class T>
|
---|
[1104] | 42 | Image<T> NoiseImage(Image<T> const & pim, DynCCD const & dynccd);
|
---|
[220] | 43 |
|
---|
[2808] | 44 | //! Add noise to the image
|
---|
[220] | 45 | template <class T>
|
---|
| 46 | void ImgAddNoise(Image<T>&, DynCCD const&);
|
---|
| 47 |
|
---|
| 48 | // Les entrees-sortie
|
---|
| 49 |
|
---|
| 50 | inline POutPersist& operator << (POutPersist& c, DynCCD const& data)
|
---|
| 51 | {
|
---|
| 52 | c.PutI4(data.TypNoise);
|
---|
[1104] | 53 | c.PutR8s(&data.MinADU, 6);
|
---|
[220] | 54 | return c;
|
---|
| 55 | }
|
---|
| 56 |
|
---|
| 57 | inline
|
---|
| 58 | PInPersist& operator >> (PInPersist& c, DynCCD& data)
|
---|
| 59 | {
|
---|
| 60 | c.GetI4(data.TypNoise);
|
---|
[1104] | 61 | c.GetR8s(&data.MinADU, 6);
|
---|
[220] | 62 | return c;
|
---|
| 63 | }
|
---|
| 64 |
|
---|
| 65 | #endif
|
---|