ngc 1.4.0
 
Loading...
Searching...
No Matches
ngcdcsAOCAL.hpp
Go to the documentation of this file.
1
7#ifndef ngcdcsAOCAL_H
8#define ngcdcsAOCAL_H
9
10
11#ifndef __cplusplus
12#error This is a C++ include file and cannot be used from plain C
13#endif
14
15/*
16 * Local headers
17 */
19
20
21/*
22 * Clibration filter algorithms
23 */
24#define ngcdcsAOCAL_MEDIAN 1 //< median filter
25#define ngcdcsAOCAL_MEAN 2 //< mean value
26
30#define ngcdcsAOCAL_MINPIX 40
31
35typedef float ngcdcs_ao_t;
36
41{
42public:
44 ngcdcsAOCAL(ngcdcsAO *module, const ngcb_fb_t &fb);
45
47 virtual ~ngcdcsAOCAL();
48
50 int Configure(ngcbPARAM_LIST *cfg);
51
53 int Process(void *buffer, ngcdcs_finfo_t *finfo);
54
55protected:
57 int Exec();
58
60 void Exit(int status);
61
63 void CfgStatus(ngcbPARAM_LIST *cfg);
64
65private:
67 void Init_();
68
70 ngcdcsAO *ao_;
71
73 int quadrant_;
74
76 int point_;
77
79 int maxLoop_;
80
82 double skipTime_;
83
85 int expAbort_;
86
88 char naming_[64];
89
91 char format_[64];
92
94 double dit_;
95
97 int ndit_;
98
100 int nditSkip_;
101
103 int nx_;
104
106 int ny_;
107
109 int modIdx_;
110
112 int point2_;
113
115 int point3_;
116
118 int gain2_;
119
121 int gain3_;
122
124 double fps_;
125
127 double dv2_;
128
130 double dv3_;
131
133 int loop_;
134
136 double hv2_[4];
137
139 double hv3_[4];
140
142 double hv02_[4];
143
145 double hv03_[4];
146
148 double prc2_[4];
149
151 double prc3_[4];
152
154 int chanMask_[4];
155
157 char *pixMask_;
158
160 int minPix_;
161
163 double thrMin_;
164
166 double thrMax_;
167
169 int filter_;
170
172 ngcdcs_ao_t *biasImg_;
173
175 ngcdcs_ao_t *x1Img_;
176
178 ngcdcs_ao_t *img_;
179
181 char targetFile_[256];
182
184 char logFile_[256];
185
187 char comment_[256];
188
190 FILE *logFd_;
191
193 int WriteTarget_();
194
196 int NumPix_() {return (nx_ * ny_);}
197
199 int Start_();
200
202 int SetupX1_();
203
205 int SetupPoint2_();
206
208 int SetupPoint3_();
209
211 int Completed_();
212
214 int InitPixMask_();
215
217 void Copy_(ngcdcs_ao_t *target, void *source, int dataType);
218
220 void Bias_(ngcdcs_ao_t *target, void *source, int dataType);
221
223 void Bias_(ngcdcs_ao_t *target);
224
226 int Used_(int q);
227
229 int Calibrate_(int gain);
230
232 void Path_(char *path, int size, const char *fileName, const char *dir=NULL);
233
235 double Median_(ngcdcs_ao_t *buffer, int n);
236
238 double Mean_(ngcdcs_ao_t *buffer, int n);
239
240};
241
246{
247public:
250
253
255 ngcdcsEXPDRV *Make(const char *desc, const ngcdcs_system_t &sys,
256 const ngcb_fb_t &fb) {
257 int id;
258 if (sys.ctrl == NULL)
259 {
260 strcpy(ErrMsg(), "no controller instance");
261 return (NULL);
262 }
263 if (sscanf(desc, "aocal%10d", &id) < 1) id = 1;
264 if ((id < 1) || (id > sys.ctrl->numAoMod))
265 {
266 sprintf(ErrMsg(), "AO camera instance out of range [1,%d]",
267 sys.ctrl->numAoMod);
268 return (NULL);
269 }
270 return (new ngcdcsAOCAL(sys.ctrl->ao[id - 1], fb));
271 }
272
273protected:
274private:
275};
276
277extern "C" {
282}
283
284#endif
Definition ngcbPARAM.hpp:200
Definition ngcdcsAOCAL.hpp:246
ngcdcsEXPDRV * Make(const char *desc, const ngcdcs_system_t &sys, const ngcb_fb_t &fb)
Creator.
Definition ngcdcsAOCAL.hpp:255
virtual ~ngcdcsAOCAL_FACTORY()
Destructor.
Definition ngcdcsAOCAL.hpp:252
ngcdcsAOCAL_FACTORY()
Constructor.
Definition ngcdcsAOCAL.hpp:249
Definition ngcdcsAOCAL.hpp:41
ngcdcsAOCAL(ngcdcsAO *module, const ngcb_fb_t &fb)
Constructor with associated AO camera module and feed-back channel.
Definition ngcdcsAOCAL.cpp:37
virtual ~ngcdcsAOCAL()
Destructor.
Definition ngcdcsAOCAL.cpp:47
int Configure(ngcbPARAM_LIST *cfg)
Configuration call-back.
Definition ngcdcsAOCAL.cpp:188
void Exit(int status)
Exposure sequence termination call-back.
Definition ngcdcsAOCAL.cpp:572
void CfgStatus(ngcbPARAM_LIST *cfg)
Configuration status call-back.
Definition ngcdcsAOCAL.cpp:501
int Process(void *buffer, ngcdcs_finfo_t *finfo)
Processing call-back.
Definition ngcdcsAOCAL.cpp:787
int Exec()
Execution block.
Definition ngcdcsAOCAL.cpp:615
Definition ngcdcsAO.hpp:311
ngcdcsAO * ao[ngcdcsCTRL_MAX_AO]
AO cameras.
Definition ngcdcsCTRL.hpp:124
int numAoMod
Number of AO cameras.
Definition ngcdcsCTRL.hpp:127
Definition ngcdcsEXPDRV.hpp:30
ngcdcsEXPDRV(const ngcb_fb_t &fb)
Constructor with feed-back channel.
Definition ngcdcsEXPDRV.hpp:54
ngcdcsFACTORY(const char *s)
Constructor.
Definition ngcdcsFACTORY.hpp:63
char * ErrMsg()
Error message.
Definition ngcdcsFACTORY.hpp:87
float ngcdcs_ao_t
Definition ngcdcsAOCAL.hpp:35
ngcdcsAOCAL_FACTORY ngcdcsAoCal
Definition ngcdcsAOCAL.cpp:31
Definition ngcbSTREAM.hpp:27
Definition ngcdcsFINFO.hpp:462
Definition ngcdcsFACTORY.hpp:22
ngcdcsCTRL * ctrl
Controller.
Definition ngcdcsFACTORY.hpp:24