Index: /trunk/MagicSoft/Mars/Changelog
===================================================================
--- /trunk/MagicSoft/Mars/Changelog	(revision 3325)
+++ /trunk/MagicSoft/Mars/Changelog	(revision 3326)
@@ -28,4 +28,17 @@
    * msignal/Makefile:
      - removed obsolete includes
+
+   * mastro/Makefile, mastro/AstroLinkDef.h, mastro/MAstro.[h,cc],
+     mastro/MObservatory.[h,cc]:
+     - added
+
+   * mbase/MAstro.[h,cc]:
+     - removed
+
+   * mbase/Makefile, mbase/BaseLinkDef.h:
+     - removed MAstro
+
+   * Makefile:
+     - added mastro
 
 
Index: /trunk/MagicSoft/Mars/Makefile
===================================================================
--- /trunk/MagicSoft/Mars/Makefile	(revision 3325)
+++ /trunk/MagicSoft/Mars/Makefile	(revision 3326)
@@ -37,4 +37,5 @@
 #
 SUBDIRS = mbase \
+	  mastro \
 	  mmain \
           mfilter \
@@ -49,4 +50,5 @@
           mreflector \
           mgeom \
+          msql \
           mimage \
           mmontecarlo \
Index: /trunk/MagicSoft/Mars/mastro/AstroIncl.h
===================================================================
--- /trunk/MagicSoft/Mars/mastro/AstroIncl.h	(revision 3326)
+++ /trunk/MagicSoft/Mars/mastro/AstroIncl.h	(revision 3326)
@@ -0,0 +1,7 @@
+#ifndef __CINT__
+
+#include <TArrayC.h>
+#include "MArrayB.h"
+#include "MArrayS.h"
+
+#endif // __CINT__
Index: /trunk/MagicSoft/Mars/mastro/AstroLinkDef.h
===================================================================
--- /trunk/MagicSoft/Mars/mastro/AstroLinkDef.h	(revision 3326)
+++ /trunk/MagicSoft/Mars/mastro/AstroLinkDef.h	(revision 3326)
@@ -0,0 +1,10 @@
+#ifdef __CINT__
+
+#pragma link off all globals;
+#pragma link off all classes;
+#pragma link off all functions;
+
+#pragma link C++ class MAstro+;
+#pragma link C++ class MObservatory+;
+
+#endif
Index: /trunk/MagicSoft/Mars/mastro/MAstro.cc
===================================================================
--- /trunk/MagicSoft/Mars/mastro/MAstro.cc	(revision 3326)
+++ /trunk/MagicSoft/Mars/mastro/MAstro.cc	(revision 3326)
@@ -0,0 +1,238 @@
+/* ======================================================================== *\
+!
+! *
+! * This file is part of MARS, the MAGIC Analysis and Reconstruction
+! * Software. It is distributed to you in the hope that it can be a useful
+! * and timesaving tool in analysing Data of imaging Cerenkov telescopes.
+! * It is distributed WITHOUT ANY WARRANTY.
+! *
+! * Permission to use, copy, modify and distribute this software and its
+! * documentation for any purpose is hereby granted without fee,
+! * provided that the above copyright notice appear in all copies and
+! * that both that copyright notice and this permission notice appear
+! * in supporting documentation. It is provided "as is" without express
+! * or implied warranty.
+! *
+!
+!
+!   Author(s): Thomas Bretz, 11/2003 <mailto:tbretz@astro.uni-wuerzburg.de>
+!
+!   Copyright: MAGIC Software Development, 2000-2003
+!
+!
+\* ======================================================================== */
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// MAstro
+// ------
+//
+////////////////////////////////////////////////////////////////////////////
+#include "MAstro.h"
+
+ClassImp(MAstro);
+
+Double_t MAstro::Trunc(Double_t val)
+{
+    /* dint(A) - truncate to nearest whole number towards zero (double) */
+    return val<0 ? TMath::Ceil(val) : TMath::Floor(val);
+}
+
+Double_t MAstro::Round(Double_t val)
+{
+    /* dnint(A) - round to nearest whole number (double) */
+    return val<0 ? TMath::Ceil(val-0.5) : TMath::Floor(val+0.5);
+}
+
+Double_t MAstro::Hms2Sec(Int_t deg, UInt_t min, Double_t sec, Char_t sgn)
+{
+    const Double_t rc = TMath::Sign((60.0 * (60.0 * (Double_t)TMath::Abs(deg) + (Double_t)min) + sec), (Double_t)deg);
+    return sgn=='-' ? -rc : rc;
+}
+
+Double_t MAstro::Dms2Rad(Int_t deg, UInt_t min, Double_t sec, Char_t sgn)
+{
+    /* pi/(180*3600):  arcseconds to radians */
+#define DAS2R 4.8481368110953599358991410235794797595635330237270e-6
+    return Hms2Sec(deg, min, sec, sgn)*DAS2R;
+}
+
+Double_t MAstro::Hms2Rad(Int_t hor, UInt_t min, Double_t sec, Char_t sgn)
+{
+    /* pi/(12*3600):  seconds of time to radians */
+#define DS2R 7.2722052166430399038487115353692196393452995355905e-5
+    return Hms2Sec(hor, min, sec, sgn)*DS2R;
+}
+
+Double_t MAstro::Dms2Deg(Int_t deg, UInt_t min, Double_t sec, Char_t sgn)
+{
+    return Hms2Sec(deg, min, sec, sgn)/3600.;
+}
+
+Double_t MAstro::Hms2Deg(Int_t hor, UInt_t min, Double_t sec, Char_t sgn)
+{
+    return Hms2Sec(hor, min, sec, sgn)/240.;
+}
+
+Double_t MAstro::Dms2Hor(Int_t deg, UInt_t min, Double_t sec, Char_t sgn)
+{
+    return Hms2Sec(deg, min, sec, sgn)/15.;
+}
+
+Double_t MAstro::Hms2Hor(Int_t hor, UInt_t min, Double_t sec, Char_t sgn)
+{
+    return Hms2Sec(hor, min, sec, sgn)/3600.;
+}
+
+void MAstro::Day2Hms(Double_t day, Char_t &sgn, UShort_t &hor, UShort_t &min, UShort_t &sec)
+{
+    /* Handle sign */
+    sgn = day<0?'-':'+';
+
+    /* Round interval and express in smallest units required */
+    Double_t a = Round(86400. * TMath::Abs(day)); // Days to seconds
+
+    /* Separate into fields */
+    const Double_t ah = Trunc(a/3600.);
+    a -= ah * 3600.;
+    const Double_t am = Trunc(a/60.);
+    a -= am * 60.;
+    const Double_t as = Trunc(a);
+
+    /* Return results */
+    hor = (UShort_t)ah;
+    min = (UShort_t)am;
+    sec = (UShort_t)as;
+}
+
+void MAstro::Rad2Hms(Double_t rad, Char_t &sgn, UShort_t &deg, UShort_t &min, UShort_t &sec)
+{
+    Day2Hms(rad/(TMath::Pi()*2), sgn, deg, min, sec);
+}
+
+void MAstro::Rad2Dms(Double_t rad, Char_t &sgn, UShort_t &deg, UShort_t &min, UShort_t &sec)
+{
+    Rad2Hms(rad*15, sgn, deg, min, sec);
+}
+
+void MAstro::Deg2Dms(Double_t d, Char_t &sgn, UShort_t &deg, UShort_t &min, UShort_t &sec)
+{
+    Day2Hms(d/24, sgn, deg, min, sec);
+}
+
+void MAstro::Deg2Hms(Double_t d, Char_t &sgn, UShort_t &deg, UShort_t &min, UShort_t &sec)
+{
+    Rad2Hms(d/360, sgn, deg, min, sec);
+}
+
+void MAstro::Hor2Dms(Double_t h, Char_t &sgn, UShort_t &deg, UShort_t &min, UShort_t &sec)
+{
+    Day2Hms(h*15/24, sgn, deg, min, sec);
+}
+
+void MAstro::Hor2Hms(Double_t h, Char_t &sgn, UShort_t &deg, UShort_t &min, UShort_t &sec)
+{
+    Day2Hms(h/24, sgn, deg, min, sec);
+}
+
+void MAstro::Day2Hm(Double_t day, Char_t &sgn, UShort_t &hor, Double_t &min)
+{
+    /* Handle sign */
+    sgn = day<0?'-':'+';
+
+    /* Round interval and express in smallest units required */
+    Double_t a = Round(86400. * TMath::Abs(day)); // Days to seconds
+
+    /* Separate into fields */
+    const Double_t ah = Trunc(a/3600.);
+    a -= ah * 3600.;
+
+    /* Return results */
+    hor = (UShort_t)ah;
+    min = a/60.;
+}
+
+void MAstro::Rad2Hm(Double_t rad, Char_t &sgn, UShort_t &deg, Double_t &min)
+{
+    Day2Hm(rad/(TMath::Pi()*2), sgn, deg, min);
+}
+
+void MAstro::Rad2Dm(Double_t rad, Char_t &sgn, UShort_t &deg, Double_t &min)
+{
+    Rad2Hm(rad*15, sgn, deg, min);
+}
+
+void MAstro::Deg2Dm(Double_t d, Char_t &sgn, UShort_t &deg, Double_t &min)
+{
+    Day2Hm(d/24, sgn, deg, min);
+}
+
+void MAstro::Deg2Hm(Double_t d, Char_t &sgn, UShort_t &deg, Double_t &min)
+{
+    Rad2Hm(d/360, sgn, deg, min);
+}
+
+void MAstro::Hor2Dm(Double_t h, Char_t &sgn, UShort_t &deg, Double_t &min)
+{
+    Day2Hm(h*15/24, sgn, deg, min);
+}
+
+void MAstro::Hor2Hm(Double_t h, Char_t &sgn, UShort_t &deg, Double_t &min)
+{
+    Day2Hm(h/24, sgn, deg, min);
+}
+
+Bool_t MAstro::String2Angle(TString &str, Double_t &ret)
+{
+    Char_t  sgn;
+    Int_t   d, len;
+    UInt_t  m;
+    Float_t s;
+
+    // Skip whitespaces before %c and after %f
+    int n=sscanf(str.Data(), " %c %d %d %f %n", &sgn, &d, &m, &s, &len);
+
+    if (n!=4 || (sgn!='+' && sgn!='-'))
+        return kFALSE;
+
+    str.Remove(0, len);
+
+    ret = Dms2Deg(d, m, s, sgn);
+    return kTRUE;
+}
+
+void MAstro::Mjd2Ymd(UInt_t mjd, UShort_t &y, Byte_t &m, Byte_t &d)
+{
+    // Express day in Gregorian calendar
+    const ULong_t jd   = mjd + 2400001;
+    const ULong_t n4   = 4*(jd+((6*((4*jd-17918)/146097))/4+1)/2-37);
+    const ULong_t nd10 = 10*(((n4-237)%1461)/4)+5;
+
+    y = n4/1461L-4712;
+    m = ((nd10/306+2)%12)+1;
+    d = (nd10%306)/10+1;
+}
+
+Int_t MAstro::Ymd2Mjd(UShort_t y, Byte_t m, Byte_t d)
+{
+    // Month lengths in days
+    static int months[12] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
+
+    // Validate month
+    if (m<1 || m>12)
+        return -1;
+
+    // Allow for leap year
+    months[1] = (y%4==0 && (y%100!=0 || y%400==0)) ? 29 : 28;
+
+    // Validate day
+    if (d<1 || d>months[m-1])
+        return -1;
+
+    // Precalculate some values
+    const Byte_t  lm = 12-m;
+    const ULong_t lm10 = 4712 + y - lm/10;
+
+    // Perform the conversion
+    return 1461L*lm10/4 + (306*((m+9)%12)+5)/10 - (3*((lm10+188)/100))/4 + d - 2399904;
+}
Index: /trunk/MagicSoft/Mars/mastro/MAstro.h
===================================================================
--- /trunk/MagicSoft/Mars/mastro/MAstro.h	(revision 3326)
+++ /trunk/MagicSoft/Mars/mastro/MAstro.h	(revision 3326)
@@ -0,0 +1,47 @@
+#ifndef MARS_MAstro
+#define MARS_MAstro
+
+#ifndef ROOT_TROOT
+#include <TROOT.h>
+#endif
+
+class MAstro
+{
+private:
+    static Double_t Round(Double_t val);
+    static Double_t Trunc(Double_t val);
+
+public:
+    static Double_t Hms2Sec(Int_t deg, UInt_t min, Double_t sec, char sgn='+');
+    static Double_t Dms2Rad(Int_t deg, UInt_t min, Double_t sec, Char_t sgn='+');
+    static Double_t Hms2Rad(Int_t hor, UInt_t min, Double_t sec, Char_t sgn='+');
+    static Double_t Dms2Deg(Int_t deg, UInt_t min, Double_t sec, Char_t sgn='+');
+    static Double_t Hms2Deg(Int_t hor, UInt_t min, Double_t sec, Char_t sgn='+');
+    static Double_t Dms2Hor(Int_t deg, UInt_t min, Double_t sec, Char_t sgn='+');
+    static Double_t Hms2Hor(Int_t hor, UInt_t min, Double_t sec, Char_t sgn='+');
+
+    static void Day2Hms(Double_t rad, Char_t &sgn, UShort_t &deg, UShort_t &min, UShort_t &sec);
+    static void Rad2Dms(Double_t rad, Char_t &sgn, UShort_t &deg, UShort_t &min, UShort_t &sec);
+    static void Rad2Hms(Double_t rad, Char_t &sgn, UShort_t &deg, UShort_t &min, UShort_t &sec);
+    static void Deg2Dms(Double_t rad, Char_t &sgn, UShort_t &deg, UShort_t &min, UShort_t &sec);
+    static void Deg2Hms(Double_t rad, Char_t &sgn, UShort_t &deg, UShort_t &min, UShort_t &sec);
+    static void Hor2Dms(Double_t rad, Char_t &sgn, UShort_t &deg, UShort_t &min, UShort_t &sec);
+    static void Hor2Hms(Double_t rad, Char_t &sgn, UShort_t &deg, UShort_t &min, UShort_t &sec);
+
+    static void Day2Hm(Double_t rad, Char_t &sgn, UShort_t &deg, Double_t &min);
+    static void Rad2Dm(Double_t rad, Char_t &sgn, UShort_t &deg, Double_t &min);
+    static void Rad2Hm(Double_t rad, Char_t &sgn, UShort_t &deg, Double_t &min);
+    static void Deg2Dm(Double_t rad, Char_t &sgn, UShort_t &deg, Double_t &min);
+    static void Deg2Hm(Double_t rad, Char_t &sgn, UShort_t &deg, Double_t &min);
+    static void Hor2Dm(Double_t rad, Char_t &sgn, UShort_t &deg, Double_t &min);
+    static void Hor2Hm(Double_t rad, Char_t &sgn, UShort_t &deg, Double_t &min);
+
+    static Bool_t String2Angle(TString &str, Double_t &ret);
+
+    static void  Mjd2Ymd(UInt_t mjd, UShort_t &y, Byte_t &m, Byte_t &d);
+    static Int_t Ymd2Mjd(UShort_t y, Byte_t m, Byte_t d);
+
+    ClassDef(MAstro, 0)
+};
+
+#endif
Index: /trunk/MagicSoft/Mars/mastro/MObservatory.cc
===================================================================
--- /trunk/MagicSoft/Mars/mastro/MObservatory.cc	(revision 3326)
+++ /trunk/MagicSoft/Mars/mastro/MObservatory.cc	(revision 3326)
@@ -0,0 +1,93 @@
+/* ======================================================================== *\
+!
+! *
+! * This file is part of MARS, the MAGIC Analysis and Reconstruction
+! * Software. It is distributed to you in the hope that it can be a useful
+! * and timesaving tool in analysing Data of imaging Cerenkov telescopes.
+! * It is distributed WITHOUT ANY WARRANTY.
+! *
+! * Permission to use, copy, modify and distribute this software and its
+! * documentation for any purpose is hereby granted without fee,
+! * provided that the above copyright notice appear in all copies and
+! * that both that copyright notice and this permission notice appear
+! * in supporting documentation. It is provided "as is" without express
+! * or implied warranty.
+! *
+!
+!
+!   Author(s): Robert Wagner  10/2002 <mailto:magicsoft@rwagner.de>
+!   Author(s): Thomas Bretz   2/2003 <mailto:tbretz@astro.uni-wuerzburg.de>
+!
+!   Copyright: MAGIC Software Development, 2002-2004
+!
+!
+\* ======================================================================== */
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// MObservatory
+//
+/////////////////////////////////////////////////////////////////////////////
+#include "MObservatory.h"
+
+#include "MAstro.h"
+
+#include "MLog.h"
+#include "MLogManip.h"
+
+ClassImp(MObservatory);
+
+using namespace std;
+
+void MObservatory::Init(const char *name, const char *title)
+{
+    fName  = name  ? name  : "MObservatory";
+    fTitle = title ? title : "Storage container for coordinates of an observatory";   
+}
+
+MObservatory::MObservatory(const char *name, const char *title)
+{
+    Init(name, title);
+
+    SetLocation(kMagic1);
+}
+
+MObservatory::MObservatory(LocationName_t key, const char *name, const char *title)
+{
+    Init(name, title);
+
+    SetLocation(key);
+}
+
+void MObservatory::SetLocation(LocationName_t name)
+{
+    switch (name)
+    {
+    case kMagic1:
+        // Values taken from the GPS Receiver (avg 20h)
+        // on 26/11/2003 at 17h30 in the counting house
+        fLatitude  = MAstro::Dms2Rad(28, 45, 42.576, '+');
+        fLongitude = MAstro::Dms2Rad(17, 53, 26.460, '-');
+        fHeight    = 2196.5; // m
+        fObservatoryName = "Observatorio del Roque de los Muchachos (Magic1)";
+        return;
+
+    case kWuerzburgCity:
+        fLatitude  = MAstro::Dms2Rad(51, 38, 48.0);
+        fLongitude = MAstro::Dms2Rad( 9, 56, 36.0);
+        fHeight    = 300;
+        fObservatoryName = "Wuerzburg City";
+        return;
+
+    }
+}
+
+void MObservatory::Print(Option_t *) const
+{
+    *fLog << all;
+    *fLog << fObservatoryName << endl;
+    *fLog << "Latitude " << (fLatitude > 0 ? (fLatitude*kRad2Deg) : -(fLatitude*kRad2Deg)) << " deg " << (fLatitude > 0 ? "W" : "E") << endl;
+    *fLog << "Longitude " << (fLongitude > 0 ? (fLongitude*kRad2Deg) : -(fLongitude*kRad2Deg)) <<" deg " << (fLongitude < 0 ? "N" : "S") << endl;
+    *fLog << "Height " << fHeight << "m" << endl;
+}
+
Index: /trunk/MagicSoft/Mars/mastro/MObservatory.h
===================================================================
--- /trunk/MagicSoft/Mars/mastro/MObservatory.h	(revision 3326)
+++ /trunk/MagicSoft/Mars/mastro/MObservatory.h	(revision 3326)
@@ -0,0 +1,55 @@
+#ifndef MARS_MObservatory
+#define MARS_MObservatory
+
+#ifndef MARS_MParContainer
+#include "MParContainer.h"
+#endif
+
+class MObservatory : public MParContainer
+{
+public:
+    enum LocationName_t
+    {
+        kMagic1,
+        kWuerzburgCity
+    };
+
+private:
+    LocationName_t fObservatoryKey;  //!
+
+    TString  fObservatoryName;       //! Name of the observatory
+
+    Double_t fLongitude;             //! [rad] Longitude of observatory (+ east)
+    Double_t fLatitude;              //! [rad] Latitude of observatory (+ north)
+
+    Double_t fHeight;                //! [m] height of observatory
+
+    void Init(const char *name, const char *title);
+
+public:
+    MObservatory(const char *name=NULL, const char *title=NULL);
+    MObservatory(LocationName_t key, const char *name=NULL, const char *title=NULL);
+
+    void SetLocation(LocationName_t name);
+
+    void Print(Option_t *o=0) const;
+
+    const TString &GetObservatoryName() const { return fObservatoryName; }
+
+    Double_t GetLatitudeDeg() const     { return fLatitude*kRad2Deg; }  //[deg]
+    Double_t GetLongitudeDeg() const    { return fLongitude*kRad2Deg; } //[deg]
+
+    Double_t GetLatitudeRad() const     { return fLatitude; }           //[rad]
+    Double_t GetLongitudeRad() const    { return fLongitude; }          //[rad]
+
+    Double_t GetPhi() const             { return fLatitude; }           //[rad]
+    Double_t GetElong() const           { return fLongitude; }          //[rad]
+
+    Double_t GetHeight() const          { return fHeight; }
+
+    LocationName_t GetObservatoryKey() const { return fObservatoryKey; }
+
+    ClassDef(MObservatory, 0) // class storing observatory locations
+};
+
+#endif
Index: /trunk/MagicSoft/Mars/mastro/Makefile
===================================================================
--- /trunk/MagicSoft/Mars/mastro/Makefile	(revision 3326)
+++ /trunk/MagicSoft/Mars/mastro/Makefile	(revision 3326)
@@ -0,0 +1,54 @@
+##################################################################
+#
+#   makefile
+# 
+#   for the MARS software
+#
+##################################################################
+include ../Makefile.conf.$(OSTYPE)
+include ../Makefile.conf.general
+
+#
+# Handling name of the Root Dictionary Files
+#
+CINT  = Astro
+
+#
+# Library name to creatre
+#
+LIB   = mastro.a
+
+#
+#  connect the include files defined in the config.mk file
+#
+INCLUDES =  -I. -I../mbase
+
+# mgui (MCamEvent):         MExtractSignalCam
+# mgeom(MGeomCam):          MArrivalTime
+# mtools(MCubicSpline):     MArrivalTime
+# mraw (MRawEvtData):       MExtractSignal
+# manalysis (MPedestalCam): MExtractSignal
+
+#------------------------------------------------------------------------------
+
+.SUFFIXES: .c .cc .cxx .h .hxx .o 
+
+SRCFILES = MAstro.cc \
+           MObservatory.cc
+
+SRCS    = $(SRCFILES)
+HEADERS = $(SRCFILES:.cc=.h)
+OBJS    = $(SRCFILES:.cc=.o) 
+
+############################################################
+
+all: $(LIB)
+
+include ../Makefile.rules
+
+#clean:	rmcint rmobjs rmcore rmlib
+
+mrproper:	clean rmbak
+
+# @endcode
+
Index: /trunk/MagicSoft/Mars/mbase/BaseLinkDef.h
===================================================================
--- /trunk/MagicSoft/Mars/mbase/BaseLinkDef.h	(revision 3325)
+++ /trunk/MagicSoft/Mars/mbase/BaseLinkDef.h	(revision 3326)
@@ -6,9 +6,6 @@
 
 // Global constants
