Changeset 9555 for trunk/MagicSoft


Ignore:
Timestamp:
02/25/10 11:30:27 (15 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Cosy/main
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Cosy/main/MMoonPointing.cc

    r9554 r9555  
    128128    const Double_t fcos = const_cast<TGraph2D&>(fCos).Interpolate(moon.Az(), moon.Zd());
    129129    const Double_t fsin = const_cast<TGraph2D&>(fSin).Interpolate(moon.Az(), moon.Zd());
    130     if (fcos*fcos + fsin*fsin<0.98)
     130
     131    // This is a sanity check for the case the Interpolation failed
     132    const Double_t norm = TMath::Hypot(fcos, fsin);
     133    if (TMath::Abs(norm-1)<0.001)
    131134        return kFALSE;
     135
     136    // Just a small numerical improvement
     137    fsin /= norm;
     138    fcos /= norm;
    132139
    133140    // Calculate Moon Shadow Position:
  • trunk/MagicSoft/Cosy/main/MTracking.cc

    r9553 r9555  
    239239        ZdAz srcpos, pointpos;
    240240
    241         const ZdAz za     = sla.GetZdAzRad();
    242         const ZdAz offset = moon.CalcPosition(za, srcpos, pointpos);
    243         sla.ApplyOffsetZdAz(pointpos-za);
     241        const ZdAz za = sla.GetZdAzRad();
     242        if (moon.CalcPosition(za, srcpos, pointpos))
     243            sla.Set(pointpos);
    244244
    245245        // Ra/Dec, Zd/Az from pointpos
Note: See TracChangeset for help on using the changeset viewer.