Index: /trunk/FACT++/src/makedata.cc
===================================================================
--- /trunk/FACT++/src/makedata.cc	(revision 16968)
+++ /trunk/FACT++/src/makedata.cc	(revision 16969)
@@ -7,29 +7,5 @@
 
 using namespace std;
-
-// ------------------------------------------------------------------------
-
-double Angle(double ra, double dec, double r, double d)
-{
-    const double theta0 = M_PI/2-d*M_PI/180;
-    const double phi0   = r*M_PI/12;
-
-    const double theta1 = M_PI/2-dec*M_PI/180;
-    const double phi1   = ra*M_PI/12;
-
-    const double x0 = sin(theta0) * cos(phi0);
-    const double y0 = sin(theta0) * sin(phi0);
-    const double z0 = cos(theta0);
-
-    const double x1 = sin(theta1) * cos(phi1);
-    const double y1 = sin(theta1) * sin(phi1);
-    const double z1 = cos(theta1);
-
-    double arg = x0*x1 + y0*y1 + z0*z1;
-    if(arg >  1.0) arg =  1.0;
-    if(arg < -1.0) arg = -1.0;
-
-    return acos(arg) * 180/M_PI;
-}
+using namespace Nova;
 
 // ========================================================================
@@ -92,11 +68,4 @@
     // ------------------ Eval config ---------------------
 
-    const double lon = -(17.+53./60+26.525/3600);
-    const double lat =   28.+45./60+42.462/3600;
-
-    ln_lnlat_posn observer;
-    observer.lng = lon;
-    observer.lat = lat;
-
     Time time;
     if (conf.Has("date-time"))
@@ -108,8 +77,6 @@
 
     // -12: nautical
-    ln_rst_time sun_set;   // Sun set with the same date than th provided date
-    ln_rst_time sun_rise;  // Sun rise on the following day
-    ln_get_solar_rst_horizon(time.JD()-0.5, &observer, -12, &sun_set);
-    ln_get_solar_rst_horizon(time.JD()+0.5, &observer, -12, &sun_rise);
+    const RstTime sun_set  = GetSolarRst(time.JD()-0.5, -12);   // Sun set with the same date than th provided date
+    const RstTime sun_rise = GetSolarRst(time.JD()+0.5, -12);  // Sun rise on the following day
 
     const double jd  = floor(time.Mjd())+2400001;
@@ -132,12 +99,10 @@
     // ------------------ Precalc moon coord ---------------------
 
