FACT++  1.0
AltAz MPointing::Correct ( const AltAz aaz) const

Definition at line 523 of file MPointing.cc.

References AltAz::Alt(), AltAz::Az(), and DEBUG.

524 {
525  // Correct [rad]
526  // zdaz [rad]
527  AltAz p = aa;
528 
529  DEBUG(cout << setprecision(16));
530  DEBUG(cout << "Bend7: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl);
531 
532  const AltAz CRX(-fCrx*sin(p.Az()-p.Alt()), fCrx*cos(p.Az()-p.Alt())/cos(p.Alt()));
533  const AltAz CRY(-fCry*cos(p.Az()-p.Alt()), -fCry*sin(p.Az()-p.Alt())/cos(p.Alt()));
534  p += CRX;
535  p += CRY;
536 
537  DEBUG(cout << "Bend6: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl);
538 
539  const AltAz NRX(fNrx*sin(p.Alt()), -fNrx);
540  const AltAz NRY(fNry*cos(p.Alt()), -fNry*tan(p.Alt()));
541  p += NRX;
542  p += NRY;
543 
544  DEBUG(cout << "Bend5: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl);
545 
546  const AltAz CES(-fEces*sin(p.Alt()), -fAces*sin(p.Az()));
547  const AltAz CEC(-fEcec*cos(p.Alt()), -fAcec*cos(p.Az()));
548  p += CES;
549  p += CEC;
550 
551  DEBUG(cout << "Bend4: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl);
552 
553  const AltAz TX(Sign(fTx/tan(p.Alt()), p.Alt()), 0);
554  const AltAz TF(Sign(fTf*cos(p.Alt()), p.Alt()), 0);
555  //p += TX;
556  p += TF;
557 
558 
559  DEBUG(cout << "Bend3: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl);
560 
561  /*
562  //New Corrections for NPAE and CA:
563  TVector3 v(1.,1.,1.); // Vector in cartesian coordinates
564 
565  //Set Azimuth and Elevation
566  v.SetPhi(p.Az());
567  v.SetTheta(TMath::Pi()/2-p.Alt());
568  //Rotation Vectors:
569  TVector3 vNpae( cos(p.Az()), sin(p.Az()), 0);
570  TVector3 vCa( -cos(p.Az())*cos(p.Alt()), -sin(p.Az())*cos(p.Alt()), sin(p.Alt()));
571  //Rotate around the vectors vNpae and vCa
572  v.Rotate(fNpae, vNpae);
573  v.Rotate(fCa, vCa);
574 
575  p.Az(v.Phi());
576  p.Alt(TMath::Pi()/2-v.Theta());
577  */
578 
579  //Old correction terms for Npae and Ca:
580  const AltAz CA(0, -fCa/cos(p.Alt()));
581  p += CA;
582 
583  const AltAz NPAE(0, -fNpae*tan(p.Alt()));
584  p += NPAE;
585 
586  DEBUG(cout << "Bend2: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl);
587 
588  const AltAz ANAW(CalcAnAw(p, -1));
589  p += ANAW;
590 
591  /* Old correction terms for An and Aw:
592  const AltAz AW( fAw*sin(p.Az()), -fAw*cos(p.Az())*tan(p.Alt()));
593  const AltAz AN(-fAn*cos(p.Az()), -fAn*sin(p.Az())*tan(p.Alt()));
594  p += AW;
595  p += AN;
596  */
597 
598  DEBUG(cout << "Bend1: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl);
599 
600  const AltAz FLOP(Sign(fFlop, p.Alt()), 0);
601  p += FLOP;
602 
603  const AltAz MAGIC1(fMagic1*TMath::Sign(1., sin(p.Az())), 0);
604  p += MAGIC1;
605 
606  const AltAz I(fIe, fIa);
607  p += I;
608 
609  DEBUG(cout << "Bend0: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl);
610 
611  return p;
612 }
double Alt() const
Definition: MPointing.h:40
Double_t fNry
Definition: MPointing.h:168
Double_t fTf
Definition: MPointing.h:165
static Double_t Sign(Double_t val, Double_t alt)
Definition: MPointing.cc:352
Double_t fAces
Definition: MPointing.h:172
Double_t fFlop
Definition: MPointing.h:160
Double_t fIe
Definition: MPointing.h:158
Double_t fEces
Definition: MPointing.h:171
Double_t fTx
Definition: MPointing.h:166
Double_t fEcec
Definition: MPointing.h:173
Double_t fCa
Definition: MPointing.h:162
Double_t fCrx
Definition: MPointing.h:169
#define DEBUG(txt)
Definition: MPointing.cc:101
Double_t fCry
Definition: MPointing.h:170
Double_t fNrx
Definition: MPointing.h:167
Double_t fIa
Definition: MPointing.h:159
Double_t fNpae
Definition: MPointing.h:161
AltAz CalcAnAw(const AltAz &p, Int_t sign) const
Definition: MPointing.cc:422
Double_t fMagic1
Definition: MPointing.h:175
double Az() const
Definition: MPointing.h:41
Double_t fAcec
Definition: MPointing.h:174

+ Here is the call graph for this function: