[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 | enum {kConstantNoise = 0, kPhotonNoise, kSigFondNoise, kSqrtADUNoise};
|
---|
| 14 |
|
---|
[896] | 15 | class DynCCD
|
---|
[220] | 16 | {
|
---|
| 17 | public :
|
---|
| 18 |
|
---|
[1110] | 19 | int_4 TypNoise; // Type de calcul du bruit
|
---|
[1104] | 20 | r_8 MinADU,MaxADU; // Valeur min et max des pixels
|
---|
| 21 | r_8 Gain; // Gain en electron/ADU
|
---|
| 22 | r_8 RONoise; // Bruit de lecture en electron
|
---|
| 23 | r_8 RefFond; // Fond de ciel de ref (TypNoise=2)
|
---|
| 24 | r_8 RefSFond; // Sigma du fond (TypNoise=2) */
|
---|
[220] | 25 |
|
---|
| 26 | /* ===> Les methodes */
|
---|
[1104] | 27 | DynCCD(int_4 typ=0, r_8 min=-9.e19, r_8 max=9.e19,
|
---|
| 28 | r_8 g=1., r_8 ron=0., r_8 rf=0., r_8 rfs=0.);
|
---|
[220] | 29 |
|
---|
[1104] | 30 | void Set(int_4 typ=0, r_8 min=-9.e19, r_8 max=9.e19,
|
---|
| 31 | r_8 g=1., r_8 ron=0., r_8 rf=0., r_8 rfs=0.);
|
---|
[220] | 32 | void Print();
|
---|
[1104] | 33 | r_8 Noise(r_8 pixel) const;
|
---|
[220] | 34 | };
|
---|
| 35 |
|
---|
[896] | 36 | } // Fin du namespace
|
---|
| 37 |
|
---|
[220] | 38 |
|
---|
| 39 | template <class T>
|
---|
[1104] | 40 | Image<T> NoiseImage(Image<T> const & pim, DynCCD const & dynccd);
|
---|
[220] | 41 |
|
---|
| 42 | template <class T>
|
---|
| 43 | void ImgAddNoise(Image<T>&, DynCCD const&);
|
---|
| 44 |
|
---|
| 45 | // Les entrees-sortie
|
---|
| 46 |
|
---|
| 47 | inline POutPersist& operator << (POutPersist& c, DynCCD const& data)
|
---|
| 48 | {
|
---|
| 49 | c.PutI4(data.TypNoise);
|
---|
[1104] | 50 | c.PutR8s(&data.MinADU, 6);
|
---|
[220] | 51 | return c;
|
---|
| 52 | }
|
---|
| 53 |
|
---|
| 54 | inline
|
---|
| 55 | PInPersist& operator >> (PInPersist& c, DynCCD& data)
|
---|
| 56 | {
|
---|
| 57 | c.GetI4(data.TypNoise);
|
---|
[1104] | 58 | c.GetR8s(&data.MinADU, 6);
|
---|
[220] | 59 | return c;
|
---|
| 60 | }
|
---|
| 61 |
|
---|
| 62 | #endif
|
---|