Index: /trunk/MagicSoft/Mars/Changelog
===================================================================
--- /trunk/MagicSoft/Mars/Changelog	(revision 5931)
+++ /trunk/MagicSoft/Mars/Changelog	(revision 5932)
@@ -31,4 +31,6 @@
      - add place for LoGainSwitch
 
+
+
  2005/01/21 Florian Goebel
 
@@ -37,8 +39,12 @@
 
 
+
  2005/01/20 Thomas Bretz
 
    * mpointing/MSrcPosFromModel.cc:
      - fixed crash in Process if no pointing model available
+
+   * mastro/MObservatory.[h,cc]:
+     - added ReadEnv member function
 
 
Index: /trunk/MagicSoft/Mars/mastro/MObservatory.cc
===================================================================
--- /trunk/MagicSoft/Mars/mastro/MObservatory.cc	(revision 5931)
+++ /trunk/MagicSoft/Mars/mastro/MObservatory.cc	(revision 5932)
@@ -130,2 +130,35 @@
     return MAstro::RotationAngle(fSinLatitude, fCosLatitude, theta, phi);
 }
+
+
+// --------------------------------------------------------------------------
+//
+// Setup the observatory location from resource file:
+//    MObservatory.Name: Magic1, WuerzburgCity
+//
+Int_t MObservatory::ReadEnv(const TEnv &env, TString prefix, Bool_t print)
+{
+    if (IsEnvDefined(env, prefix, "Name", print))
+    {
+        TString name = GetEnvValue(env, prefix, "Name", "Magic1");
+        name = name.Strip(TString::kBoth);
+
+        if (name==(TString)"Magic1")
+        {
+            SetLocation(kMagic1);
+            return kTRUE;
+        }
+
+        if (name==(TString)"WuerzburgCity")
+        {
+            SetLocation(kWuerzburgCity);
+            return kTRUE;
+        }
+
+        *fLog << err << "MObservatory::ReadEnv - ERROR: Observatory " << name << " unknown." << endl;
+        return kERROR;
+    }
+
+    return kFALSE;
+
+}
Index: /trunk/MagicSoft/Mars/mastro/MObservatory.h
===================================================================
--- /trunk/MagicSoft/Mars/mastro/MObservatory.h	(revision 5931)
+++ /trunk/MagicSoft/Mars/mastro/MObservatory.h	(revision 5932)
@@ -72,4 +72,6 @@
     LocationName_t GetObservatoryKey() const { return fObservatoryKey; }
 
+    Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print=kFALSE);
+
     ClassDef(MObservatory, 0) // class storing observatory locations
 };
