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