Index: trunk/FACT++/src/makeplots.cc
===================================================================
--- trunk/FACT++/src/makeplots.cc	(revision 17957)
+++ trunk/FACT++/src/makeplots.cc	(revision 17958)
@@ -113,6 +113,5 @@
     const RstTime sun_rise = GetSolarRst(time.JD()+0.5, -12);
 
-    const double jd  = floor(time.Mjd())+2400001;
-    const double mjd = floor(time.Mjd())+49718+0.5; // root time
+    const double jd = floor(time.Mjd())+2400001;
 
     cout << "Time: " << time     << endl;
@@ -125,12 +124,4 @@
 
     const string fDatabase = conf.Get<string>("source-database");
-
-    // ------------------ Precalc coord ---------------------
-
-    vector<SolarObjects> fCoordinates;
-
-    for (double h=0; h<1; h+=1./(24*12))
-        if (jd+h>sunset && jd+h<sunrise)
-            fCoordinates.emplace_back(jd+h);
 
     // ------------- Get Sources from databasse ---------------------
@@ -254,13 +245,15 @@
 
         // Loop over 24 hours
-        for (auto it=fCoordinates.begin(); it!=fCoordinates.end(); it++)
+        for (double h=0; h<1; h+=1./(24*12))
         {
+            const SolarObjects so(jd+h);
+
             // get local position of source
-            const HrzPosn hrz = GetHrzFromEqu(pos, it->fJD);
+            const HrzPosn hrz = GetHrzFromEqu(pos, so.fJD);
 
             if (v==res.begin())
-                cout << Time(it->fJD) <<" " << 90-it->fMoonHrz.alt <<  endl;
-
-            const double cur = FACT::PredictI(*it, pos);
+                cout << Time(so.fJD) <<" " << 90-so.fMoonHrz.alt <<  endl;
+
+            const double cur = FACT::PredictI(so, pos);
 
             // Relative  energy threshold prediction
@@ -268,5 +261,5 @@
 
             // Add points to curve
-            const double axis = Time(it->fJD).Mjd()*24*3600;
+            const double axis = Time(so.fJD).Mjd()*24*3600;
 
             // If there is a gap of more than one bin, start a new curve
@@ -289,10 +282,10 @@
             if (no_limits || (cur<max_current && 90-hrz.alt<max_zd))
             {
-                const double angle = GetAngularSeparation(it->fMoonEqu, pos);
+                const double angle = GetAngularSeparation(so.fMoonEqu, pos);
                 g4.SetPoint(g4.GetN(), axis, angle);
             }
 
             if (cnt==0)
-                gm.SetPoint(gm.GetN(), axis, it->fMoonHrz.alt);
+                gm.SetPoint(gm.GetN(), axis, so.fMoonHrz.alt);
         }
 
