source: trunk/MagicSoft/Mars/macros/testMTrans.C@ 4983

Last change on this file since 4983 was 4739, checked in by wittek, 20 years ago
*** empty log message ***
File size: 16.3 KB
Line 
1
2/////////////////////////////////////////////////////////////////////////////
3// //
4// Description: Macro to test the class MTransCelLocCam
5//
6// Author: Wolfgang Wittek (wittek@mppmu.mpg.de)
7// Date: 08/2004
8// //
9/////////////////////////////////////////////////////////////////////////////
10
11void testMTrans()
12{
13 gLog->SetNoColors();
14
15
16 MGeomCamMagic geom;
17 MObservatory obs;
18
19 MStarCamTrans trans(geom, obs);
20
21 trans.SetGridParameters(0.50, 0.1);
22
23 /*
24 trans.PlotGridAtTheta0Phi0("Plot_2a", 0.001,135.0);
25 trans.PlotGridAtTheta0Phi0("Plot_2b", 30.00,135.0);
26 trans.PlotGridAtTheta0Phi0("Plot_2c", 60.00,135.0);
27 trans.PlotGridAtTheta0Phi0("Plot_2d", 90.00,135.0);
28
29 trans.PlotGridAtTheta0Phi0("Plot1a", 0.001, 0.0);
30 trans.PlotGridAtTheta0Phi0("Plot1b", 30.00, 0.0);
31 trans.PlotGridAtTheta0Phi0("Plot1c", 60.00, 0.0);
32 trans.PlotGridAtTheta0Phi0("Plot1d", 90.00, 0.0);
33
34 trans.PlotGridAtTheta0Phi0("Plot2a", 0.001, 90.0);
35 trans.PlotGridAtTheta0Phi0("Plot2b", 30.00, 90.0);
36 trans.PlotGridAtTheta0Phi0("Plot2c", 60.00, 90.0);
37 trans.PlotGridAtTheta0Phi0("Plot2d", 90.00, 90.0);
38
39
40 trans.PlotGridAtTheta0Phi0("Plot3a", 0.001, 180.0);
41 */
42
43 trans.PlotGridAtTheta0Phi0("Plot3b", 30.00, 180.0);
44
45 /*
46
47 trans.PlotGridAtTheta0Phi0("Plot3c", 60.00, 180.0);
48 trans.PlotGridAtTheta0Phi0("Plot3d", 90.00, 180.0);
49
50 trans.PlotGridAtTheta0Phi0("Plot4a", 0.001, 270.0);
51 trans.PlotGridAtTheta0Phi0("Plot4b", 30.00, 270.0);
52 trans.PlotGridAtTheta0Phi0("Plot4c", 60.00, 270.0);
53 trans.PlotGridAtTheta0Phi0("Plot4d", 90.00, 270.0);
54
55 trans.PlotGridAtDec0H0 ("Plot5a", 89.999, -12.0);
56 trans.PlotGridAtDec0H0 ("Plot5b", 60.000, -12.0);
57 trans.PlotGridAtDec0H0 ("Plot5c", 30.000, -12.0);
58 trans.PlotGridAtDec0H0 ("Plot5d", 0.000, -12.0);
59 trans.PlotGridAtDec0H0 ("Plot5e",-30.000, -12.0);
60
61 trans.PlotGridAtDec0H0 ("Plot6a", 89.999, -6.0);
62 trans.PlotGridAtDec0H0 ("Plot6b", 60.000, -6.0);
63 trans.PlotGridAtDec0H0 ("Plot6c", 30.000, -6.0);
64 trans.PlotGridAtDec0H0 ("Plot6d", 0.000, -6.0);
65 trans.PlotGridAtDec0H0 ("Plot6e",-30.000, -6.0);
66
67 trans.PlotGridAtDec0H0 ("Plot7a", 89.999, 0.0);
68 trans.PlotGridAtDec0H0 ("Plot7b", 60.000, 0.0);
69 trans.PlotGridAtDec0H0 ("Plot7c", 30.000, 0.0);
70 trans.PlotGridAtDec0H0 ("Plot7d", 0.000, 0.0);
71 trans.PlotGridAtDec0H0 ("Plot7e",-30.000, 0.0);
72
73 trans.PlotGridAtDec0H0 ("Plot8a", 89.999, 6.0);
74 trans.PlotGridAtDec0H0 ("Plot8b", 60.000, 6.0);
75 trans.PlotGridAtDec0H0 ("Plot8c", 30.000, 6.0);
76 trans.PlotGridAtDec0H0 ("Plot8d", 0.000, 6.0);
77 trans.PlotGridAtDec0H0 ("Plot8e",-30.000, 6.0);
78 */
79
80 //===================================================
81 // special tests
82
83 gLog << "==============================================================="
84 << endl;
85
86 Double_t th1 = 10.0;
87 Double_t ph1 = 200.0;
88 Double_t X1 = 0.0;
89 Double_t Y1 = 0.0;
90 Double_t X2 = 100.0;
91 Double_t Y2 = 50.0;
92 Double_t th2;
93 Double_t ph2;
94
95 trans.LocCamCamToLoc(th1, ph1, X1, Y1, X2, Y2, th2, ph2);
96 gLog << "th1, ph1, X1, Y1, th2, ph2, X2, Y2 = "
97 << th1 << ", " << ph1 << "; " << X1 << ", " << Y1 << "; "
98 << th2 << ", " << ph2 << "; " << X2 << ", " << Y2 << endl;
99
100 trans.Loc0CamToLoc(th1, ph1, X2, Y2, th2, ph2);
101 gLog << "th1, ph1, X1, Y1, th2, ph2, X2, Y2 = "
102 << th1 << ", " << ph1 << "; " << X1 << ", " << Y1 << "; "
103 << th2 << ", " << ph2 << "; " << X2 << ", " << Y2 << endl;
104
105 trans.Loc0LocToCam(th1, ph1, th2, ph2, X2, Y2);
106 gLog << "th1, ph1, X1, Y1, th2, ph2, X2, Y2 = "
107 << th1 << ", " << ph1 << "; " << X1 << ", " << Y1 << "; "
108 << th2 << ", " << ph2 << "; " << X2 << ", " << Y2 << endl;
109
110 trans.LocCamToLoc0(th2, ph2, X2, Y2, th1, ph1);
111 gLog << "th1, ph1, X1, Y1, th2, ph2, X2, Y2 = "
112 << th1 << ", " << ph1 << "; " << X1 << ", " << Y1 << "; "
113 << th2 << ", " << ph2 << "; " << X2 << ", " << Y2 << endl;
114
115 trans.LocCamLocToCam(th1, ph1, X1, Y1, th2, ph2, X2, Y2);
116 gLog << "th1, ph1, X1, Y1, th2, ph2, X2, Y2 = "
117 << th1 << ", " << ph1 << "; " << X1 << ", " << Y1 << "; "
118 << th2 << ", " << ph2 << "; " << X2 << ", " << Y2 << endl;
119
120 trans.Loc0LocToCam(th1, ph1, th2, ph2, X2, Y2);
121 gLog << "th1, ph1, X1, Y1, th2, ph2, X2, Y2 = "
122 << th1 << ", " << ph1 << "; " << X1 << ", " << Y1 << "; "
123 << th2 << ", " << ph2 << "; " << X2 << ", " << Y2 << endl;
124 gLog << "==============================================================="
125 << endl;
126
127 //---------------------
128
129 gLog << "==============================================================="
130 << endl;
131
132 th1 = th2;
133 ph1 = ph2;
134 X1 = 100.0;
135 Y1 = 50.0;
136 X2 = 0.0;
137 Y2 = 0.0;
138
139 trans.LocCamCamToLoc(th1, ph1, X1, Y1, X2, Y2, th2, ph2);
140 gLog << "th1, ph1, X1, Y1, th2, ph2, X2, Y2 = "
141 << th1 << ", " << ph1 << "; " << X1 << ", " << Y1 << "; "
142 << th2 << ", " << ph2 << "; " << X2 << ", " << Y2 << endl;
143
144 trans.LocCamToLoc0(th1, ph1, X1, Y1, th2, ph2);
145 gLog << "th1, ph1, X1, Y1, th2, ph2, X2, Y2 = "
146 << th1 << ", " << ph1 << "; " << X1 << ", " << Y1 << "; "
147 << th2 << ", " << ph2 << "; " << X2 << ", " << Y2 << endl;
148
149 trans.Loc0CamToLoc(th2, ph2, X1, Y1, th1, ph1);
150 gLog << "th1, ph1, X1, Y1, th2, ph2, X2, Y2 = "
151 << th1 << ", " << ph1 << "; " << X1 << ", " << Y1 << "; "
152 << th2 << ", " << ph2 << "; " << X2 << ", " << Y2 << endl;
153
154 trans.Loc0LocToCam(th2, ph2, th1, ph1, X1, Y1);
155 gLog << "th1, ph1, X1, Y1, th2, ph2, X2, Y2 = "
156 << th1 << ", " << ph1 << "; " << X1 << ", " << Y1 << "; "
157 << th2 << ", " << ph2 << "; " << X2 << ", " << Y2 << endl;
158
159 trans.LocCamLocToCam(th1, ph1, X1, Y1, th2, ph2, X2, Y2);
160 gLog << "th1, ph1, X1, Y1, th2, ph2, X2, Y2 = "
161 << th1 << ", " << ph1 << "; " << X1 << ", " << Y1 << "; "
162 << th2 << ", " << ph2 << "; " << X2 << ", " << Y2 << endl;
163
164 gLog << "==============================================================="
165 << endl;
166
167 gLog << "==============================================================="
168 << endl;
169
170 Double_t de1 = 10.0;
171 Double_t ho1 = 200.0;
172 Double_t XX1 = 0.0;
173 Double_t YY1 = 0.0;
174 Double_t XX2 = 100.0;
175 Double_t YY2 = 50.0;
176 Double_t de2;
177 Double_t ho2;
178
179 trans.CelCamCamToCel(de1, ho1, XX1, YY1, XX2, YY2, de2, ho2);
180 gLog << "de1, ho1, XX1, YY1, de2, ho2, XX2, YY2 = "
181 << de1 << ", " << ho1 << "; " << XX1 << ", " << YY1 << "; "
182 << de2 << ", " << ho2 << "; " << XX2 << ", " << YY2 << endl;
183
184 trans.Cel0CamToCel(de1, ho1, XX2, YY2, de2, ho2);
185 gLog << "de1, ho1, XX1, YY1, de2, ho2, XX2, YY2 = "
186 << de1 << ", " << ho1 << "; " << XX1 << ", " << YY1 << "; "
187 << de2 << ", " << ho2 << "; " << XX2 << ", " << YY2 << endl;
188
189 trans.CelCamCelToCam(de1, ho1, XX1, YY1, de2, ho2, XX2, YY2);
190 gLog << "de1, ho1, XX1, YY1, de2, ho2, XX2, YY2 = "
191 << de1 << ", " << ho1 << "; " << XX1 << ", " << YY1 << "; "
192 << de2 << ", " << ho2 << "; " << XX2 << ", " << YY2 << endl;
193
194 trans.Cel0CelToCam(de1, ho1, de2, ho2, XX2, YY2);
195 gLog << "de1, ho1, XX1, YY1, de2, ho2, XX2, YY2 = "
196 << de1 << ", " << ho1 << "; " << XX1 << ", " << YY1 << "; "
197 << de2 << ", " << ho2 << "; " << XX2 << ", " << YY2 << endl;
198
199
200 gLog << "==============================================================="
201 << endl;
202
203 gLog << "==============================================================="
204 << endl;
205
206 de1 = de2;
207 ho1 = ho2;
208 XX1 = 100.0;
209 YY1 = 50.0;
210 XX2 = 0.0;
211 YY2 = 0.0;
212
213 trans.CelCamCamToCel(de1, ho1, XX1, YY1, XX2, YY2, de2, ho2);
214 gLog << "de1, ho1, XX1, YY1, de2, ho2, XX2, YY2 = "
215 << de1 << ", " << ho1 << "; " << XX1 << ", " << YY1 << "; "
216 << de2 << ", " << ho2 << "; " << XX2 << ", " << YY2 << endl;
217
218 trans.CelCamToCel0(de1, ho1, XX1, YY1, de2, ho2);
219 gLog << "de1, ho1, XX1, YY1, de2, ho2, XX2, YY2 = "
220 << de1 << ", " << ho1 << "; " << XX1 << ", " << YY1 << "; "
221 << de2 << ", " << ho2 << "; " << XX2 << ", " << YY2 << endl;
222
223 trans.CelCamCelToCam(de1, ho1, XX1, YY1, de2, ho2, XX2, YY2);
224 gLog << "de1, ho1, XX1, YY1, de2, ho2, XX2, YY2 = "
225 << de1 << ", " << ho1 << "; " << XX1 << ", " << YY1 << "; "
226 << de2 << ", " << ho2 << "; " << XX2 << ", " << YY2 << endl;
227
228 gLog << "==============================================================="
229 << endl;
230
231 //---------------------
232
233 gLog << "==============================================================="
234 << endl;
235
236 th1 = 70.0;
237 ph1 = 200.0;
238 X1 = 100.0;
239 Y1 = 50.0;
240 X2 = 120.0;
241 Y2 = -30.0;
242
243 Double_t th0;
244 Double_t ph0;
245
246 trans.LocCamCamToLoc(th1, ph1, X1, Y1, X2, Y2, th2, ph2);
247 gLog << "th1, ph1, X1, Y1, th2, ph2, X2, Y2 = "
248 << th1 << ", " << ph1 << "; " << X1 << ", " << Y1 << "; "
249 << th2 << ", " << ph2 << "; " << X2 << ", " << Y2 << endl;
250
251 trans.LocCamCamToLoc(th2, ph2, X2, Y2, X1, Y1, th1, ph1);
252 gLog << "th1, ph1, X1, Y1, th2, ph2, X2, Y2 = "
253 << th1 << ", " << ph1 << "; " << X1 << ", " << Y1 << "; "
254 << th2 << ", " << ph2 << "; " << X2 << ", " << Y2 << endl;
255
256 trans.LocCamToLoc0(th1, ph1, X1, Y1, th0, ph0);
257 gLog << "th0, ph0 = " << th0 << ", " << ph0 << endl;
258
259 trans.Loc0CamToLoc(th0, ph0, X1, Y1, th1, ph1);
260 gLog << "th1, ph1 = " << th1 << ", " << ph1 << endl;
261
262 trans.Loc0CamToLoc(th0, ph0, X2, Y2, th2, ph2);
263 gLog << "th1, ph1, X1, Y1, th2, ph2, X2, Y2 = "
264 << th1 << ", " << ph1 << "; " << X1 << ", " << Y1 << "; "
265 << th2 << ", " << ph2 << "; " << X2 << ", " << Y2 << endl;
266
267 trans.LocCamToLoc0(th2, ph2, X2, Y2, th0, ph0);
268 gLog << "th0, ph0 = " << th0 << ", " << ph0 << endl;
269 gLog << "th1, ph1, X1, Y1, th2, ph2, X2, Y2 = "
270 << th1 << ", " << ph1 << "; " << X1 << ", " << Y1 << "; "
271 << th2 << ", " << ph2 << "; " << X2 << ", " << Y2 << endl;
272
273 trans.LocCamLocToCam(th1, ph1, X1, Y1, th2, ph2, X2, Y2);
274 gLog << "th1, ph1, X1, Y1, th2, ph2, X2, Y2 = "
275 << th1 << ", " << ph1 << "; " << X1 << ", " << Y1 << "; "
276 << th2 << ", " << ph2 << "; " << X2 << ", " << Y2 << endl;
277
278 trans.LocCamLocToCam(th2, ph2, X2, Y2, th1, ph1, X1, Y1);
279 gLog << "th1, ph1, X1, Y1, th2, ph2, X2, Y2 = "
280 << th1 << ", " << ph1 << "; " << X1 << ", " << Y1 << "; "
281 << th2 << ", " << ph2 << "; " << X2 << ", " << Y2 << endl;
282
283 trans.LocCamToLoc0(th1, ph1, X1, Y1, th0, ph0);
284 gLog << "th0, ph0 = " << th0 << ", " << ph0 << endl;
285
286 trans.Loc0LocToCam(th0, ph0, th2, ph2, X2, Y2);
287
288 gLog << "th1, ph1, X1, Y1, th2, ph2, X2, Y2 = "
289 << th1 << ", " << ph1 << "; " << X1 << ", " << Y1 << "; "
290 << th2 << ", " << ph2 << "; " << X2 << ", " << Y2 << endl;
291
292 gLog << "==============================================================="
293 << endl;
294
295 gLog << "==============================================================="
296 << endl;
297
298 th1 = th2;
299 ph1 = ph2;
300 X1 = 120.0;
301 Y1 = -30.0;
302 X2 = 100.0;
303 Y2 = 50.0;
304
305 Double_t th0;
306 Double_t ph0;
307
308 trans.LocCamCamToLoc(th1, ph1, X1, Y1, X2, Y2, th2, ph2);
309 gLog << "th1, ph1, X1, Y1, th2, ph2, X2, Y2 = "
310 << th1 << ", " << ph1 << "; " << X1 << ", " << Y1 << "; "
311 << th2 << ", " << ph2 << "; " << X2 << ", " << Y2 << endl;
312
313 trans.LocCamToLoc0(th1, ph1, X1, Y1, th0, ph0);
314 gLog << "th0, ph0 = " << th0 << ", " << ph0 << endl;
315
316 trans.Loc0CamToLoc(th0, ph0, X2, Y2, th2, ph2);
317
318 gLog << "th1, ph1, X1, Y1, th2, ph2, X2, Y2 = "
319 << th1 << ", " << ph1 << "; " << X1 << ", " << Y1 << "; "
320 << th2 << ", " << ph2 << "; " << X2 << ", " << Y2 << endl;
321
322 trans.LocCamLocToCam(th1, ph1, X1, Y1, th2, ph2, X2, Y2);
323 gLog << "th1, ph1, X1, Y1, th2, ph2, X2, Y2 = "
324 << th1 << ", " << ph1 << "; " << X1 << ", " << Y1 << "; "
325 << th2 << ", " << ph2 << "; " << X2 << ", " << Y2 << endl;
326
327 trans.LocCamToLoc0(th1, ph1, X1, Y1, th0, ph0);
328 gLog << "th0, ph0 = " << th0 << ", " << ph0 << endl;
329
330 trans.Loc0LocToCam(th0, ph0, th2, ph2, X2, Y2);
331
332 gLog << "th1, ph1, X1, Y1, th2, ph2, X2, Y2 = "
333 << th1 << ", " << ph1 << "; " << X1 << ", " << Y1 << "; "
334 << th2 << ", " << ph2 << "; " << X2 << ", " << Y2 << endl;
335
336 gLog << "==============================================================="
337 << endl;
338
339 gLog << "==============================================================="
340 << endl;
341
342 Double_t de1 = 10.0;
343 Double_t ho1 = 3.0;
344 Double_t XX1 = -30.0;
345 Double_t YY1 = 200.0;
346 Double_t XX2 = 100.0;
347 Double_t YY2 = 50.0;
348 Double_t de2;
349 Double_t ho2;
350
351 trans.CelCamCamToCel(de1, ho1, XX1, YY1, XX2, YY2, de2, ho2);
352 gLog << "de1, ho1, XX1, YY1, de2, ho2, XX2, YY2 = "
353 << de1 << ", " << ho1 << "; " << XX1 << ", " << YY1 << "; "
354 << de2 << ", " << ho2 << "; " << XX2 << ", " << YY2 << endl;
355
356 Double_t de0;
357 Double_t ho0;
358 trans.CelCamToCel0(de1, ho1, XX1, YY1, de0, ho0);
359 gLog << "de0, ho0 = " << de0 << ", " << ho0 << endl;
360
361 trans.Cel0CamToCel(de0, ho0, XX2, YY2, de2, ho2);
362 gLog << "de1, ho1, XX1, YY1, de2, ho2, XX2, YY2 = "
363 << de1 << ", " << ho1 << "; " << XX1 << ", " << YY1 << "; "
364 << de2 << ", " << ho2 << "; " << XX2 << ", " << YY2 << endl;
365
366 trans.CelCamCelToCam(de1, ho1, XX1, YY1, de2, ho2, XX2, YY2);
367 gLog << "de1, ho1, XX1, YY1, de2, ho2, XX2, YY2 = "
368 << de1 << ", " << ho1 << "; " << XX1 << ", " << YY1 << "; "
369 << de2 << ", " << ho2 << "; " << XX2 << ", " << YY2 << endl;
370
371 trans.CelCamToCel0(de1, ho1, XX1, YY1, de0, ho0);
372 gLog << "de0, ho0 = " << de0 << ", " << ho0 << endl;
373
374 trans.Cel0CelToCam(de0, ho0, de2, ho2, XX2, YY2);
375 gLog << "de1, ho1, XX1, YY1, de2, ho2, XX2, YY2 = "
376 << de1 << ", " << ho1 << "; " << XX1 << ", " << YY1 << "; "
377 << de2 << ", " << ho2 << "; " << XX2 << ", " << YY2 << endl;
378
379
380 gLog << "==============================================================="
381 << endl;
382
383 gLog << "==============================================================="
384 << endl;
385
386 de1 = de2;
387 ho1 = ho2;
388 XX1 = 100.0;
389 YY1 = 50.0;
390 XX2 = -30.0;
391 YY2 = 200.0;
392
393 trans.CelCamCamToCel(de1, ho1, XX1, YY1, XX2, YY2, de2, ho2);
394 gLog << "de1, ho1, XX1, YY1, de2, ho2, XX2, YY2 = "
395 << de1 << ", " << ho1 << "; " << XX1 << ", " << YY1 << "; "
396 << de2 << ", " << ho2 << "; " << XX2 << ", " << YY2 << endl;
397
398 Double_t de0;
399 Double_t ho0;
400 trans.CelCamToCel0(de1, ho1, XX1, YY1, de0, ho0);
401 gLog << "de0, ho0 = " << de0 << ", " << ho0 << endl;
402
403 trans.Cel0CamToCel(de0, ho0, XX2, YY2, de2, ho2);
404 gLog << "de1, ho1, XX1, YY1, de2, ho2, XX2, YY2 = "
405 << de1 << ", " << ho1 << "; " << XX1 << ", " << YY1 << "; "
406 << de2 << ", " << ho2 << "; " << XX2 << ", " << YY2 << endl;
407
408 trans.CelCamCelToCam(de1, ho1, XX1, YY1, de2, ho2, XX2, YY2);
409 gLog << "de1, ho1, XX1, YY1, de2, ho2, XX2, YY2 = "
410 << de1 << ", " << ho1 << "; " << XX1 << ", " << YY1 << "; "
411 << de2 << ", " << ho2 << "; " << XX2 << ", " << YY2 << endl;
412
413 trans.CelCamToCel0(de1, ho1, XX1, YY1, de0, ho0);
414 gLog << "de0, ho0 = " << de0 << ", " << ho0 << endl;
415
416 trans.Cel0CelToCam(de0, ho0, de2, ho2, XX2, YY2);
417 gLog << "de1, ho1, XX1, YY1, de2, ho2, XX2, YY2 = "
418 << de1 << ", " << ho1 << "; " << XX1 << ", " << YY1 << "; "
419 << de2 << ", " << ho2 << "; " << XX2 << ", " << YY2 << endl;
420
421
422 gLog << "==============================================================="
423 << endl;
424
425}
426//=========================================================================
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
Note: See TracBrowser for help on using the repository browser.