Changeset 8601 for trunk/MagicSoft/Mars/mpointing
- Timestamp:
- 06/24/07 17:31:59 (18 years ago)
- Location:
- trunk/MagicSoft/Mars/mpointing
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mpointing/MPointingDevCalc.cc
r8307 r8601 65 65 66 66 #include "MAstro.h" 67 #include "MPointing.h" 67 68 #include "MPointingDev.h" 68 69 #include "MRawRunHeader.h" … … 73 74 using namespace std; 74 75 75 // -------------------------------------------------------------------------- 76 const TString MPointingDevCalc::fgFileName="resources/starguider.txt"; 77 78 // -------------------------------------------------------------------------- 79 // 80 // Delete fPointing and set pointing to NULL 81 // 82 void MPointingDevCalc::Clear(Option_t *o) 83 { 84 if (fPointing) 85 delete fPointing; 86 87 fPointing = NULL; 88 } 89 90 // -------------------------------------------------------------------------- 91 // 92 // Clear the pointing model. If run-number >= 87751 read the new 93 // pointing model with fFileName 94 // 95 Bool_t MPointingDevCalc::ReadPointingModel(const MRawRunHeader &run) 96 { 97 if (run.GetRunNumber()<87751) 98 { 99 Clear(); 100 return kTRUE; 101 } 102 103 if (!fPointing) 104 fPointing = new MPointing; 105 106 if (fFileName==fPointing->GetName()) 107 { 108 *fLog << inf << fFileName << " already loaded." << endl; 109 return kTRUE; 110 } 111 112 return fPointing->Load(fFileName); 113 } 114 115 // -------------------------------------------------------------------------- 116 // 117 // Check the file/run type from the run-header and if it is a data file 118 // load starguider calibration. 76 119 // 77 120 Bool_t MPointingDevCalc::ReInit(MParList *plist) … … 95 138 if (!fReport) 96 139 *fLog << warn << "MReportStarguider not found... skipped." << endl; 97 return kTRUE;140 return ReadPointingModel(*run); 98 141 99 142 case MRawRunHeader::kRTMonteCarlo: … … 153 196 } 154 197 198 // -------------------------------------------------------------------------- 199 // 200 // Do a full starguider calibration using a pointing model for the starguider. 201 // 202 void MPointingDevCalc::DoCalibration(Double_t devzd, Double_t devaz) const 203 { 204 if (!fPointing) 205 { 206 // Do a simple starguider calibration using a simple offset in x and y 207 fDeviation->SetDevZdAz(devzd, devaz); 208 209 // Linear starguider calibration taken from April/May data 210 // For calibration add MDriveReport::GetErrorZd/Az ! 211 fDeviation->SetDevXY(fDx, fDy); // 1arcmin ~ 5mm 212 //devzd -= 2.686/60; 213 //devaz -= 2.840/60; 214 215 return; 216 } 217 218 // def?: 20.105, 773 219 // 0/0 : 20.119, 763 220 // -/- : 19.417 726 221 // +mis: 19.80, 756 222 223 // Get the nominal position the star is at the sky 224 // Unit: deg 225 ZdAz nom(fReport->GetNominalZd(), fReport->GetNominalAz()); 226 nom *= TMath::DegToRad(); 227 228 // Get the mispointing measured by the telescope. It is 229 // calculate as follows: 230 // 231 // Position at which the starguider camera is pointing in real: 232 // pointing position = nominal position - mis 233 ZdAz mis(devzd, devaz); 234 mis *= TMath::DegToRad(); 235 236 // The pointing mode is the conversion from the real pointing 237 // position of the telescope into the pointing position measured 238 // by the starguider. 239 // 240 // --> To get the real poiting position of the telescope we have 241 // to convert the measured position back; 242 // 243 244 // Position at which the starguider camera is pointing in real: 245 // pointing position = nominal position - dev 246 // 247 // The position measured as the starguider's pointing position 248 ZdAz pos(nom); // cpos = sao - dev 249 pos -= mis; 250 251 // Now we convert the starguider's pointing position into the 252 // telescope pointing position (the pointing model converts 253 // the telescope pointing position into the starguider pointing 254 // position) 255 ZdAz point = fPointing->CorrectBack(pos); 256 257 // MSrcPosCalc uses the following condition to calculate the 258 // source position in the camera: 259 // real pointing pos = nominal pointing pos - dev 260 // 261 // Therefor we calculate dev as follows: 262 ZdAz dev(nom); 263 dev -= point; 264 dev *= TMath::RadToDeg(); 265 266 // Set Measured mispointing and additional offset 267 fDeviation->SetDevZdAz(dev.Zd(), dev.Az()); 268 fDeviation->SetDevXY(0, 0); 269 } 270 155 271 Int_t MPointingDevCalc::ProcessStarguiderReport() 156 272 { 157 273 /************* CHECK STATUS!!! ******************/ 158 274 159 Double_t devzd = fReport->GetDevZd(); // [ deg]160 Double_t devaz = fReport->GetDevAz(); // [ deg]275 Double_t devzd = fReport->GetDevZd(); // [arcmin] 276 Double_t devaz = fReport->GetDevAz(); // [arcmin] 161 277 if (devzd==0 && devaz==0) 162 278 { … … 205 321 } 206 322 323 // >= 87751 (31.3.06 12:00) 324 207 325 // Calculate absolute deviation 208 326 const Double_t dev = MAstro::GetDevAbs(fReport->GetNominalZd(), devzd, devaz); … … 215 333 } 216 334 217 fDeviation->SetDevZdAz(devzd, devaz); 218 219 // Linear starguider calibration taken from April/May data 220 // For calibration add MDriveReport::GetErrorZd/Az ! 221 fDeviation->SetDevXY(fDx, fDy); 222 //devzd -= 2.686/60; // 1arcmin ~ 5mm 223 //devaz -= 2.840/60; 335 DoCalibration(devzd, devaz); 224 336 225 337 fSkip[0]++; -
trunk/MagicSoft/Mars/mpointing/MPointingDevCalc.h
r8373 r8601 10 10 #endif 11 11 12 class MPointing; 12 13 class MPointingDev; 14 class MRawRunHeader; 13 15 class MReportStarguider; 14 16 … … 16 18 { 17 19 private: 20 static const TString fgFileName; //! default file name of pointing model 21 18 22 MReportStarguider *fReport; //! MReportStarguider to get mispointing 19 23 MPointingDev *fDeviation; //! Output container to store pointing deviation 24 MPointing *fPointing; //! MPointing, pointing model for the calibration 20 25 21 26 UShort_t fRunType; //! Run Type to decide where to get pointing position from … … 27 32 TArrayI fSkip; //! Counter for execution statistics 28 33 Double_t fLastMjd; //! Time of last processed report 34 35 TString fFileName; // File name of pointing model 29 36 30 37 UInt_t fNumMinStars; // Minimum number of identified stars … … 39 46 40 47 // MPointingDevCalc 48 void DoCalibration(Double_t devzd, Double_t devaz) const; 49 50 Bool_t ReadPointingModel(const MRawRunHeader &run); 51 41 52 Int_t ProcessStarguiderReport(); 42 53 void Skip(Int_t i); … … 52 63 53 64 public: 54 MPointingDevCalc() : fReport(0), fDeviation(0), fSkip(7), fNumMinStars(8), 55 fNsbLevel(3), fNsbMin(30), fNsbMax(60), fMaxAbsDev(15), fMaxAge(1), fDx(-7), fDy(16) 65 MPointingDevCalc() : fReport(0), fDeviation(0), fPointing(0), 66 fSkip(7), fFileName(fgFileName), fNumMinStars(8), 67 fNsbLevel(3), fNsbMin(30), fNsbMax(60), fMaxAbsDev(15), 68 fMaxAge(1), fDx(-7), fDy(16) 56 69 { 57 70 fName = "MPointingDevCalc"; … … 60 73 AddToBranchList("MReportStarguider.*"); 61 74 } 75 ~MPointingDevCalc() 76 { 77 Clear(); 78 } 79 80 void Clear(Option_t *o=""); 62 81 63 82 void SetNumMinStars(UInt_t n) { fNumMinStars=n; } -
trunk/MagicSoft/Mars/mpointing/MSrcPosCalc.cc
r7287 r8601 375 375 pos0 *= conv; 376 376 377 TVector2 vx;377 //TVector2 vx; 378 378 if (fDeviation) 379 379 { 380 // Position at which the starguider camera is pointing in real: 381 // pointing position = nominal position - dev 382 // 380 383 //vx = CalcXYinCamera(pos0, pos)*fGeom->GetCameraDist()*1000; 381 384 pos0.SetZdAz(pos0.Theta()-fDeviation->GetDevZdRad(),
Note:
See TracChangeset
for help on using the changeset viewer.