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

Definition at line 614 of file MPointing.cc.

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

615 {
616  // Correct [rad]
617  // zdaz [rad]
618  AltAz p = aa;
619 
620  DEBUG(cout << setprecision(16));
621  DEBUG(cout << "Back0: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl);
622 
623  const AltAz I(fIe, fIa);
624  p -= I;
625 
626  const AltAz MAGIC1(fMagic1*TMath::Sign(1., sin(p.Az())), 0);
627  p -= MAGIC1;
628 
629  //const AltAz MAGIC1(fMagic1*sin(p.Az()), 0);
630  //p -= MAGIC1;
631 
632  const AltAz FLOP(Sign(fFlop, p.Alt()), 0);
633  p -= FLOP;
634 
635  DEBUG(cout << "Back1: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl);
636 
637  /* Old correction terms for An and Aw:
638  const AltAz AN(-fAn*cos(p.Az()), -fAn*sin(p.Az())*tan(p.Alt()));
639  const AltAz AW( fAw*sin(p.Az()), -fAw*cos(p.Az())*tan(p.Alt()));
640  p -= AN;
641  p -= AW;
642  */
643 
644  const AltAz ANAW(CalcAnAw(p, -1));
645  p -= ANAW;
646 
647  DEBUG(cout << "Back2: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl);
648 
649  //Old Correction terms for Npae and Ca:
650  const AltAz NPAE(0, -fNpae*tan(p.Alt()));
651  p -= NPAE;
652 
653  const AltAz CA(0, -fCa/cos(p.Alt()));
654  p -= CA;
655 
656  /*
657  //New Correction term for Npae and Ca:
658  TVector3 v2(1.,1.,1.); // Vector in cartesian coordinates
659  //Set Azimuth and Elevation
660  v2.SetPhi(p.Az());
661  v2.SetTheta(TMath::Pi()/2-p.Alt());
662  //Rotation Vectors:
663  TVector3 vNpae( cos(p.Az()), sin(p.Az()), 0);
664  TVector3 vCa( -cos(p.Az())*cos(p.Alt()), -sin(p.Az())*cos(p.Alt()), sin(p.Alt()));
665  //Rotate around the vectors vCa and vNpae
666  v2.Rotate(-fCa, vCa);
667  v2.Rotate(-fNpae, vNpae);
668 
669  p.Az(v2.Phi());
670  p.Alt(TMath::Pi()/2-v2.Theta());
671  */
672 
673  DEBUG(cout << "Back3: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl);
674 
675  const AltAz TF(Sign(fTf*cos(p.Alt()), p.Alt()), 0);
676  const AltAz TX(Sign(fTx/tan(p.Alt()), p.Alt()), 0);
677  p -= TF;
678  //p -= TX;
679 
680  DEBUG(cout << "Back4: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl);
681 
682  const AltAz CEC(-fEcec*cos(p.Alt()), -fAcec*cos(p.Az()));
683  const AltAz CES(-fEces*sin(p.Alt()), -fAces*sin(p.Az()));
684  p -= CEC;
685  p -= CES;
686 
687  DEBUG(cout << "Back5: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl);
688 
689  const AltAz NRY(fNry*cos(p.Alt()), -fNry*tan(p.Alt()));
690  const AltAz NRX(fNrx*sin(p.Alt()), -fNrx);
691  p -= NRY;
692  p -= NRX;
693 
694  DEBUG(cout << "Back6: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl);
695 
696  const AltAz CRY(-fCry*cos(p.Az()-p.Alt()), -fCry*sin(p.Az()-p.Alt())/cos(p.Alt()));
697  const AltAz CRX(-fCrx*sin(p.Az()-p.Alt()), fCrx*cos(p.Az()-p.Alt())/cos(p.Alt()));
698  p -= CRY;
699  p -= CRX;
700 
701  DEBUG(cout << "Back7: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl);
702 
703  return p;
704 }
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: