Changeset 9558
- Timestamp:
- 02/26/10 09:14:24 (15 years ago)
- Location:
- trunk/MagicSoft/Cosy
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Cosy/Changelog
r9554 r9558 1 1 -*-*- END -*-*- 2 2010/02/26 Thomas Bretz 3 4 * main/MMoonPointing.cc: 5 - emit error messages to console/log-file 6 7 * main/MTracing.[h,cc]: 8 - propagate errors 9 - stop tracking if some calculation fails 10 11 12 2 13 2010/02/25 Thomas Bretz 3 14 -
trunk/MagicSoft/Cosy/main/MMoonPointing.cc
r9557 r9558 60 60 61 61 if (sinzd<=0) 62 { 63 gLog << warn << "WARNING - |Zd|>=90°" << endl; 62 64 return ZdAz(); 65 } 63 66 64 67 const Double_t costheta = coszd*fCosOffset + sinzd*fSinOffset*fCosAngle; 65 if (costheta*costheta >= 1) 68 if (costheta >= 1) 69 { 70 gLog << warn << "WARNING - cos(Zd) > 1." << endl; 66 71 return ZdAz(); 72 } 67 73 68 74 const Double_t sintheta = TMath::Sqrt(1 - costheta*costheta); … … 97 103 { 98 104 MakeZombie(); 105 gLog << warn << "WARNING - Reading of " << filename << " failed." << endl; 99 106 return; 100 107 } … … 103 110 { 104 111 MakeZombie(); 112 gLog << warn << "WARNING - Reading of TGraph2D 'cosAngle' from " << filename << " failed." << endl; 105 113 return; 106 114 } … … 109 117 { 110 118 MakeZombie(); 119 gLog << warn << "WARNING - Reading of TGraph2D 'sinAngle' from " << filename << " failed." << endl; 111 120 return; 112 121 } … … 127 136 const Double_t norm = TMath::Hypot(fcos, fsin); 128 137 if (TMath::Abs(norm-1)<0.001) 138 { 139 gLog << warn << "WARNING - Local moon position Zd/Az="; 140 gLog << moon.Zd()*TMath::RadToDeg() << "/" << moon.Az()*TMath::RadToDeg(); 141 gLog << " out of range of table for interpolation." << endl; 129 142 return kFALSE; 143 } 130 144 131 145 // Apply a small numerical improvement … … 137 151 srcpos = calc1.Calc(moon, &sn, &cs); 138 152 if (srcpos.Zd()==0) 153 { 154 gLog << warn << "WARNING - Calculation of moon shadow position failed." << endl; 139 155 return kFALSE; 156 } 140 157 141 158 // Calaculate Telescope pointing position: … … 143 160 pointpos = calc2.Calc(srcpos); 144 161 if (pointpos.Zd()==0) 162 { 163 gLog << warn << "WARNING - Calculation of moon shadow's wobble position failed." << endl; 145 164 return kFALSE; 165 } 146 166 147 167 return kTRUE; -
trunk/MagicSoft/Cosy/main/MTracking.cc
r9555 r9558 218 218 } 219 219 220 voidMTracking::UpdateSlalib(SlaPlanets &sla)220 Bool_t MTracking::UpdateSlalib(SlaPlanets &sla) 221 221 { 222 222 if (fTrackType<0) … … 240 240 241 241 const ZdAz za = sla.GetZdAzRad(); 242 if (moon.CalcPosition(za, srcpos, pointpos)) 243 sla.Set(pointpos); 242 if (!moon.CalcPosition(za, srcpos, pointpos)) 243 return kFALSE; 244 245 sla.Set(pointpos); 244 246 245 247 // Ra/Dec, Zd/Az from pointpos … … 261 263 } 262 264 263 voidMTracking::UpdateSlalib(Double_t dt)265 Bool_tMTracking::UpdateSlalib(Double_t dt) 264 266 { 265 267 fSlalib.Now(dt); 266 UpdateSlalib(fSlalib); 268 if (!UpdateSlalib(fSlalib)) 269 return kFALSE; 267 270 268 271 fCosy->fRaDec = fSlalib.GetRaDecRad(); … … 273 276 { 274 277 sla.SetMjd(mjd); 275 UpdateSlalib(sla);278 return UpdateSlalib(sla); 276 279 } 277 280 … … 342 345 { 343 346 // Position to corrent nominal position 344 UpdateSlalib(); 347 if (!UpdateSlalib()) 348 return; 345 349 346 350 if (!Move()) … … 362 366 363 367 // Get current nominal local position 364 UpdateSlalib(); 368 if (!UpdateSlalib()) 369 { 370 fCosy->StopMovement(); 371 return; 372 } 365 373 366 374 ZdAz pos = fSlalib.GetZdAzRad(); … … 402 410 // Request Target position for Now+dt 403 411 // 404 UpdateSlalib(dt); 412 if (!UpdateSlalib(dt)) 413 break; 405 414 406 415 //
Note:
See TracChangeset
for help on using the changeset viewer.