Index: trunk/Mars/mcore/nova.h
===================================================================
--- trunk/Mars/mcore/nova.h	(revision 19387)
+++ trunk/Mars/mcore/nova.h	(revision 19388)
@@ -27,4 +27,8 @@
 #endif
 
+#ifndef PRESET_OBSERVATORY
+#define PRESET_OBSERVATORY kORM
+#endif
+
     const static double kSolarStandardHorizon = LN_SOLAR_STANDART_HORIZON;
 
@@ -36,10 +40,15 @@
     struct LnLatPosn : public ln_lnlat_posn
     {
-        LnLatPosn() { }
-        LnLatPosn(const ln_lnlat_posn &pos) : ln_lnlat_posn(pos) { }
-        LnLatPosn(std::string obs)
+        typedef std::map<std::string, ln_lnlat_posn> LUT;
+
+        bool operator==(const LnLatPosn &eq) const
+        {
+            return lng==eq.lng && lat==eq.lat;
+        }
+
+        static const LUT &lut()
         {
 #ifndef __CINT__
-            static const std::map<std::string, ln_lnlat_posn> lut =
+            static const LUT lut =
             {
                 { "ORM",  kORM  },
@@ -48,10 +57,23 @@
                 { "RWTH", kRWTH },
             };
+            return lut;
+#else
+            return LUT();
+#endif
+        }
+
+        LnLatPosn() { }
+        LnLatPosn(const ln_lnlat_posn &pos) : ln_lnlat_posn(pos) { }
+        LnLatPosn(std::string obs)
+        {
+#ifndef __CINT__
+            if (obs.empty())
+                return PRESET_OBSERVATORY;
 
             for (auto it=obs.begin(); it!=obs.end(); it++)
                 *it = toupper(*it);
 
-            const auto it = lut.find(obs);
-            *this = it==lut.end() ? ln_lnlat_posn({std::numeric_limits<double>::quiet_NaN(),std::numeric_limits<double>::quiet_NaN()}) : it->second;
+            const auto it = lut().find(obs);
+            *this = it==lut().end() ? ln_lnlat_posn({std::numeric_limits<double>::quiet_NaN(),std::numeric_limits<double>::quiet_NaN()}) : it->second;
 #endif
         }
@@ -59,4 +81,19 @@
         {
             return std::isfinite(lat) && std::isfinite(lng);
+        }
+
+        const std::string &name() const
+        {
+            for (auto it=lut().begin(); it!=lut().end(); it++)
+                if (LnLatPosn(it->second)==*this)
+                    return it->first;
+
+            static const std::string dummy;
+            return dummy;
+        }
+
+        static const std::string preset()
+        {
+            return LnLatPosn(PRESET_OBSERVATORY).name();
         }
     };
@@ -81,5 +118,5 @@
     };
 
-    HrzPosn::HrzPosn(const ZdAzPosn &za) { alt = 90-za.zd; az = za.az-180; }
+    inline HrzPosn::HrzPosn(const ZdAzPosn &za) { alt = 90-za.zd; az = za.az-180; }
 
 
@@ -103,7 +140,7 @@
     };
 
-    EquPosn::EquPosn(const RaDecPosn &rd) { ra = rd.ra*15; dec = rd.dec; }
-
-    HrzPosn GetHrzFromEqu(const EquPosn &equ, const LnLatPosn &obs, const double &jd)
+    inline EquPosn::EquPosn(const RaDecPosn &rd) { ra = rd.ra*15; dec = rd.dec; }
+
+    inline HrzPosn GetHrzFromEqu(const EquPosn &equ, const LnLatPosn &obs, const double &jd)
     {
         HrzPosn hrz;
@@ -111,10 +148,10 @@
         return hrz;
     }