-    vector<pair<ln_equ_posn, double>> fMoonCoords;
+    vector<pair<EquPosn, double>> fMoonCoords;
 
     for (double h=0; h<1; h+=1./(24*12))
     {
-        ln_equ_posn  moon;
-        ln_get_lunar_equ_coords_prec(jd+h, &moon, 0.01);
-
-        const double disk = ln_get_lunar_disk(jd+h);
+        const EquPosn moon = GetLunarEquCoords(jd+h);
+        const double  disk = GetLunarDisk(jd+h);
 
         fMoonCoords.emplace_back(moon, disk);
@@ -155,5 +120,5 @@
         return 1;
 
-    Nova::EquPosn pos;
+    EquPosn pos;
     pos.ra  = double((*row)[0])*15;
     pos.dec = double((*row)[1]);
@@ -169,14 +134,13 @@
 
         // get local position of source
-        const Nova::HrzPosn hrz = Nova::GetHrzFromEqu(pos, jd+h);
+        const HrzPosn hrz = GetHrzFromEqu(pos, jd+h);
 
         // Get moon properties and
-        const Nova::EquPosn moon = fMoonCoords[i].first;
-        const double disk = fMoonCoords[i].second;
-
-        const Nova::HrzPosn hrzm = Nova::GetHrzFromEqu(moon, jd+h);
+        const EquPosn moon = fMoonCoords[i].first;
+        const double  disk = fMoonCoords[i].second;
+        const HrzPosn hrzm = GetHrzFromEqu(moon, jd+h);
 
         // Distance between source and moon
-        const double angle = Angle(moon.ra, moon.dec, pos.ra, pos.dec);
+        const double angle = GetAngularSeparation(moon, pos);
 
         // Current prediction
Index: /trunk/FACT++/src/makeplots.cc
===================================================================
--- /trunk/FACT++/src/makeplots.cc	(revision 16968)
+++ /trunk/FACT++/src/makeplots.cc	(revision 16969)
@@ -13,29 +13,7 @@
 
 using namespace std;
+using namespace Nova;
 
 // ------------------------------------------------------------------------
-
-double Angle(double ra, double dec, double r, double d)
-{
-    const double theta0 = M_PI/2-d*M_PI/180;
-    const double phi0   = r*M_PI/12;
-
-    const double theta1 = M_PI/2-dec*M_PI/180;
-    const double phi1   = ra*M_PI/12;
-
-    const double x0 = sin(theta0) * cos(phi0);
-    const double y0 = sin(theta0) * sin(phi0);
-    const double z0 = cos(theta0);
-
-    const double x1 = sin(theta1) * cos(phi1);
-    const double y1 = sin(theta1) * sin(phi1);
-    const double z1 = cos(theta1);
-
-    double arg = x0*x1 + y0*y1 + z0*z1;
-    if(arg >  1.0) arg =  1.0;
-    if(arg < -1.0) arg = -1.0;
-
-    return acos(arg) * 180/M_PI;
-}
 
 void CheckForGap(TCanvas &c, TGraph &g, double axis)
@@ -131,6 +109,6 @@
     // Sun set with the same date than th provided date
     // Sun rise on the following day
-    const Nova::RstTime sun_set  = Nova::GetSolarRst(time.JD()-0.5, -12);
-    const Nova::RstTime sun_rise = Nova::GetSolarRst(time.JD()+0.5, -12);
+    const RstTime sun_set  = GetSolarRst(time.JD()-0.5, -12);
+    const RstTime sun_rise = GetSolarRst(time.JD()+0.5, -12);
 
     const double jd  = floor(time.Mjd())+2400001;
@@ -149,11 +127,10 @@
     // ------------------ Precalc moon coord ---------------------
 
-    vector<pair<Nova::EquPosn, double>> fMoonCoords;
+    vector<pair<EquPosn, double>> fMoonCoords;
 
     for (double h=0; h<1; h+=1./(24*12))
     {
-        const Nova::EquPosn moon = Nova::GetLunarEquCoords(jd+h, 0.01);
-
-        const double disk = Nova::GetLunarDisk(jd+h);
+        const EquPosn moon = GetLunarEquCoords(jd+h, 0.01);
+        const double  disk = GetLunarDisk(jd+h);
 
         fMoonCoords.emplace_back(moon, disk);
@@ -249,5 +226,5 @@
         const string name = (*v)[0].c_str();
 
-        Nova::EquPosn pos;
+        EquPosn pos;
         pos.ra  = double((*v)[1])*15;
         pos.dec = double((*v)[2]);
@@ -287,11 +264,10 @@
 
             // get local position of source
-            const Nova::HrzPosn hrz = Nova::GetHrzFromEqu(pos, jd+h);
+            const HrzPosn hrz = GetHrzFromEqu(pos, jd+h);
 
             // Get moon properties and
-            const Nova::EquPosn moon = fMoonCoords[i].first;
-            const double disk = fMoonCoords[i].second;
-
-            const Nova::HrzPosn hrzm = Nova::GetHrzFromEqu(moon, jd+h);
+            const EquPosn moon = fMoonCoords[i].first;
+            const double  disk = fMoonCoords[i].second;
+            const HrzPosn hrzm = GetHrzFromEqu(moon, jd+h);
 
             if (v==res.begin())
@@ -299,5 +275,5 @@
 
             // Distance between source and moon
-            const double angle = Angle(moon.ra, moon.dec, pos.ra, pos.dec);
+            const double angle = GetAngularSeparation(moon, pos);
 
             // Current prediction
