Index: trunk/MagicSoft/Cosy/catalog/SaoFile.cc
===================================================================
--- trunk/MagicSoft/Cosy/catalog/SaoFile.cc	(revision 8846)
+++ 	(revision )
@@ -1,239 +1,0 @@
-#include "SaoFile.h"
-
-#include <iostream.h>
-#include <string.h>
-
-#include "slamac.h"
-
-#include "File.h"
-
-#define FALSE 0
-#define TRUE  1
-
-ClassImp(SaoFile);
-
-static int lt(sort_t *t1, sort_t *t2)
-{
-    // t1->ra < t2->ra
-    if (t1->ra < t2->ra)
-        return 1;
-
-    // t1->ra > t2->ra
-    if (t1->ra > t2->ra)
-        return 0;
-
-    // t1->ra == t2->ra
-    if (t1->dec < t2->dec)
-        return 1;
-    else
-        return 0;
-}
-
-
-static void rekMergesort(sort_t **a, int length, int l, int r)
-{
-    // a recursive merge sort algorithm
-    if ( r <= l )
-        return;
-
-    sort_t **b = new sort_t*[length];
-
-    int m = (r+l)/2;
-
-    rekMergesort(a, length, l, m);
-
-    rekMergesort(a, length, m+1, r);
-
-    int i;
-    for (i=m+1; i>l; i--)
-        b[i-1]=a[i-1];
-
-    int j;
-    for (j=m; j<r; j++)
-        b[r+m-j]=a[j+1];
-
-    int k;
-    for (k=l; k<=r; k++)
-    {
-        if (lt( b[i],b[j]) )
-            a[k]=b[i++];
-        else
-            a[k]=b[j--];
-    }
-
-    delete b;
-}
-
-SaoFile::SaoFile(const char *name)
-{
-    file = new File(name, "r");
-
-    if (!*file)
-        exit(0);
-
-    compressed = !strcasecmp(name+strlen(name)-4, ".cmp");
-
-    fEntries = file->Size()/(compressed?70-20:205);
-
-    cout << "Opening" << (compressed?" compressed":"") << " catalog '" << name << "'"
-        << " with " << fEntries << " entries" << endl;
-
-    delFlag = ' ';
-}
-
-SaoFile::~SaoFile()
-{
-    delete file;
-}
-
-int SaoFile::GetEntryNr() const
-{
-    return file->Tell()/(compressed?70-20:205);
-}
-
-int SaoFile::GetEntry(const int i)
-{
-    file->Seek(i*(compressed?70-20:205));
-    return GetNextEntry();
-}
-
-void SaoFile::Reset() const
-{
-    file->Seek(0);
-}
-
-int SaoFile::GetNextEntry()
-{
-    if (file->Eof())
-        return FALSE;
-
-    SAO = file->Geti(6);
-    if (!compressed)
-    {
-        delFlag = file->Getc();
-        file->Skip(77-8);
-    }
-    Pmag      = file->Getf(4);
-    Vmag      = file->Getf(4);
-    if (!compressed)
-        file->Skip(161/*151*/-85);
-    /*
-     RA2000h   = file->geti(2);
-     RA2000m   = file->geti(2);
-     RA2000s   = file->getf(6);
-     */
-    pmRA2000  = file->Getf(7);
-    if (!compressed)
-        file->Skip(178-168);
-    /*
-     DE2000sgn = file->getc();
-     DE2000d   = file->geti(2);
-     DE2000m   = file->geti(2);
-     DE2000s   = file->getf(5);
-     */
-    pmDE2000  = file->Getf(6);
-    RA2000rad = file->Getf(10);
-    DE2000rad = file->Getf(11);
-    file->Newline();
-
-    sprintf(data, "%6i%4.1f%4.1f"/*"%2i%2i%6.3f"*/"%7.4f"/*"%c%2i%2i%5.2f"*/"%6.3f%10.8f%11.8f\n",
-            Nr(), MagP(), MagV(), /*RaH(), RaM(), RaS(),*/ RaPm(),
-            /*DecSgn(), DecD(), DecM(), DecS(),*/ DecPm(), Ra(), Dec());
-
-    return !file->Eof();
-}
-
-void SaoFile::Print() const
-{
-    cout << SAO << " " << delFlag << " " << Pmag << " " << Vmag << " "
-        << /*RA2000h << "h" << RA2000m << "m" << RA2000s << "s " << */pmRA2000 << " "
-        << /*DE2000sgn << DE2000d << "d" << DE2000m << "m" << DE2000s << "s " << */pmDE2000 << " Ra:"
-        << RA2000rad << " Dec:" << DE2000rad << endl;
-}
-
-void SaoFile::Compress()
-{
-    FILE *f = fopen("sao.cmp", "w");
-
-    cout << endl << " Compressing catalog..." << flush;
-
-    const int entries = GetNrOfEntries();
-    const int step    = entries/360;
-
-    for (int i=0; i<entries; i++)
-    {
-        GetNextEntry();
-
-        if (!DelFlag())
-            fprintf(f, String());
-
-        if (i%step==0)
-            cout << "." << flush;
-    }
-    cout << "done." << endl;
-
-    fclose(f);
-}
-
-void SaoFile::Sort()
-{
-    cout << endl << "Reading coordinates..." << flush;
-
-    const int entries=GetNrOfEntries();
-
-    sort_t **srt = new sort_t*[entries];
-    for (int i=0; i<entries; i++)
-        srt[i] = new sort_t;
-
-    int counter=0;
-    const int step = entries/360;
-    while(GetNextEntry())
-    {
-        srt[counter]->ra  = (int)(360.0*(Ra()/D2PI));
-        srt[counter]->dec = (int)(360.0*(Dec()/D2PI));
-        srt[counter]->nr  = counter;
-
-        if (counter%step==0)
-            cout << "." << flush;
-
-        counter++;
-    }
-    cout << "done." << endl << endl;
-
-    /* sort entries */
-    cout << "Sorting coordinates..." << flush;
-    rekMergesort(srt, entries, 0, entries-1);
-    cout << "done." << endl << endl;
-
-    cout << "Writing sorted catalogue..." << flush;
-    FILE *f   = fopen("sao-sort.cmp", "w");
-    FILE *idx = fopen("sao-sort.idx", "w");
-
-    int ra=0, ral=0;
-    int dec=0, decl=0;
-    for (int i=0; i<entries; i++)
-    {
-        GetEntry(srt[i]->nr);
-
-        ra  = (int)(360.0*Ra()/D2PI);
-        dec = (int)(360.0*Dec()/D2PI);
-
-        if (ra!=ral || dec!=decl)
-        {
-            if (ra!=ral)
-                cout << "." << flush;
-            fprintf(idx, "%3d %3d %10d\n", ra, dec, i);
-        }
-
-        ral = ra;
-        decl = dec;
-
-        fprintf(f, String());
-        if (i%5000==0)
-            cout << "." << flush;
-    }
-    fclose(idx);
-    fclose(f);
-    cout << "done." << endl;
-}
-
Index: trunk/MagicSoft/Cosy/catalog/SaoFile.h
===================================================================
--- trunk/MagicSoft/Cosy/catalog/SaoFile.h	(revision 8846)
+++ 	(revision )
@@ -1,86 +1,0 @@
-#ifndef COSY_SaoFile
-#define COSY_SaoFile
-
-#ifndef ROOT_TROOT
-#include <TROOT.h>
-#endif
-
-struct _sort
-{
-   int ra;
-   int dec;
-   int nr;
-};
-
-typedef struct _sort sort_t;
-
-class File;
-
-class SaoFile
-{
-private:
-    File *file;
-    int compressed;
-
-    char data[205];
-
-    int   SAO;
-    char  delFlag;
-    float Pmag;
-    float Vmag;
-    // int   RA2000h;
-    // int   RA2000m;
-    // float RA2000s;
-    float pmRA2000;
-    // char  DE2000sgn;
-    // int   DE2000d;
-    // int   DE2000m;
-    float DE2000s;
-    float pmDE2000;
-    float RA2000rad;
-    float DE2000rad;
-
-    int fEntries;
-
-public:
-    SaoFile(const char *name);
-    virtual ~SaoFile();
-
-    void  Compress();
-    void  Sort();
-
-    int   GetEntryNr() const;
-    int   GetEntry(const int i);
-    void  Reset() const;
-    int   GetNextEntry();
-    void  Print() const;
-
-    int   GetNrOfEntries() const { return fEntries; }
-
-    int   Nr() const          { return SAO; }
-    int   DelFlag() const     { return delFlag=='D'; }
-    float MagP() const        { return Pmag; }
-    float MagV() const        { return Vmag; }
-    float Ra() const          { return RA2000rad; }
-    float Dec() const         { return DE2000rad; }
-    RaDec GetRaDec() const    { return RaDec(RA2000rad, DE2000rad); }
-
-    float RaPm() const        { return pmRA2000; }
-    float DecPm() const       { return pmDE2000; }
-    RaDec GetRaDecPm() const  { return RaDec(pmRA2000, pmDE2000); }
-
-
-    // char DecSgn()   { return DE2000sgn; }
-    // int   RaH()     { return RA2000h; }
-    // int   DecD()    { return DE2000d; }
-    // int   RaM()     { return RA2000m; }
-    // int   DecM()    { return DE2000m; }
-    // float RaS()     { return RA2000s; }
-    // float DecS()    { return DE2000s; }
-
-    const char *String() const { return data; }
-
-    ClassDef(SaoFile, 0)
-};
-
-#endif
Index: trunk/MagicSoft/Cosy/catalog/SlaPlanets.h
===================================================================
--- trunk/MagicSoft/Cosy/catalog/SlaPlanets.h	(revision 8846)
+++ trunk/MagicSoft/Cosy/catalog/SlaPlanets.h	(revision 8847)
@@ -1,7 +1,11 @@
-#ifndef SLAPLANETS_H
-#define SLAPLANETS_H
+#ifndef COSY_SlaPlanets
+#define COSY_SlaPlanets
 
