Index: /trunk/Mars/macros/libnova/sun.C
===================================================================
--- /trunk/Mars/macros/libnova/sun.C	(revision 15194)
+++ /trunk/Mars/macros/libnova/sun.C	(revision 15194)
@@ -0,0 +1,47 @@
+void sun()
+{
+    TGraph gr, gs;
+
+    ln_lnlat_posn observer;
+    observer.lng = -(17.+53./60+26.525/3600);
+    observer.lat =   28.+45./60+42.462/3600;
+
+    MTime t(MTime(-1).Year(), 01, 01, 00);
+
+    const double jd = t.GetJD();
+    const double at = t.GetAxisTime();
+
+    for (int d=0; d<365; d++)
+    {
+        ln_rst_time sun_day;
+        ln_get_solar_rst(jd+d, &observer, &sun_day);
+
+        gr.SetPoint(gr.GetN(), at+d*24*3600, (fmod(sun_day.rise, 1)-0.5)*24*3600+at);
+        gs.SetPoint(gs.GetN(), at+d*24*3600, (fmod(sun_day.set,  1)+0.5)*24*3600+at);
+    }
+
+    TH1S h("", "", 12*60, at+2*24*3600, at+365*24*3600);
+    h.SetStats(kFALSE);
+    h.SetMinimum(at);
+    h.SetMaximum(at+24*3600);
+
+    h.GetXaxis()->CenterLabels();
+    h.GetXaxis()->CenterTitle();
+    h.GetXaxis()->SetNdivisions(412, kFALSE);  // 4 weeks per month, 12 months per year
+    h.GetXaxis()->SetTitle("Month");
+    h.GetXaxis()->SetTimeDisplay(true);
+    h.GetXaxis()->SetTimeFormat("%m %F1995-01-01 00:00:00 GMT");
+
+    h.GetYaxis()->SetTitle("UTC");
+    h.GetYaxis()->SetNdivisions(412, kFALSE);  // 12 'hours' ticks every 15min.
+    h.GetYaxis()->SetTitleOffset(1.4);
+    h.GetYaxis()->SetTimeDisplay(true);
+    h.GetYaxis()->SetTimeFormat("%Hh %F1995-01-01 00:00:00 GMT");
+
+    h.DrawCopy();
+
+    gPad->SetGrid();
+
+    gr.DrawClone("P");
+    gs.DrawClone("P");
+}
