source: trunk/MagicSoft/Mars/mpointing/MPointingDevCalc.cc@ 9369

Last change on this file since 9369 was 9195, checked in by tbretz, 16 years ago
*** empty log message ***
File size: 24.6 KB
Line 
1/* ======================================================================== *\
2!
3! *
4! * This file is part of MARS, the MAGIC Analysis and Reconstruction
5! * Software. It is distributed to you in the hope that it can be a useful
6! * and timesaving tool in analysing Data of imaging Cerenkov telescopes.
7! * It is distributed WITHOUT ANY WARRANTY.
8! *
9! * Permission to use, copy, modify and distribute this software and its
10! * documentation for any purpose is hereby granted without fee,
11! * provided that the above copyright notice appear in all copies and
12! * that both that copyright notice and this permission notice appear
13! * in supporting documentation. It is provided "as is" without express
14! * or implied warranty.
15! *
16!
17!
18! Author(s): Thomas Bretz, 07/2005 <mailto:tbretz@astro.uni-wuerzburg.de>
19!
20! Copyright: MAGIC Software Development, 2000-2007
21!
22!
23\* ======================================================================== */
24
25/////////////////////////////////////////////////////////////////////////////
26//
27// MPointingDevCalc
28//
29// Calculates the pointing deviation from the starguider information.
30//
31// There are some quality parameters to steer which are the valid
32// starguider data points:
33//
34// * MPointingDevCalc.NumMinStars: 8
35// Minimum number of identified stars required to accep the data
36//
37// * MPointingDevCalc.NsbLevel: 3.0
38// Minimum deviation (in rms) from the the mean allowed for the
39// measured NSB (noise in the ccd camera)
40//
41// * MPointingDevCalc.NsbMin: 30
42// - minimum NSB to be used in mean/rms calculation
43//
44// * MPointingDevCalc.NsbMax: 60
45// - maximum NSB to be used in mean/rms calculation
46//
47// * MPointingDevCalc.MaxAbsDev: 15
48// - Maximum absolute deviation which is consideres as valid (arcmin)
49//
50// Starguider data which doens't fullfill this requirements is ignored.
51// If the measures NSB==0 (file too old, starguider didn't write down
52// these values) the checks based on NSB and NumMinStar are skipped.
53//
54// The calculation of NSB mean and rms is reset for each file (ReInit)
55//
56// If your starguider data doesn't fullfill this requirement the latest
57// value which could be correctly calculated is used instead. If the time
58// for which no valid value can be calculated exceeds one minute
59// the return value is reset to 0/0. The maximum time allowed without
60// a valid value can be setup using:
61//
62// * MPointingDevCalc.MaxAge: 1
63// Maximum time before the starguider is reset to 0/0 in minutes
64//
65// Note, that the starguider itself is not well calibrated. Therefore
66// it is necessary to do a starguider calibration in our software.
67//
68// There are two options:
69//
70// * Simple starguider calibration using offsets in the camera plane
71//
72// The starguider is calibrated by taking its values (dZd/dAz)
73// adding them to the source position, calculating the source position
74// in the camera plane and adding the offsets. To switch off the
75// full starguider calibration do:
76//
77// * MPointingDevCalc.PointingModels:
78//
79// To set the offsets (in units of degree) use
80//
81// * MPointingDevCalc.Dx: -0.001
82// * MPointingDevCalc.Dy: -0.004
83//
84// * A starguider calibration using a pointing model calculated
85// from calibration data, so called TPoints
86//
87// Because the pointing model can change from time to time
88// you can give the run-number from which on a new pointing
89// model is valid. The run itself is included, e.g.:
90//
91// * MPointingDevCalc.PointingModels: 85240 89180
92// * MPointingDevCalc.FilePrefix: resources/starguider
93//
94// mean that for all runs<85240 the simple offset correction is used.
95// For runs >=85240 and <89180 the file resources/starguider0085240.txt
96// and for runs >=89180 the file resources/starguider0089180.txt is
97// used. To setup a default file for all runs before 85240 setup
98// a low number (eg. 0 or 1)
99//
100// In the case a pointing model is used additional offsets in
101// the x/y-camera plane (in units of deg) can be set using the DX
102// and DY parameters of the pointing model. The fDx and fDy data
103// members of this class are ignored. To overwrite the starguider
104// calibrated offset in either Az or Zd with a constant, you
105// can use the PX/PY directive in the pointing model. (To enable
106// the overwrite set the third column, the error, to a value
107// greater than zero)
108//
109//
110// At the PostProcessing step a table with statistics is print if the
111// debug level is greater or equal 3 (in most applications it is switched
112// on by -v3)
113//
114//
115// Pointing Models:
116// ----------------
117//
118// What we know so far about (maybe) important changes in cosy:
119//
120// 18.03.2006: The camera holding has been repaired and the camera got
121// shifted a little bit.
122//
123// 16.04.2006: Around this date a roque lamp focussing hass been done
124//
125// 25.04.2006: A missalignment intrduced with the roque adjust has been
126// corrected
127//
128// The starguider pointing model for the time before 18.3.2006 and after
129// April 2006 (in fact there are no TPoints until 07/2006 to check it)
130// and for the period 07/2006 to (at least) 06/2007 are very similar.
131//
132// The pointing model for the time between 18.3.2006 and 04/2006 is
133// clearly different, mainly giving different Azimuth values between
134// Zenith and roughly ~25deg, and a slight offset on both axes.
135//
136// 10.5.2006: pos1 -= pos0 commented (What was the mentioned fix?)
137// 29.6.2006: repaired
138//
139// 23.3.2006: new starguider algorithm
140//
141// 17.3.2005: Fixed units of "nompos" in MDriveCom
142//
143//
144// New pointing models have been installed (if the pointing model
145// is different, than the previous one it might mean, that also
146// the starguider calibration is different.) The date only means
147// day-time (noon) at which the model has been changed.
148//
149// 29. Apr. 2004 ~25800
150// 5. Aug. 2004 ~32000
151// 19. Aug. 2004 ~33530
152// 7. Jun. 2005 ~57650
153// 8. Jun. 2005
154// 9. Jun. 2005 ~57860
155// 12. Sep. 2005 ~68338
156// 24. Nov. 2005 ~75562
157// 17. Oct. 2006 ~103130
158// 17. Jun. 2007 ~248193
159// 18. Oct. 2007 291104 // Correction for the offsets introduced by AMC
160// 14. Jan. 2008 328198 // Complete new pointing model
161// 11. Jun. 2008 (ca. 23:00) // Before new TPoints
162// 19. Jun. 2008 (ca. 15:00) // From new TPoints
163//
164// From 2.2.2006 beginnig of the night (21:05h, run >=81855) to 24.2.2006
165// beginning of the the night (20:34h, run<83722) the LEDs did not work.
166// In the time after this incident the shift crew often forgot to switch on
167// the LEDs at the beginning of the night!
168//
169// [2006-03-07 00:10:58] In the daytime, we raised the position of the
170// 9 o'clock LED by one screw hole to make it visible when the TPoint
171// Lid is closed. (< run 84980)
172//
173// Mirror refocussing around 23.Apr.2006, from the Runbook.
174//
175// 25./26.4.2006: Run 89180
176//
177// (Note: The year here is not a typo!)
178// [2007-04-25 23:50:39]
179// Markus is performing AMC focussing.
180//
181// Mirror refocussing around 4.Aug.2007, from the Runbook:
182//
183// [2007-08-04 04:46:47]
184// We finished with the focussing with Polaris. The images need to be
185// analysed and new LUTs generated.
186//
187// [2007-08-04 23:47:30]
188// Actually we see that the mispointing is always large; probably since
189// the LUT tables have not yet been adjusted to the new focussing.
190//
191// [2007-08-03 23:07:58]
192// Data taking stopped. Mirror focussing.
193//
194// [2007-08-05 00:09:16]
195// We take some pictures on stars nearby Cyg X3 with the sbig camera;
196// actually the spot doesn't look very nice... The pictures have been
197// saved with name Deneb- and Sadr- Polaris seems a bit better. Should we
198// have new LUT tables after the focussing?
199//
200// [2007-08-10 20:18:48]
201// Tonight we take first images of Polaris with a new LUT file generated
202// based on the recent focussing. The image will be analysed tomorrow and
203// than new LUTs will be generated. For tonight the focussing is still not
204// changed.
205//
206// [2007-08-14 20:57:59]
207// The weather is fine. There is a group of hobby astronomers at the
208// helicopter parking. Before data taking, we tried to check the new LUTs.
209// However, because of technical problems with the new LUTs we had to
210// postpone the measurements. We lost some 10 min of data taking because
211// of this.
212//
213// [2007-08-14 22:29:37] Run 267253
214// Before continuing the observation we perform a focussing test with the
215// new LUTs from recent Polaris focussing. Note: Data on Her X-1 was taken
216// with old focussing. We performed PSF measurements on Kornephorus (Zd
217// 31.77, Az 264,67) first with old LUTs and then with new LUTs. We took
218// T-points with both focussing. The first T-Point corresponds to the
219// previous focussing and the second with the improved. Please check both
220// T-points for eventual misspointing. We found big improvement of the PSF
221// with the new LUTs and will therefore continue from now on with the new
222// focussing. Having a first look at the SBIG pictures we see a slightly
223// misspointing of ~0.1 deg with the new LUTs.
224//
225// [2007-08-14 22:46:10]
226// Comparing the trigger rate with yesterday night we do not see an
227// improvement with the new focussing.
228//
229// [2007-10-27 email]
230// [...]
231// When removing the cover of the motor all 4 nuts which fix the gear of
232// the motor to the structure fell out. The motor was completely loose.
233// [...]
234// We checked also the second azimuth motor and .. the same situation.
235// [...]
236// Peter Sawallisch opened and fixed all 3 motors of MAGIC-I. We checked
237// all critical screws that came to our minds and fixed them as much as
238// possible with loctite and counter nuts. No damage whatsoever has been
239// found.
240//
241//
242// ToDo:
243// -----
244//
245// * Is 0/0 the best assumption if the starguider partly fails?
246//
247//
248// Input Container:
249// MRawRunHeader
250// MReportStarguider
251//
252// Output Container:
253// MPointingDev
254//
255/////////////////////////////////////////////////////////////////////////////
256#include "MPointingDevCalc.h"
257
258#include <stdlib.h> // atoi (Ubuntu 8.10)
259
260#include "MLog.h"
261#include "MLogManip.h"
262
263#include "MParList.h"
264
265#include "MAstro.h"
266#include "MPointing.h"
267#include "MPointingDev.h"
268#include "MRawRunHeader.h"
269#include "MReportStarguider.h"
270
271ClassImp(MPointingDevCalc);
272
273using namespace std;
274
275const TString MPointingDevCalc::fgFilePrefix="resources/starguider";
276
277// --------------------------------------------------------------------------
278//
279// Destructor. Call Clear() and delete fPointingModels if any.
280//
281MPointingDevCalc::~MPointingDevCalc()
282{
283 Clear();
284}
285
286// --------------------------------------------------------------------------
287//
288// Delete fPointing and set pointing to NULL
289//
290void MPointingDevCalc::Clear(Option_t *o)
291{
292 if (fPointing)
293 delete fPointing;
294
295 fPointing = NULL;
296}
297
298// --------------------------------------------------------------------------
299//
300// Sort the entries in fPoinitngModels
301//
302void MPointingDevCalc::SortPointingModels()
303{
304 const int n = fPointingModels.GetSize();
305
306 TArrayI idx(n);
307
308 TMath::Sort(n, fPointingModels.GetArray(), idx.GetArray(), kFALSE);
309
310 const TArrayI arr(fPointingModels);
311
312 for (int i=0; i<n; i++)
313 fPointingModels[i] = arr[idx[i]];
314}
315
316// --------------------------------------------------------------------------
317//
318// Set new pointing models
319//
320void MPointingDevCalc::SetPointingModels(const TString &models)
321{
322 fPointingModels.Set(0);
323
324 if (models.IsNull())
325 return;
326
327 TObjArray *arr = models.Tokenize(" ");
328
329 const int n = arr->GetEntries();
330 fPointingModels.Set(n);
331
332 for (int i=0; i<n; i++)
333 fPointingModels[i] = atoi((*arr)[i]->GetName());
334
335 delete arr;
336
337 SortPointingModels();
338}
339
340// --------------------------------------------------------------------------
341//
342// Return a string with the pointing models, seperated by a space.
343//
344TString MPointingDevCalc::GetPointingModels() const
345{
346 TString rc;
347 for (int i=0; i<fPointingModels.GetSize(); i++)
348 rc += Form ("%d ", fPointingModels[i]);
349
350 return rc;
351}
352
353// --------------------------------------------------------------------------
354//
355// Add a number to the pointing models
356//
357void MPointingDevCalc::AddPointingModel(UInt_t runnum)
358{
359 const int n = fPointingModels.GetSize();
360 for (int i=0; i<n; i++)
361 if ((UInt_t)fPointingModels[i]==runnum)
362 {
363 *fLog << warn << "WARNING - Pointing model " << runnum << " already in list... ignored." << endl;
364 return;
365 }
366
367 fPointingModels.Set(n+1);
368 fPointingModels[n] = runnum;
369
370 SortPointingModels();
371}
372
373// --------------------------------------------------------------------------
374//
375// Find the highest number in the array which is lower or equal num.
376//
377UInt_t MPointingDevCalc::FindPointingModel(UInt_t num)
378{
379 const int n = fPointingModels.GetSize();
380 if (n==0)
381 return (UInt_t)-1;
382
383 // Loop over all pointing models
384 for (int i=0; i<n; i++)
385 {
386 // The number stored in the array did not yet overtake the runnumber
387 if ((UInt_t)fPointingModels[i]<num)
388 continue;
389
390 // The first pointing model is later than this run: use a default
391 if (i==0)
392 return (UInt_t)-1;
393
394 // The last entry in the array is the right one.
395 return fPointingModels[i-1];
396 }
397
398 // Runnumber is after last entry of pointing models. Use the last one.
399 return fPointingModels[n-1];
400}
401
402// --------------------------------------------------------------------------
403//
404// Clear the pointing model. If run-number >= 87751 read the new
405// pointing model with fFilePrefix
406//
407Bool_t MPointingDevCalc::ReadPointingModel(const MRawRunHeader &run)
408{
409 const UInt_t num = FindPointingModel(run.GetRunNumber());
410
411 // No poinitng models are defined. Use simple dx/dy-calibration
412 if (num==(UInt_t)-1)
413 {
414 Clear();
415 return kTRUE;
416 }
417
418 // compile the name for the starguider files
419 // The file with the number 00000000 is the default file
420 TString fname = Form("%s%08d.txt", fFilePrefix.Data(), num);
421
422 if (!fPointing)
423 fPointing = new MPointing;
424
425 if (fname==fPointing->GetName())
426 {
427 *fLog << inf << fname << " already loaded." << endl;
428 return kTRUE;
429 }
430
431 return fPointing->Load(fname);
432}
433
434// --------------------------------------------------------------------------
435//
436// Check the file/run type from the run-header and if it is a data file
437// load starguider calibration.
438//
439Bool_t MPointingDevCalc::ReInit(MParList *plist)
440{
441 MRawRunHeader *run = (MRawRunHeader*)plist->FindObject("MRawRunHeader");
442 if (!run)
443 {
444 *fLog << err << "MRawRunHeader not found... aborting." << endl;
445 return kFALSE;
446 }
447
448 fNsbSum = 0;
449 fNsbSq = 0;
450 fNsbCount = 0;
451
452 fRunType = run->GetRunType();
453
454 switch (fRunType)
455 {
456 case MRawRunHeader::kRTData:
457 if (!fReport)
458 *fLog << warn << "MReportStarguider not found... skipped." << endl;
459 return ReadPointingModel(*run);
460
461 case MRawRunHeader::kRTMonteCarlo:
462 return kTRUE;
463
464 case MRawRunHeader::kRTPedestal:
465 *fLog << err << "Cannot work in a pedestal Run!... aborting." << endl;
466 return kFALSE;
467
468 case MRawRunHeader::kRTCalibration:
469 *fLog << err << "Cannot work in a calibration Run!... aborting." << endl;
470 return kFALSE;
471
472 default:
473 *fLog << err << "Run Type " << fRunType << " unknown!... aborting." << endl;
474 return kFALSE;
475 }
476
477 return kTRUE;
478}
479
480// --------------------------------------------------------------------------
481//
482// Search for 'MPointingPos'. Create if not found.
483//
484Int_t MPointingDevCalc::PreProcess(MParList *plist)
485{
486 fDeviation = (MPointingDev*)plist->FindCreateObj("MPointingDev");
487 fReport = (MReportStarguider*)plist->FindObject("MReportStarguider");
488
489 // We use kRTNone here as a placeholder for data runs.
490 fRunType = MRawRunHeader::kRTNone;
491 fLastMjd = -1;
492
493 fSkip.Reset();
494
495 // In cases in which ReInit isn't called right in time (e.g. if
496 // the first starguider event comes before the first data event)
497 fNsbSum = 0;
498 fNsbSq = 0;
499 fNsbCount = 0;
500
501 return fDeviation ? kTRUE : kFALSE;
502}
503
504// --------------------------------------------------------------------------
505//
506// Increase fSkip[i] by one. If the data in fDeviation is outdated (older
507// than fMaxAge) and the current report should be skipped reset DevZdAz and
508// DevXY and fSkip[6] is increased by one.
509//
510void MPointingDevCalc::Skip(Int_t i)
511{
512 fSkip[i]++;
513
514 const Double_t diff = (fReport->GetMjd()-fLastMjd)*1440; // [min] 1440=24*60
515 if (diff<fMaxAge && fLastMjd>0)
516 return;
517
518 fDeviation->SetDevZdAz(0, 0);
519 fDeviation->SetDevXY(0, 0);
520 fSkip[6]++;
521}
522
523// --------------------------------------------------------------------------
524//
525// Do a full starguider calibration using a pointing model for the starguider.
526//
527void MPointingDevCalc::DoCalibration(Double_t devzd, Double_t devaz) const
528{
529 if (!fPointing)
530 {
531 // Do a simple starguider calibration using a simple offset in x and y
532 fDeviation->SetDevZdAz(devzd, devaz);
533
534 // Linear starguider calibration taken from April/May data
535 // For calibration add MDriveReport::GetErrorZd/Az !
536 fDeviation->SetDevXY(fDx, fDy); // 1arcmin ~ 5mm
537
538 return;
539 }
540
541 // Get the nominal position the star is at the sky
542 // Unit: deg
543 ZdAz nom(fReport->GetNominalZd(), fReport->GetNominalAz());
544 nom *= TMath::DegToRad();
545
546 // Get the mispointing measured by the telescope. It is
547 // calculate as follows:
548 //
549 // The mispointing measured by the starguider:
550 // ZdAz mis(devzd, devaz);
551 // mis *= TMath::DegToRad();
552
553 // The pointing model is the conversion from the real pointing
554 // position of the telescope into the pointing position measured
555 // by the starguider.
556 //
557 // To keep as close to the fitted model we use the forward correction.
558
559 // Position at which the starguider camera is pointing in real:
560 // pointing position = nominal position - dev
561 //
562 // The position measured as the starguider's pointing position
563 ZdAz pos(nom); // cpos = sao - dev
564 pos -= ZdAz(devzd, devaz)*TMath::DegToRad();
565
566 // Now we convert the starguider's pointing position into the
567 // telescope pointing position (the pointing model converts
568 // the telescope pointing position into the starguider pointing
569 // position)
570 ZdAz point = fPointing->CorrectBack(pos); //FWD!!!
571
572 // MSrcPosCalc uses the following condition to calculate the
573 // source position in the camera:
574 // real pointing pos = nominal pointing pos - dev
575 // --> dev = nominal - real
576 // Therefor we calculate dev as follows:
577 ZdAz dev(nom);
578 dev -= point;
579 dev *= TMath::RadToDeg();
580
581 /*
582 // We chose the other way. It is less accurate because is is the
583 // other was than the poinitng model was fittet, but it is more
584 // accurate because the nominal (i.e. real) pointing position
585 // is less accurately known than the position returned by the
586 // starguider.
587 //
588 // Calculate the deviation which would be measured by the starguider
589 // if applied to a perfectly pointing telescope.
590 ZdAz dev = fPointing->Correct(nom);
591 dev -= nom;
592
593 // Now add these offsets and the starguider measured offsets to
594 // the real pointing deviation of the telescope (note, that
595 // signs here are just conventions)
596 dev += ZdAz(devzd, devaz)*TMath::DegToRad(); // --> nom-mis
597 dev *= TMath::RadToDeg();
598 */
599
600 // Check if the starguider pointing model requests overwriting
601 // of the values with constants (e.g. 0)
602 devaz = fPointing->IsPxValid() ? fPointing->GetPx() : dev.Az();
603 devzd = fPointing->IsPyValid() ? fPointing->GetPy() : dev.Zd();
604
605 fDeviation->SetDevZdAz(devzd, devaz);
606 fDeviation->SetDevXY(fPointing->GetDxy());
607}
608
609Int_t MPointingDevCalc::ProcessStarguiderReport()
610{
611 Double_t devzd = fReport->GetDevZd(); // [arcmin]
612 Double_t devaz = fReport->GetDevAz(); // [arcmin]
613 if (devzd==0 && devaz==0)
614 {
615 Skip(1);
616 return kTRUE;
617 }
618
619 if (!fReport->IsMonitoring())
620 {
621 Skip(2);
622 return kTRUE;
623 }
624
625 devzd /= 60; // Convert from arcmin to deg
626 devaz /= 60; // Convert from arcmin to deg
627
628 const Double_t nsb = fReport->GetSkyBrightness();
629 if (nsb>0)
630 {
631 if (nsb>fNsbMin && nsb<fNsbMax)
632 {
633 fNsbSum += nsb;
634 fNsbSq += nsb*nsb;
635 fNsbCount++;
636 }
637
638 if (fNsbCount>0)
639 {
640 const Double_t sum = fNsbSum/fNsbCount;
641 const Double_t sq = fNsbSq /fNsbCount;
642
643 const Double_t rms = fNsbLevel*TMath::Sqrt(sq - sum*sum);
644
645 if (nsb<sum-rms || nsb>sum+rms)
646 {
647 Skip(3);
648 return kTRUE;
649 }
650 }
651
652 if (fReport->GetNumIdentifiedStars()<fNumMinStars)
653 {
654 Skip(4);
655 return kTRUE;
656 }
657 }
658
659 // >= 87751 (31.3.06 12:00)
660
661 // Calculate absolute deviation
662 const Double_t dev = MAstro::GetDevAbs(fReport->GetNominalZd(), devzd, devaz);
663
664 // Sanity check... larger deviation are strange and ignored
665 if (dev*60>fMaxAbsDev)
666 {
667 Skip(5);
668 return kTRUE;
669 }
670
671 DoCalibration(devzd, devaz);
672
673 fSkip[0]++;
674 fLastMjd = fReport->GetMjd();
675
676 return kTRUE;
677}
678
679// --------------------------------------------------------------------------
680//
681// See class description.
682//
683Int_t MPointingDevCalc::Process()
684{
685 switch (fRunType)
686 {
687 case MRawRunHeader::kRTNone:
688 case MRawRunHeader::kRTData:
689 return fReport ? ProcessStarguiderReport() : kTRUE;
690
691 case MRawRunHeader::kRTMonteCarlo:
692 fSkip[0]++;
693 fDeviation->SetDevZdAz(0, 0);
694 fDeviation->SetDevXY(0, 0);
695 return kTRUE;
696 }
697 return kTRUE;
698}
699
700// --------------------------------------------------------------------------
701//
702// Print execution statistics
703//
704Int_t MPointingDevCalc::PostProcess()
705{
706 if (GetNumExecutions()==0)
707 return kTRUE;
708
709 *fLog << inf << endl;
710 *fLog << GetDescriptor() << " execution statistics:" << endl;
711 PrintSkipped(fSkip[1], "Starguider deviation not set, is exactly 0/0");
712 PrintSkipped(fSkip[2], "Starguider was not monitoring (eg. LEDs off)");
713 PrintSkipped(fSkip[3], Form("NSB out of %.1f sigma range", fNsbLevel));
714 PrintSkipped(fSkip[4], Form("Number of identified stars < %d", fNumMinStars));
715 PrintSkipped(fSkip[5], Form("Absolute deviation > %.1farcmin", fMaxAbsDev));
716 PrintSkipped(fSkip[6], Form("Events set to 0 because older than %.1fmin", fMaxAge));
717 *fLog << " " << (int)fSkip[0] << " (" << Form("%5.1f", 100.*fSkip[0]/GetNumExecutions()) << "%) Evts survived calculation!" << endl;
718 *fLog << endl;
719
720 return kTRUE;
721}
722
723// --------------------------------------------------------------------------
724//
725// MPointingDevCalc.NumMinStars: 8
726// MPointingDevCalc.NsbLevel: 3.0
727// MPointingDevCalc.NsbMin: 30
728// MPointingDevCalc.NsbMax: 60
729// MPointingDevCalc.MaxAbsDev: 15
730// MPointingDevCalc.MaxAge: 1.0
731// MPointingDevCalc.Dx: -0.001
732// MPointingDevCalc.Dy: -0.004
733//
734// For a detailed description see the class reference.
735//
736Int_t MPointingDevCalc::ReadEnv(const TEnv &env, TString prefix, Bool_t print)
737{
738 Bool_t rc = kFALSE;
739 if (IsEnvDefined(env, prefix, "NumMinStars", print))
740 {
741 SetNumMinStars(GetEnvValue(env, prefix, "NumMinStars", (Int_t)fNumMinStars));
742 rc = kTRUE;
743 }
744 if (IsEnvDefined(env, prefix, "NsbLevel", print))
745 {
746 SetNsbLevel(GetEnvValue(env, prefix, "NsbLevel", fNsbLevel));
747 rc = kTRUE;
748 }
749 if (IsEnvDefined(env, prefix, "NsbMin", print))
750 {
751 SetNsbMin(GetEnvValue(env, prefix, "NsbMin", fNsbMin));
752 rc = kTRUE;
753 }
754 if (IsEnvDefined(env, prefix, "NsbMax", print))
755 {
756 SetNsbMax(GetEnvValue(env, prefix, "NsbMax", fNsbMax));
757 rc = kTRUE;
758 }
759 if (IsEnvDefined(env, prefix, "MaxAbsDev", print))
760 {
761 SetMaxAbsDev(GetEnvValue(env, prefix, "MaxAbsDev", fMaxAbsDev));
762 rc = kTRUE;
763 }
764 if (IsEnvDefined(env, prefix, "Dx", print))
765 {
766 fDx = GetEnvValue(env, prefix, "Dx", fDx);
767 rc = kTRUE;
768 }
769 if (IsEnvDefined(env, prefix, "Dy", print))
770 {
771 fDy = GetEnvValue(env, prefix, "Dy", fDy);
772 rc = kTRUE;
773 }
774 if (IsEnvDefined(env, prefix, "MaxAge", print))
775 {
776 fMaxAge = GetEnvValue(env, prefix, "MaxAge", fMaxAge);
777 rc = kTRUE;
778 }
779 if (IsEnvDefined(env, prefix, "FilePrefix", print))
780 {
781 fFilePrefix = GetEnvValue(env, prefix, "FilePrefix", fFilePrefix);
782 rc = kTRUE;
783 }
784 if (IsEnvDefined(env, prefix, "PointingModels", print))
785 {
786 SetPointingModels(GetEnvValue(env, prefix, "PointingModels", GetPointingModels()));
787 rc = kTRUE;
788 }
789
790 return rc;
791}
Note: See TracBrowser for help on using the repository browser.