-#pragma link C++ enum ParticleId_t;
-
 #pragma link C++ global kCONTINUE;
 #pragma link C++ global kRad2Deg;
-//#pragma link C++ global kPI;
 
 // Logging
@@ -26,6 +23,4 @@
 #pragma link C++ class MDirIter+;
 #pragma link C++ class MRunIter+;
-
-#pragma link C++ class MAstro+;
 
 // Mars core
Index: unk/MagicSoft/Mars/mbase/MAstro.cc
===================================================================
--- /trunk/MagicSoft/Mars/mbase/MAstro.cc	(revision 3325)
+++ 	(revision )
@@ -1,238 +1,0 @@
-/* ======================================================================== *\
-!
-! *
-! * This file is part of MARS, the MAGIC Analysis and Reconstruction
-! * Software. It is distributed to you in the hope that it can be a useful
-! * and timesaving tool in analysing Data of imaging Cerenkov telescopes.
-! * It is distributed WITHOUT ANY WARRANTY.
-! *
-! * Permission to use, copy, modify and distribute this software and its
-! * documentation for any purpose is hereby granted without fee,
-! * provided that the above copyright notice appear in all copies and
-! * that both that copyright notice and this permission notice appear
-! * in supporting documentation. It is provided "as is" without express
-! * or implied warranty.
-! *
-!
-!
-!   Author(s): Thomas Bretz, 11/2003 <mailto:tbretz@astro.uni-wuerzburg.de>
-!
-!   Copyright: MAGIC Software Development, 2000-2003
-!
-!
-\* ======================================================================== */
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// MAstro
-// ------
-//
-////////////////////////////////////////////////////////////////////////////
-#include "MAstro.h"
-
-ClassImp(MAstro);
-
-Double_t MAstro::Trunc(Double_t val)
-{
-    /* dint(A) - truncate to nearest whole number towards zero (double) */
-    return val<0 ? TMath::Ceil(val) : TMath::Floor(val);
-}
-
-Double_t MAstro::Round(Double_t val)
-{
-    /* dnint(A) - round to nearest whole number (double) */
-    return val<0 ? TMath::Ceil(val-0.5) : TMath::Floor(val+0.5);
-}
-
-Double_t MAstro::Hms2Sec(Int_t deg, UInt_t min, Double_t sec, Char_t sgn)
-{
-    const Double_t rc = TMath::Sign((60.0 * (60.0 * (Double_t)TMath::Abs(deg) + (Double_t)min) + sec), (Double_t)deg);
-    return sgn=='-' ? -rc : rc;
-}
-
-Double_t MAstro::Dms2Rad(Int_t deg, UInt_t min, Double_t sec, Char_t sgn)
-{
-    /* pi/(180*3600):  arcseconds to radians */
-#define DAS2R 4.8481368110953599358991410235794797595635330237270e-6
-    return Hms2Sec(deg, min, sec, sgn)*DAS2R;
-}
-
-Double_t MAstro::Hms2Rad(Int_t hor, UInt_t min, Double_t sec, Char_t sgn)
-{
-    /* pi/(12*3600):  seconds of time to radians */
-#define DS2R 7.2722052166430399038487115353692196393452995355905e-5
-    return Hms2Sec(hor, min, sec, sgn)*DS2R;
-}
-
-Double_t MAstro::Dms2Deg(Int_t deg, UInt_t min, Double_t sec, Char_t sgn)
-{
-    return Hms2Sec(deg, min, sec, sgn)/3600.;
-}
-
-Double_t MAstro::Hms2Deg(Int_t hor, UInt_t min, Double_t sec, Char_t sgn)
-{
-    return Hms2Sec(hor, min, sec, sgn)/240.;
-}
-
-Double_t MAstro::Dms2Hor(Int_t deg, UInt_t min, Double_t sec, Char_t sgn)
-{
-    return Hms2Sec(deg, min, sec, sgn)/15.;
-}
-
-Double_t MAstro::Hms2Hor(Int_t hor, UInt_t min, Double_t sec, Char_t sgn)
-{
-    return Hms2Sec(hor, min, sec, sgn)/3600.;
-}
-
-void MAstro::Day2Hms(Double_t day, Char_t &sgn, UShort_t &hor, UShort_t &min, UShort_t &sec)
-{
-    /* Handle sign */
-    sgn = day<0?'-':'+';
-
-    /* Round interval and express in smallest units required */
-    Double_t a = Round(86400. * TMath::Abs(day)); // Days to seconds
-
-    /* Separate into fields */
-    const Double_t ah = Trunc(a/3600.);
-    a -= ah * 3600.;
-    const Double_t am = Trunc(a/60.);
-    a -= am * 60.;
-    const Double_t as = Trunc(a);
-
-    /* Return results */
-    hor = (UShort_t)ah;
-    min = (UShort_t)am;
-    sec = (UShort_t)as;
-}
-
-void MAstro::Rad2Hms(Double_t rad, Char_t &sgn, UShort_t &deg, UShort_t &min, UShort_t &sec)
-{
-    Day2Hms(rad/(TMath::Pi()*2), sgn, deg, min, sec);
-}
-
-void MAstro::Rad2Dms(Double_t rad, Char_t &sgn, UShort_t &deg, UShort_t &min, UShort_t &sec)
-{
-    Rad2Hms(rad*15, sgn, deg, min, sec);
-}
-
-void MAstro::Deg2Dms(Double_t d, Char_t &sgn, UShort_t &deg, UShort_t &min, UShort_t &sec)
-{
-    Day2Hms(d/24, sgn, deg, min, sec);
-}
-
-void MAstro::Deg2Hms(Double_t d, Char_t &sgn, UShort_t &deg, UShort_t &min, UShort_t &sec)
-{
-    Rad2Hms(d/360, sgn, deg, min, sec);
-}
-
-void MAstro::Hor2Dms(Double_t h, Char_t &sgn, UShort_t &deg, UShort_t &min, UShort_t &sec)
-{
-    Day2Hms(h*15/24, sgn, deg, min, sec);
-}
-
-void MAstro::Hor2Hms(Double_t h, Char_t &sgn, UShort_t &deg, UShort_t &min, UShort_t &sec)
-{
-    Day2Hms(h/24, sgn, deg, min, sec);
-}
-
-void MAstro::Day2Hm(Double_t day, Char_t &sgn, UShort_t &hor, Double_t &min)
-{
-    /* Handle sign */
-    sgn = day<0?'-':'+';
-
-    /* Round interval and express in smallest units required */
-    Double_t a = Round(86400. * TMath::Abs(day)); // Days to seconds
-
-    /* Separate into fields */
-    const Double_t ah = Trunc(a/3600.);
-    a -= ah * 3600.;
-
-    /* Return results */
-    hor = (UShort_t)ah;
-    min = a/60.;
-}
-
-void MAstro::Rad2Hm(Double_t rad, Char_t &sgn, UShort_t &deg, Double_t &min)
-{
-    Day2Hm(rad/(TMath::Pi()*2), sgn, deg, min);
-}
-
-void MAstro::Rad2Dm(Double_t rad, Char_t &sgn, UShort_t &deg, Double_t &min)
-{
-    Rad2Hm(rad*15, sgn, deg, min);
-}
-
-void MAstro::Deg2Dm(Double_t d, Char_t &sgn, UShort_t &deg, Double_t &min)
-{
-    Day2Hm(d/24, sgn, deg, min);
-}
-
-void MAstro::Deg2Hm(Double_t d, Char_t &sgn, UShort_t &deg, Double_t &min)
-{
-    Rad2Hm(d/360, sgn, deg, min);
-}
-
-void MAstro::Hor2Dm(Double_t h, Char_t &sgn, UShort_t &deg, Double_t &min)
-{
-    Day2Hm(h*15/24, sgn, deg, min);
-}
-
-void MAstro::Hor2Hm(Double_t h, Char_t &sgn, UShort_t &deg, Double_t &min)
-{
-    Day2Hm(h/24, sgn, deg, min);
-}
-
-Bool_t MAstro::String2Angle(TString &str, Double_t &ret)
-{
-    Char_t  sgn;
-    Int_t   d, len;
-    UInt_t  m;
-    Float_t s;
-
-    // Skip whitespaces before %c and after %f
-    int n=sscanf(str.Data(), " %c %d %d %f %n", &sgn, &d, &m, &s, &len);
-
-    if (n!=4 || (sgn!='+' && sgn!='-'))
-        return kFALSE;
-
-    str.Remove(0, len);
-
-    ret = Dms2Deg(d, m, s, sgn);
-    return kTRUE;
-}
-
-void MAstro::Mjd2Ymd(UInt_t mjd, UShort_t &y, Byte_t &m, Byte_t &d)
-{
-    // Express day in Gregorian calendar
-    const ULong_t jd   = mjd + 2400001;
-    const ULong_t n4   = 4*(jd+((6*((4*jd-17918)/146097))/4+1)/2-37);
-    const ULong_t nd10 = 10*(((n4-237)%1461)/4)+5;
-
-    y = n4/1461L-4712;
-    m = ((nd10/306+2)%12)+1;
-    d = (nd10%306)/10+1;
-}
-
-Int_t MAstro::Ymd2Mjd(UShort_t y, Byte_t m, Byte_t d)
-{
-    // Month lengths in days
-    static int months[12] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
-
-    // Validate month
-    if (m<1 || m>12)
-        return -1;
-
-    // Allow for leap year
-    months[1] = (y%4==0 && (y%100!=0 || y%400==0)) ? 29 : 28;
-
-    // Validate day
-    if (d<1 || d>months[m-1])
-        return -1;
-
-    // Precalculate some values
-    const Byte_t  lm = 12-m;
-    const ULong_t lm10 = 4712 + y - lm/10;
-
-    // Perform the conversion
-    return 1461L*lm10/4 + (306*((m+9)%12)+5)/10 - (3*((lm10+188)/100))/4 + d - 2399904;
-}
Index: unk/MagicSoft/Mars/mbase/MAstro.h
===================================================================
--- /trunk/MagicSoft/Mars/mbase/MAstro.h	(revision 3325)
+++ 	(revision )
@@ -1,47 +1,0 @@
-#ifndef MARS_MAstro
-#define MARS_MAstro
-
-#ifndef ROOT_TROOT
-#include <TROOT.h>
-#endif
-
-class MAstro
-{
-private:
-    static Double_t Round(Double_t val);
-    static Double_t Trunc(Double_t val);
-
-public:
-    static Double_t Hms2Sec(Int_t deg, UInt_t min, Double_t sec, char sgn='+');
-    static Double_t Dms2Rad(Int_t deg, UInt_t min, Double_t sec, Char_t sgn='+');
-    static Double_t Hms2Rad(Int_t hor, UInt_t min, Double_t sec, Char_t sgn='+');
-    static Double_t Dms2Deg(Int_t deg, UInt_t min, Double_t sec, Char_t sgn='+');
-    static Double_t Hms2Deg(Int_t hor, UInt_t min, Double_t sec, Char_t sgn='+');
-    static Double_t Dms2Hor(Int_t deg, UInt_t min, Double_t sec, Char_t sgn='+');
-    static Double_t Hms2Hor(Int_t hor, UInt_t min, Double_t sec, Char_t sgn='+');
-
-    static void Day2Hms(Double_t rad, Char_t &sgn, UShort_t &deg, UShort_t &min, UShort_t &sec);
-    static void Rad2Dms(Double_t rad, Char_t &sgn, UShort_t &deg, UShort_t &min, UShort_t &sec);
-    static void Rad2Hms(Double_t rad, Char_t &sgn, UShort_t &deg, UShort_t &min, UShort_t &sec);
-    static void Deg2Dms(Double_t rad, Char_t &sgn, UShort_t &deg, UShort_t &min, UShort_t &sec);
-    static void Deg2Hms(Double_t rad, Char_t &sgn, UShort_t &deg, UShort_t &min, UShort_t &sec);
-    static void Hor2Dms(Double_t rad, Char_t &sgn, UShort_t &deg, UShort_t &min, UShort_t &sec);
-    static void Hor2Hms(Double_t rad, Char_t &sgn, UShort_t &deg, UShort_t &min, UShort_t &sec);
-
-    static void Day2Hm(Double_t rad, Char_t &sgn, UShort_t &deg, Double_t &min);
-    static void Rad2Dm(Double_t rad, Char_t &sgn, UShort_t &deg, Double_t &min);
-    static void Rad2Hm(Double_t rad, Char_t &sgn, UShort_t &deg, Double_t &min);
-    static void Deg2Dm(Double_t rad, Char_t &sgn, UShort_t &deg, Double_t &min);
-    static void Deg2Hm(Double_t rad, Char_t &sgn, UShort_t &deg, Double_t &min);
-    static void Hor2Dm(Double_t rad, Char_t &sgn, UShort_t &deg, Double_t &min);
-    static void Hor2Hm(Double_t rad, Char_t &sgn, UShort_t &deg, Double_t &min);
-
-    static Bool_t String2Angle(TString &str, Double_t &ret);
-
-    static void  Mjd2Ymd(UInt_t mjd, UShort_t &y, Byte_t &m, Byte_t &d);
-    static Int_t Ymd2Mjd(UShort_t y, Byte_t m, Byte_t d);
-
-    ClassDef(MAstro, 0)
-};
-
-#endif
Index: /trunk/MagicSoft/Mars/mbase/Makefile
===================================================================
--- /trunk/MagicSoft/Mars/mbase/Makefile	(revision 3325)
+++ /trunk/MagicSoft/Mars/mbase/Makefile	(revision 3326)
@@ -35,5 +35,4 @@
 SRCFILES = MLogo.cc \
            MArgs.cc \
-           MAstro.cc \
 	   MLog.cc \
            MLogManip.cc \