-#ifndef SLALIB_H
+#ifndef COSY_Slalib
 #include "Slalib.h"
+#endif
+
+#ifndef MARS_MPointing
+#include "MPointing.h"
 #endif
 
Index: trunk/MagicSoft/Cosy/catalog/SlaStars.cc
===================================================================
--- trunk/MagicSoft/Cosy/catalog/SlaStars.cc	(revision 8846)
+++ trunk/MagicSoft/Cosy/catalog/SlaStars.cc	(revision 8847)
@@ -2,4 +2,6 @@
 
 #include "slalib.h"
+
+#include "MPointing.h"
 
 ClassImp(SlaStars);
Index: trunk/MagicSoft/Cosy/catalog/SlaStars.h
===================================================================
--- trunk/MagicSoft/Cosy/catalog/SlaStars.h	(revision 8846)
+++ trunk/MagicSoft/Cosy/catalog/SlaStars.h	(revision 8847)
@@ -1,8 +1,12 @@
-#ifndef SLASTARS_H
-#define SLASTARS_H
+#ifndef COSY_SlaStars
+#define COSY_SlaStars
 
+#ifndef COSY_Slalib
 #include "Slalib.h"
+#endif
 
-#include "coord.h"
+#ifndef MARS_MPointing
+#include "MPointing.h"
+#endif
 
 class SlaStars : public Slalib
