| 1 | /*  Caracteristique du CCD      Reza  03/95  -*- C++ -*- */ | 
|---|
| 2 |  | 
|---|
| 3 | #ifndef DYNCCD_H_SEEN | 
|---|
| 4 | #define DYNCCD_H_SEEN | 
|---|
| 5 |  | 
|---|
| 6 | #include "machdefs.h" | 
|---|
| 7 | #include "pexceptions.h" | 
|---|
| 8 | #include "cimage.h" | 
|---|
| 9 | #include "ppersist.h" | 
|---|
| 10 |  | 
|---|
| 11 | namespace SOPHYA { | 
|---|
| 12 |  | 
|---|
| 13 | enum {kConstantNoise = 0, kPhotonNoise, kSigFondNoise, kSqrtADUNoise}; | 
|---|
| 14 |  | 
|---|
| 15 | class DynCCD | 
|---|
| 16 | { | 
|---|
| 17 | public : | 
|---|
| 18 |  | 
|---|
| 19 | int_4 TypNoise;      // Type de calcul du bruit | 
|---|
| 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) */ | 
|---|
| 25 |  | 
|---|
| 26 | /*    ===>  Les methodes   */ | 
|---|
| 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.); | 
|---|
| 29 |  | 
|---|
| 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.); | 
|---|
| 32 | void Print(); | 
|---|
| 33 | r_8 Noise(r_8 pixel) const; | 
|---|
| 34 | }; | 
|---|
| 35 |  | 
|---|
| 36 | } // Fin du namespace | 
|---|
| 37 |  | 
|---|
| 38 |  | 
|---|
| 39 | template <class T> | 
|---|
| 40 | Image<T> NoiseImage(Image<T> const & pim, DynCCD const & dynccd); | 
|---|
| 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); | 
|---|
| 50 | c.PutR8s(&data.MinADU, 6); | 
|---|
| 51 | return c; | 
|---|
| 52 | } | 
|---|
| 53 |  | 
|---|
| 54 | inline | 
|---|
| 55 | PInPersist& operator >> (PInPersist& c, DynCCD& data) | 
|---|
| 56 | { | 
|---|
| 57 | c.GetI4(data.TypNoise); | 
|---|
| 58 | c.GetR8s(&data.MinADU, 6); | 
|---|
| 59 | return c; | 
|---|
| 60 | } | 
|---|
| 61 |  | 
|---|
| 62 | #endif | 
|---|