Ignore:
Timestamp:
03/17/04 17:17:14 (21 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mastro/MAstroCamera.cc

    r3525 r3537  
    4949
    5050#include "MTime.h"
     51#include "MAstroSky2Local.h"
    5152#include "../mhist/MHCamera.h"
    5253#include "MObservatory.h"
     
    9798}
    9899
    99 Int_t MAstroCamera::Convert(const TRotation &rot, TVector2 &v, Int_t type)
    100 {
    101     MVector3 w;
    102 
    103     switch (type)
    104     {
    105     case 1:
    106         w.SetRaDec(v.X(), v.Y(), 1);
    107         w = w.GetZdAz(*fTime, *fObservatory);
    108         break;
    109     case 2:
    110         w.SetZdAz(v.Y(), v.X(), 1);
    111         break;
    112     default:
    113         return kFALSE;
    114     }
    115 
    116     w *= rot;
    117 
     100Int_t MAstroCamera::ConvertToPad(const TVector3 &w, TVector2 &v)
     101{
    118102    const TVector3 spot = fMirror0->GetReflection(w, fGeom->GetCameraDist())*1000;
    119103
     
    129113        */
    130114
     115
    131116    v.Set(spot(0), spot(1));
    132117
     
    135120}
    136121
    137 void MAstroCamera::DrawNet(const TRotation &rot)
    138 {
    139     TVector2 radec(fRaDec.Phi(), TMath::Pi()/2-fRaDec.Theta());
    140     MAstroCatalog::DrawNet(radec, rot, 1);
    141 
    142     const TVector3 zdaz0 = fRaDec.GetZdAz(*fTime, *fObservatory);
     122void MAstroCamera::DrawNet(const TRotation &trans)
     123{
     124    const TRotation rot(MAstroSky2Local(*fTime, *fObservatory));
     125
     126    TVector2 radec(fRaDec.Phi(), fRaDec.Theta());
     127    MAstroCatalog::DrawNet(radec, trans*rot, 2);
     128
     129    const TVector3 zdaz0 = MAstroSky2Local(*fTime, *fObservatory)*fRaDec;
    143130    TVector2 zdaz(zdaz0.Phi(), zdaz0.Theta());
    144     MAstroCatalog::DrawNet(zdaz, rot, 2);
     131    MAstroCatalog::DrawNet(zdaz, trans, 1);
    145132}
    146133
     
    185172    const Bool_t usecam  = opt.Contains("c", TString::kIgnoreCase);
    186173
    187     const Float_t rho = fObservatory->RotationAngle(fRaDec.Phi(), TMath::Pi()/2-fRaDec.Theta(), *fTime);
     174    MAstroSky2Local rot(*fTime, *fObservatory);
     175
     176    const Float_t rho = rot.RotationAngle(fRaDec.Phi(), TMath::Pi()/2-fRaDec.Theta());
    188177
    189178    TString str = fTime->GetSqlDateTime();
     
    232221    }
    233222
    234     const TVector3 zdaz0 = fRaDec.GetZdAz(*fTime, *fObservatory);
    235 
    236     TRotation rot;
    237     rot.RotateZ(-zdaz0.Phi());
    238     rot.RotateY(-zdaz0.Theta());
    239     rot.RotateZ(-TMath::Pi()/2); // align coordinate system
    240 
    241     DrawNet(rot);
     223    TVector3 zdaz0 = fRaDec;
     224    zdaz0 *= rot;
     225
     226    cout << zdaz0.Phi()*TMath::RadToDeg() << " " << zdaz0.Theta()*TMath::RadToDeg() << endl;
     227
     228    TVector3 test = zdaz0;
     229    test *= rot.Inverse();
     230
     231    cout << test.Phi()*TMath::RadToDeg()/15 << " " << test.Theta()*TMath::RadToDeg() << endl;
     232
     233    TRotation rot2;
     234    rot2.RotateZ(-zdaz0.Phi());
     235    rot2.RotateY(-zdaz0.Theta());
     236    rot2.RotateZ(-TMath::Pi()/2); // align coordinate system
     237
     238    DrawNet(rot2);
    242239
    243240    MVector3 *radec;
     
    248245        const Double_t mag = radec->Magnitude();
    249246
    250         TVector3 star = radec->GetZdAz(*fTime, *fObservatory);
    251 
     247        TVector3 star(*radec);
     248
     249        // Calculate local coordinates
     250        star *= rot;
    252251        // Rotate Star into telescope system
    253         star *= rot;
     252        star *= rot2;
    254253
    255254        TVector3 mean;
Note: See TracChangeset for help on using the changeset viewer.