Index: trunk/MagicSoft/Cosy/catalog/Slalib.cc
===================================================================
--- trunk/MagicSoft/Cosy/catalog/Slalib.cc	(revision 8846)
+++ trunk/MagicSoft/Cosy/catalog/Slalib.cc	(revision 8847)
@@ -4,5 +4,5 @@
 #include <iostream>  // cout
 
-#include "coord.h"
+#include "MPointing.h"
 
 #include "slalib.h"
Index: trunk/MagicSoft/Cosy/catalog/Slalib.h
===================================================================
--- trunk/MagicSoft/Cosy/catalog/Slalib.h	(revision 8846)
+++ trunk/MagicSoft/Cosy/catalog/Slalib.h	(revision 8847)
@@ -1,10 +1,14 @@
-#ifndef SLALIB_H
-#define SLALIB_H
+#ifndef COSY_Slalib
+#define COSY_Slalib
 
-#include <TROOT.h>
+#ifndef MARS_MTime
+#include "MTime.h"
+#endif
 
-#include "coord.h"
-#include "MTime.h"
+#ifndef MARS_MObservatory
 #include "MObservatory.h"
+#endif
+
+class ZdAz;
 
 class Slalib : public MObservatory
Index: trunk/MagicSoft/Cosy/catalog/StarCatalog.h
===================================================================
--- trunk/MagicSoft/Cosy/catalog/StarCatalog.h	(revision 8846)
+++ trunk/MagicSoft/Cosy/catalog/StarCatalog.h	(revision 8847)
@@ -8,12 +8,7 @@
 #include <GuiTypes.h>
 #endif
-#ifndef SAOFILE_H
-#include "SaoFile.h"
-#endif
-#ifndef SLASTARS_H
+#ifndef COSY_SlaStars
 #include "SlaStars.h"
 #endif
-
-#include "coord.h"
 
 typedef unsigned char byte;
