Ignore:
Timestamp:
09/05/04 18:56:47 (21 years ago)
Author:
rwagner
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Cosy/catalog
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Cosy/catalog/StarCatalog.cc

    r4104 r4865  
    1616ClassImp(StarCatalog);
    1717
    18 StarCatalog::StarCatalog(MObservatory::LocationName_t key) : SlaStars(key), fAstro(0), /*fSao(NULL), fSrt(NULL), fEntries(0),*/ fSinAngle(0), fCosAngle(1)
     18StarCatalog::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)
    1919{
    2020    fAstro = new MAstroCatalog;
     
    136136    {
    137137        const int mag = (10 - (star->GetMag()>1 ? (int)star->GetMag() : 1))/2;
    138 
    139         Double_t color = 0xf0; //0x0f;
    140         DrawCircle(color, img, (int)star->GetX(), (int)star->GetY(), mag);
     138        Double_t color = 0xf0; //0x0f;       
     139        // DrawStars flips the picture in X defaultwise now
     140        DrawCircle(color, img, 768-(int)star->GetX(), (int)star->GetY(), mag);
    141141    }
    142142}
    143143
    144 void StarCatalog::CalcStars(MStarList &list) const
    145 {
     144void StarCatalog::CalcStars(MStarList &list)
     145{
     146    // full FOV
     147    fBox=768;
     148    CalcStars(list, 0, 576, 0, 0);
     149}
     150
     151void StarCatalog::CalcStars(MStarList &list, int xc, int yc,
     152                            int xo, int yo) const
     153{
     154
     155    // CalcStars flips the picture in X defaultwise now
     156    int x0 = (768-xc)-fBox;
     157    int x1 = (768-xc)+fBox;
     158    int y0 = yc-fBox;
     159    int y1 = yc+fBox;
     160
     161    if (x0<0) x0=0;
     162    if (y0<0) y0=0;
     163    if (x1>fW) x1=fW;
     164    if (y1>fH) y1=fH;
     165
    146166    // Align stars into telescope system
    147167    // (Move the telescope to pointing position)
     
    196216        Float_t yy = loc.X()*fSinAngle + loc.Y()*fCosAngle;
    197217
    198         if (xx<0 || xx >=768 || yy<0 || yy>=576)
     218        if (xx<(x0-768/2) || xx >=(x1-768/2)
     219            || yy<(y0-(576/2+yo)) || yy>=(y1-(576/2+yo)))
    199220            continue;
    200221
    201222        // Store pixel coordinates of star in list
    202         list.Add(xx+768/2, yy+576/2, -2.5*log10(mag));
     223        list.Add(xx+768/2+xo, yy+576/2+yo, -2.5*log10(mag));
     224
    203225    }
    204226}
  • trunk/MagicSoft/Cosy/catalog/StarCatalog.h

    r4076 r4865  
    2525{
    2626private:
     27
     28    int fW;
     29    int fH;
     30
     31 
    2732    MAstroCatalog *fAstro;
    2833
     
    4146    void   SetRaDec(const RaDec &radec);
    4247    void   SetAltAz(const AltAz &altaz);
     48
     49    int    fBox;
    4350
    4451public:
     
    6976    }
    7077
    71     void   CalcStars(MStarList &list) const;
     78    void   CalcStars(MStarList &list, int xc, int yc, int xo, int yo) const;
     79    void   CalcStars(MStarList &list);
    7280    static void DrawStars(MStarList &list, byte *img);
     81
     82    void SetBox(int box)   { fBox = box; }
    7383
    7484    ClassDef(StarCatalog, 0)
Note: See TracChangeset for help on using the changeset viewer.