Changeset 10024 for trunk/Cosy
- Timestamp:
- 10/21/10 11:23:44 (14 years ago)
- Location:
- trunk/Cosy
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Cosy/Changelog
r10023 r10024 12 12 * Makefile: 13 13 - added magic1 and magic2 rule to produce liks to the resource files 14 15 * main/MTracking.[h,cc]: 16 - made MMoonPointing a data member to make sure the file is 17 read only once 18 - added a destructor to delete/close the file 19 - set offsets only once when tracking isinitialized 20 - added a lot of debug output in case of failure 21 - some units fixes 22 - moved setting the ra/dec for the starguider to the tracking 23 main loop 24 - retrieve the time after initializing the Slalib in the Thread 25 - print a more helpful error message when UpdateSlalib in the 26 Thread fails 27 14 28 15 29 -
trunk/Cosy/main/MTracking.cc
r9561 r10024 25 25 fTrackAcc(0, 0), fWobbleOffset(-1), fWobbleAngle(0), fOut(0) 26 26 { 27 fMoon = new MMoonPointing("MoonShadowOffsets.root"); 28 } 29 30 MTracking::~MTracking() 31 { 32 delete fMoon; 27 33 } 28 34 … … 227 233 if (fTrackType==(kEMoon|0x100)) 228 234 { 229 // FIXME: Read file only once! 230 MMoonPointing moon("MoonShadowOffsets.root"); 231 if (moon.IsZombie()) 235 if (fMoon->IsZombie()) 232 236 { 233 237 gLog << err << "ERROR - Could not initialize MMoonPointing." << endl; … … 235 239 } 236 240 237 moon.SetOffsetShadow(TMath::DegToRad()*fWobbleAngle); 238 moon.SetOffsetWobble(TMath::DegToRad()*fWobbleOffset); 241 //moon.SetOffsetShadow(fWobbleAngle); 242 //moon.SetOffsetWobble(fWobbleOffset); 243 244 const ZdAz za = sla.GetZdAzRad(); 239 245 240 246 ZdAz srcpos, pointpos; 241 242 const ZdAz za = sla.GetZdAzRad(); 243 if (!moon.CalcPosition(za, srcpos, pointpos)) 247 if (!fMoon->CalcPosition(za, srcpos, pointpos)) 244 248 { 245 249 gLog << err << "ERROR - Calculation of moon shadow pointing position failed." << endl; 250 gLog << " WoAngle =" << fWobbleAngle << endl; 251 gLog << " WoOffset =" << fWobbleOffset << endl; 252 gLog << " TrackType =" << fTrackType << endl; 253 gLog << " TT&0xff =" << (fTrackType&0xff) << endl; 254 gLog << " mjd =" << sla.GetMjd() << endl; 255 gLog << " za.Zd =" << za.Zd() << endl; 256 gLog << " za.Az =" << za.Az() << endl; 257 gLog << " srcpos.Zd =" << srcpos.Zd() << endl; 258 gLog << " srcpos.Az =" << srcpos.Az() << endl; 259 gLog << " pointpos.Zd=" << pointpos.Zd() << endl; 260 gLog << " pointpos.Az=" << pointpos.Az() << endl; 246 261 return kFALSE; 247 262 } 248 263 249 sla.Set(pointpos); 264 sla.Set(pointpos/TMath::DegToRad()); 265 266 // return kTRUE; 267 268 //RaDec rd = sla.GetRaDec(); 269 //ZdAz zd = sla.GetZdAz(); 250 270 251 271 // Ra/Dec, Zd/Az from pointpos … … 263 283 } 264 284 */ 265 // if (fCosy->fStarguider) 266 // fCosy->fStarguider->SetPointingPosition(sla.GetRaDec()); 285 return kTRUE; 267 286 } 268 287 … … 275 294 fCosy->fRaDec = fSlalib.GetRaDecRad(); 276 295 fCosy->fHourAngle = fSlalib.GetHourAngle(); 296 297 return kTRUE; 277 298 } 278 299 … … 290 311 291 312 if (fTrackType>=0) 292 gLog << all << fSlalib.GetTime() << ": Tracking Planet with Id " << fTrackType << endl;313 gLog << all << fSlalib.GetTime() << ": Tracking Planet with Id " << fTrackType << " (" << fWobbleOffset << ", " << fWobbleAngle << ")" << endl; 293 314 gLog << all << fSlalib.GetTime() << ": Track Position " << dst.Ra()*kRad2Deg/15 << "h, " << dst.Dec()*kRad2Deg <<"deg" << endl; 294 315 … … 321 342 fTrackType = -1; 322 343 344 // Just for convenience 345 fMoon->SetOffsetShadow(0); 346 fMoon->SetOffsetWobble(0); 347 323 348 // Start tracking 324 349 Track(); … … 330 355 fTrackType = planet; 331 356 357 // Just for convenience 358 fMoon->SetOffsetShadow(0); 359 fMoon->SetOffsetWobble(0); 360 332 361 // Start tracking 333 362 Track(); … … 341 370 fWobbleOffset = TMath::DegToRad()*wobble; 342 371 fWobbleAngle = TMath::DegToRad()*offset; 372 373 fMoon->SetOffsetShadow(fWobbleAngle); 374 fMoon->SetOffsetWobble(fWobbleOffset); 343 375 344 376 // Start tracking … … 473 505 break; 474 506 507 // Now the tracking procedure is finished and we have some time 508 // left to set the nominal pointing position for the starguider 509 // if available. This should be thread safe. Doing this in 510 // UpdateSlalib would also update it from the Thread 511 // which leads to problems. 512 if (fCosy->fStarguider) 513 fCosy->fStarguider->SetPointingPosition(fSlalib.GetRaDec()); 514 475 515 // 476 516 // Update speed as often as possible. … … 513 553 //SlaPlanets sla(fSlalib.GetObservatoryKey()); 514 554 SlaPlanets sla(MObservatory::kMagic1); 515 516 UpdateSlalib(sla); 555 sla.Now(); 556 557 if (!UpdateSlalib(sla)) 558 gLog << err << "UpdateSlalib in Thread failed." << endl; 517 559 518 560 // -
trunk/Cosy/main/MTracking.h
r9559 r10024 17 17 class RaDec; 18 18 class SlaStars; 19 class MMoonPointing; 19 20 20 21 class MTracking : public MSlewing, public MThread … … 32 33 33 34 MLog *fOut; 35 36 MMoonPointing *fMoon; 34 37 35 38 Bool_t UpdateSlalib(SlaPlanets &sla); … … 49 52 public: 50 53 MTracking(MCosy *cosy); 54 ~MTracking(); 51 55 52 56 void TrackPosition(const RaDec &dst); // ra, dec [rad]
Note:
See TracChangeset
for help on using the changeset viewer.