-    HrzPosn GetHrzFromEqu(const EquPosn &equ, const double &jd)
-    {
-        return GetHrzFromEqu(equ, kORM, jd);
-    }
-
-    EquPosn GetEquFromHrz(const HrzPosn &hrz, const LnLatPosn &obs, const double &jd)
+    inline HrzPosn GetHrzFromEqu(const EquPosn &equ, const double &jd)
+    {
+        return GetHrzFromEqu(equ, PRESET_OBSERVATORY, jd);
+    }
+
+    inline EquPosn GetEquFromHrz(const HrzPosn &hrz, const LnLatPosn &obs, const double &jd)
     {
         EquPosn equ;
@@ -122,10 +159,10 @@
         return equ;
     }
-    EquPosn GetEquFromHrz(const HrzPosn &hrz, const double &jd)
-    {
-        return GetEquFromHrz(hrz, kORM, jd);
-    }
-
-    RstTime GetSolarRst(const double &jd, const LnLatPosn &obs, const double &hrz=kSolarStandardHorizon)
+    inline EquPosn GetEquFromHrz(const HrzPosn &hrz, const double &jd)
+    {
+        return GetEquFromHrz(hrz, PRESET_OBSERVATORY, jd);
+    }
+
+    inline RstTime GetSolarRst(const double &jd, const LnLatPosn &obs, const double &hrz=kSolarStandardHorizon)
     {
         RstTime rst;
@@ -133,10 +170,10 @@
         return rst;
     }
-    RstTime GetSolarRst(const double &jd, const double &hrz=kSolarStandardHorizon)
-    {
-        return GetSolarRst(jd, kORM, hrz);
-    }
-
-    RstTime GetLunarRst(const double &jd, const LnLatPosn &obs=kORM)
+    inline RstTime GetSolarRst(const double &jd, const double &hrz=kSolarStandardHorizon)
+    {
+        return GetSolarRst(jd, PRESET_OBSERVATORY, hrz);
+    }
+
+    inline RstTime GetLunarRst(const double &jd, const LnLatPosn &obs=PRESET_OBSERVATORY)
     {
         RstTime rst;
@@ -144,5 +181,5 @@
         return rst;
     }
-    EquPosn GetSolarEquCoords(const double &jd)
+    inline EquPosn GetSolarEquCoords(const double &jd)
     {
         EquPosn equ;
@@ -151,20 +188,20 @@
     }
 
-    double GetLunarDisk(const double &jd)
+    inline double GetLunarDisk(const double &jd)
     {
         return ln_get_lunar_disk(jd);
     }
 
-    double GetLunarSdiam(const double &jd)
+    inline double GetLunarSdiam(const double &jd)
     {
         return ln_get_lunar_sdiam(jd);
     }
 
-    double GetLunarPhase(const double &jd)
+    inline double GetLunarPhase(const double &jd)
     {
         return ln_get_lunar_phase(jd);
     }
 
-    EquPosn GetLunarEquCoords(const double &jd, double precision=0)
+    inline EquPosn GetLunarEquCoords(const double &jd, double precision=0)
     {
         EquPosn equ;
@@ -173,15 +210,15 @@
     }
 
-    double GetLunarEarthDist(const double &jd)
+    inline double GetLunarEarthDist(const double &jd)
     {
         return ln_get_lunar_earth_dist(jd);
     }
 
-    double GetAngularSeparation(const EquPosn &p1, const EquPosn &p2)
+    inline double GetAngularSeparation(const EquPosn &p1, const EquPosn &p2)
     {
         return ln_get_angular_separation(const_cast<EquPosn*>(&p1), const_cast<EquPosn*>(&p2));
     }
 
-    double GetAngularSeparation(const HrzPosn &h1, const HrzPosn &h2)
+    inline double GetAngularSeparation(const HrzPosn &h1, const HrzPosn &h2)
     {
         EquPosn p1; p1.ra=h1.az; p1.dec=h1.alt;
@@ -203,5 +240,5 @@
         double fEarthDist;
 
-        SolarObjects(const double &jd, const LnLatPosn &obs=Nova::kORM)
+        SolarObjects(const double &jd, const LnLatPosn &obs=Nova::PRESET_OBSERVATORY)
         {
             fJD = jd;
@@ -219,5 +256,4 @@
         }
     };
-
 }
 
