Index: trunk/MagicSoft/Cosy/catalog/StarCatalog.cc
===================================================================
--- trunk/MagicSoft/Cosy/catalog/StarCatalog.cc	(revision 4104)
+++ trunk/MagicSoft/Cosy/catalog/StarCatalog.cc	(revision 4865)
@@ -16,5 +16,5 @@
 ClassImp(StarCatalog);
 
-StarCatalog::StarCatalog(MObservatory::LocationName_t key) : SlaStars(key), fAstro(0), /*fSao(NULL), fSrt(NULL), fEntries(0),*/ fSinAngle(0), fCosAngle(1)
+StarCatalog::StarCatalog(MObservatory::LocationName_t key) : SlaStars(key), fW(768), fH(576), fAstro(0), /*fSao(NULL), fSrt(NULL), fEntries(0),*/ fSinAngle(0), fCosAngle(1), fBox(768)
 {
     fAstro = new MAstroCatalog;
@@ -136,12 +136,32 @@
     {
         const int mag = (10 - (star->GetMag()>1 ? (int)star->GetMag() : 1))/2;
-
-        Double_t color = 0xf0; //0x0f;
-        DrawCircle(color, img, (int)star->GetX(), (int)star->GetY(), mag);
+        Double_t color = 0xf0; //0x0f;       
+	// DrawStars flips the picture in X defaultwise now
+        DrawCircle(color, img, 768-(int)star->GetX(), (int)star->GetY(), mag);
     }
 }
 
-void StarCatalog::CalcStars(MStarList &list) const
-{
+void StarCatalog::CalcStars(MStarList &list)
+{
+    // full FOV
+    fBox=768;
+    CalcStars(list, 0, 576, 0, 0);
+}
+
+void StarCatalog::CalcStars(MStarList &list, int xc, int yc, 
+			    int xo, int yo) const
+{
+
+    // CalcStars flips the picture in X defaultwise now
+    int x0 = (768-xc)-fBox;
+    int x1 = (768-xc)+fBox;
+    int y0 = yc-fBox;
+    int y1 = yc+fBox;
+
+    if (x0<0) x0=0;
+    if (y0<0) y0=0;
+    if (x1>fW) x1=fW;
+    if (y1>fH) y1=fH;
+
     // Align stars into telescope system
     // (Move the telescope to pointing position)
@@ -196,9 +216,11 @@
         Float_t yy = loc.X()*fSinAngle + loc.Y()*fCosAngle;
 
-        if (xx<0 || xx >=768 || yy<0 || yy>=576)
+        if (xx<(x0-768/2) || xx >=(x1-768/2) 
+	    || yy<(y0-(576/2+yo)) || yy>=(y1-(576/2+yo)))
             continue;
 
         // Store pixel coordinates of star in list
-        list.Add(xx+768/2, yy+576/2, -2.5*log10(mag));
+        list.Add(xx+768/2+xo, yy+576/2+yo, -2.5*log10(mag));
+
     }
 }
Index: trunk/MagicSoft/Cosy/catalog/StarCatalog.h
===================================================================
--- trunk/MagicSoft/Cosy/catalog/StarCatalog.h	(revision 4104)
+++ trunk/MagicSoft/Cosy/catalog/StarCatalog.h	(revision 4865)
@@ -25,4 +25,9 @@
 {
 private:
+
+    int fW;
+    int fH;
+
+ 
     MAstroCatalog *fAstro;
 
@@ -41,4 +46,6 @@
     void   SetRaDec(const RaDec &radec);
     void   SetAltAz(const AltAz &altaz);
+
+    int    fBox;
 
 public:
@@ -69,6 +76,9 @@
     }
 
-    void   CalcStars(MStarList &list) const;
+    void   CalcStars(MStarList &list, int xc, int yc, int xo, int yo) const;
+    void   CalcStars(MStarList &list);
     static void DrawStars(MStarList &list, byte *img);
+
+    void SetBox(int box)   { fBox = box; }
 
     ClassDef(StarCatalog, 0)
