Changeset 3537 for trunk/MagicSoft/Mars/mastro/MAstroCamera.cc
- Timestamp:
- 03/17/04 17:17:14 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mastro/MAstroCamera.cc
r3525 r3537 49 49 50 50 #include "MTime.h" 51 #include "MAstroSky2Local.h" 51 52 #include "../mhist/MHCamera.h" 52 53 #include "MObservatory.h" … … 97 98 } 98 99 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 100 Int_t MAstroCamera::ConvertToPad(const TVector3 &w, TVector2 &v) 101 { 118 102 const TVector3 spot = fMirror0->GetReflection(w, fGeom->GetCameraDist())*1000; 119 103 … … 129 113 */ 130 114 115 131 116 v.Set(spot(0), spot(1)); 132 117 … … 135 120 } 136 121 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); 122 void 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; 143 130 TVector2 zdaz(zdaz0.Phi(), zdaz0.Theta()); 144 MAstroCatalog::DrawNet(zdaz, rot, 2);131 MAstroCatalog::DrawNet(zdaz, trans, 1); 145 132 } 146 133 … … 185 172 const Bool_t usecam = opt.Contains("c", TString::kIgnoreCase); 186 173 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()); 188 177 189 178 TString str = fTime->GetSqlDateTime(); … … 232 221 } 233 222 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); 242 239 243 240 MVector3 *radec; … … 248 245 const Double_t mag = radec->Magnitude(); 249 246 250 TVector3 star = radec->GetZdAz(*fTime, *fObservatory); 251 247 TVector3 star(*radec); 248 249 // Calculate local coordinates 250 star *= rot; 252 251 // Rotate Star into telescope system 253 star *= rot ;252 star *= rot2; 254 253 255 254 TVector3 mean;
Note:
See TracChangeset
for help on using the changeset viewer.