Ignore:
Timestamp:
02/25/10 11:30:27 (16 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 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:
Note: See TracChangeset for help on using the changeset viewer.