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