Index: /trunk/Cosy/Changelog
===================================================================
--- /trunk/Cosy/Changelog	(revision 10007)
+++ /trunk/Cosy/Changelog	(revision 10008)
@@ -1,3 +1,17 @@
                                                                   -*-*- END -*-*-
+ 2010/10/14 Thomas Bretz (La Palma)
+
+   * main/MMoonPointing.cc:
+     - fixed wrong unit conversion for the offsets
+     - added 2pi alignment for moon Azimuth before interpolation
+
+   * catalog/SlaStars.cc:
+     - fixed wrong units
+
+   * main/MSlewing.cc:
+     - added a comment
+
+
+
  2010/09/30 Thomas Bretz
 
Index: /trunk/Cosy/catalog/SlaStars.cc
===================================================================
--- /trunk/Cosy/catalog/SlaStars.cc	(revision 10007)
+++ /trunk/Cosy/catalog/SlaStars.cc	(revision 10008)
@@ -20,5 +20,5 @@
 void SlaStars::Set(const ZdAz &zdaz)
 {
-    fAltAz = AltAz(TMath::Pi()/2-zdaz.Zd(), zdaz.Az()) * TMath::DegToRad();
+    fAltAz = AltAz(90-zdaz.Zd(), zdaz.Az()) * TMath::DegToRad();
     fRaDec = CalcRaDec(fAltAz);
 }
Index: /trunk/Cosy/main/MMoonPointing.cc
===================================================================
--- /trunk/Cosy/main/MMoonPointing.cc	(revision 10007)
+++ /trunk/Cosy/main/MMoonPointing.cc	(revision 10008)
@@ -22,6 +22,6 @@
 public:
     MPositionOffsetCalc(Double_t offset) :
-        fCosOffset(offset==0 ? 0 : TMath::Cos(offset*TMath::DegToRad())),
-        fSinOffset(offset==0 ? 0 : TMath::Sin(offset*TMath::DegToRad())),
+        fCosOffset(offset==0 ? 0 : TMath::Cos(offset)),
+        fSinOffset(offset==0 ? 0 : TMath::Sin(offset)),
         fCosAngle(0), fSinAngle(0)
     {
@@ -29,6 +29,6 @@
 
     MPositionOffsetCalc(Double_t offset, Double_t angle) :
-        fCosOffset(offset==0 ? 0 : TMath::Cos(offset*TMath::DegToRad())),
-        fSinOffset(offset==0 ? 0 : TMath::Sin(offset*TMath::DegToRad())),
+        fCosOffset(offset==0 ? 0 : TMath::Cos(offset)),
+        fSinOffset(offset==0 ? 0 : TMath::Sin(offset)),
         fCosAngle(TMath::Cos(angle*TMath::DegToRad())),
         fSinAngle(TMath::Sin(angle*TMath::DegToRad()))
@@ -37,6 +37,6 @@
 
     MPositionOffsetCalc(Double_t offset, Double_t cos, Double_t sin) :
-        fCosOffset(offset==0 ? 0 : TMath::Cos(offset*TMath::DegToRad())),
-        fSinOffset(offset==0 ? 0 : TMath::Sin(offset*TMath::DegToRad())),
+        fCosOffset(offset==0 ? 0 : TMath::Cos(offset)),
+        fSinOffset(offset==0 ? 0 : TMath::Sin(offset)),
         fCosAngle(cos), fSinAngle(sin)
     {
@@ -133,6 +133,8 @@
 Bool_t MMoonPointing::CalcPosition(const ZdAz &moon, ZdAz &srcpos, ZdAz &pointpos) const
 {
-    const Double_t fcos = const_cast<TGraph2D&>(fCos).Interpolate(moon.Az(), moon.Zd());
-    const Double_t fsin = const_cast<TGraph2D&>(fSin).Interpolate(moon.Az(), moon.Zd());
+    const Double_t az = fmod(moon.Az()+TMath::TwoPi(), TMath::TwoPi());
+
+    const Double_t fcos = const_cast<TGraph2D&>(fCos).Interpolate(az, moon.Zd());
+    const Double_t fsin = const_cast<TGraph2D&>(fSin).Interpolate(az, moon.Zd());
 
     // This is a sanity check for the case the Interpolation failed
Index: /trunk/Cosy/main/MSlewing.cc
===================================================================
--- /trunk/Cosy/main/MSlewing.cc	(revision 10007)
+++ /trunk/Cosy/main/MSlewing.cc	(revision 10008)
@@ -134,4 +134,6 @@
     const ZdAz dest = bend/TMath::TwoPi();   // [revolutions]
 
+    // Check whether bending is valid!
+
     if (!fCosy->CheckRange(bend))
         return kFALSE;
