Index: trunk/MagicSoft/Mars/mastro/MObservatory.cc
===================================================================
--- trunk/MagicSoft/Mars/mastro/MObservatory.cc	(revision 3487)
+++ trunk/MagicSoft/Mars/mastro/MObservatory.cc	(revision 3497)
@@ -34,4 +34,7 @@
 #include "MObservatory.h"
 
+#include <TVector3.h>
+
+#include "MTime.h"
 #include "MAstro.h"
 
@@ -169,2 +172,26 @@
     return TMath::ASin((fCosLatitude*sinp) / denom);
 }
+
+// --------------------------------------------------------------------------
+//
+// RotationAngle 
+// 
+// calculates the angle for the rotation of the sky image in the camera;
+// this angle is a function of the sky coordinates, the observatory
+// location and the time
+//
+//  ra  [rad]: Right ascension
+//  dec [rad]: Declination
+//
+// Return RotationAngle in rad
+//
+Double_t MObservatory::RotationAngle(Double_t ra, Double_t dec, const MTime &t) const
+{
+    const Double_t alpha = t.GetGmst() + GetElong();
+
+    TVector3 v;
+    v.SetMagThetaPhi(1, TMath::Pi()/2-dec, alpha-ra);
+    v.RotateY(GetPhi()-TMath::Pi()/2);
+
+    return RotationAngle(v.Theta(), v.Phi());
+}
Index: trunk/MagicSoft/Mars/mastro/MObservatory.h
===================================================================
--- trunk/MagicSoft/Mars/mastro/MObservatory.h	(revision 3487)
+++ trunk/MagicSoft/Mars/mastro/MObservatory.h	(revision 3497)
@@ -5,4 +5,6 @@
 #include "MParContainer.h"
 #endif
+
+class MTime;
 
 class MObservatory : public MParContainer
@@ -56,4 +58,5 @@
     void RotationAngle(Double_t theta, Double_t phi, Double_t &sin, Double_t &cos) const;
     Double_t RotationAngle(Double_t theta, Double_t phi) const;
+    Double_t RotationAngle(Double_t ra, Double_t dec, const MTime &t) const;
 
     LocationName_t GetObservatoryKey() const { return fObservatoryKey; }
