source: Sophya/trunk/SophyaLib/NTools/dynccd.h@ 3730

Last change on this file since 3730 was 2808, checked in by ansari, 20 years ago

MAJ documentation - Reza 14/6/2005

File size: 1.5 KB
Line 
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
11namespace SOPHYA {
12
13
14//! Readout and photon noise calculation for images
15class DynCCD
16{
17 public :
18 enum {kConstantNoise = 0, kPhotonNoise, kSigFondNoise, kSqrtADUNoise};
19
20 int_4 TypNoise; // Type de calcul du bruit
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) */
26
27/* ===> Les methodes */
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.);
30
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.);
33 void Print();
34 r_8 Noise(r_8 pixel) const;
35};
36
37} // Fin du namespace
38
39
40//! Return an image corresponding to the noise described by \b dynccd
41template <class T>
42Image<T> NoiseImage(Image<T> const & pim, DynCCD const & dynccd);
43
44//! Add noise to the image
45template <class T>
46void ImgAddNoise(Image<T>&, DynCCD const&);
47
48// Les entrees-sortie
49
50inline POutPersist& operator << (POutPersist& c, DynCCD const& data)
51{
52 c.PutI4(data.TypNoise);
53 c.PutR8s(&data.MinADU, 6);
54 return c;
55}
56
57inline
58PInPersist& operator >> (PInPersist& c, DynCCD& data)
59{
60 c.GetI4(data.TypNoise);
61 c.GetR8s(&data.MinADU, 6);
62 return c;
63}
64
65#endif
Note: See TracBrowser for help on using the repository browser.