Ignore:
Timestamp:
04/12/03 19:06:27 (22 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Cosy/catalog
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Cosy/catalog/SlaStars.h

    r1758 r1953  
    4040    ZdAz   CalcZdAz (const RaDec &radec) const;
    4141
     42    AltAz  CalcAltAz(const RaDec &radec, double mjd)
     43    { SetMjd(mjd); return CalcAltAz(radec); }
     44    ZdAz   CalcZdAz (const RaDec &radec, double mjd)
     45    { SetMjd(mjd); return CalcZdAz(radec); }
     46
    4247    AltAz  CalcAltAzFast(const RaDec &radec) const;
    4348    ZdAz   CalcZdAzFast (const RaDec &radec) const;
  • trunk/MagicSoft/Cosy/catalog/StarCatalog.cc

    r1803 r1953  
    1414ClassImp(StarCatalog);
    1515
    16 StarCatalog::StarCatalog(MObservatory::LocationName_t key) : SlaStars(key), fEntries(0)
     16StarCatalog::StarCatalog(MObservatory::LocationName_t key) : SlaStars(key), fEntries(0), fSinAngle(0), fCosAngle(1)
    1717{
    1818    // p = pointer to MainFrame (not owner)
     
    505505    // Align alt/az[pix]
    506506    //
    507     const int xx = 767-(int)((fWidth-dx+DPI)/fPixSize);
    508     const int yy =     (int)((fHeight+dy)/fPixSize);
     507    const int xx = (int)(((dx-DPI)*fCosAngle - dy*fSinAngle + fWidth)/fPixSize);
     508    const int yy = (int)(((dx-DPI)*fSinAngle + dy*fCosAngle + fHeight)/fPixSize);
     509    //const int xx = 767-(int)((fWidth-dx+DPI)/fPixSize);
     510    //const int yy =     (int)((fHeight+dy)/fPixSize);
    509511
    510512    //
     
    685687
    686688            //
    687             // Align alt/az[pix]
    688             //
    689             const float xx = 768.0 - (fWidth -dx+DPI)/fPixSize;
    690             const float yy =         (fHeight+dy)    /fPixSize;
     689            // Align and rotate alt/az[pix]
     690            //
     691            float xx = ((dx-DPI)*fCosAngle - dy*fSinAngle + fWidth)/fPixSize;
     692            float yy = ((dx-DPI)*fSinAngle + dy*fCosAngle + fHeight)/fPixSize;
    691693
    692694            //
     
    710712AltAz StarCatalog::CalcAltAzFromPix(Double_t pixx, Double_t pixy) const
    711713{
    712     Double_t dx = (pixx-768.0)*fPixSize + fWidth+DPI;
    713     Double_t dy =         pixy*fPixSize - fHeight;
     714    pixx *= fPixSize;
     715    pixy *= fPixSize;
     716
     717    const double dx =  (pixx-fWidth)*fCosAngle + (pixy-fHeight)*fSinAngle;
     718    const double dy = -(pixx-fWidth)*fSinAngle + (pixy-fHeight)*fCosAngle;
     719
     720    //const double dx = (pixx-768.0)*fPixSize + fWidth+DPI;
     721    //const double dy =         pixy*fPixSize - fHeight;
    714722
    715723    double ha, dec;
  • trunk/MagicSoft/Cosy/catalog/StarCatalog.h

    r1803 r1953  
    2828    double   fWidth;    // size of display
    2929    double   fHeight;   //
     30    double   fSinAngle;
     31    double   fCosAngle;
    3032
    3133    float    fLimitMag; // [M] limiting magnitude for display
     
    8789    void  SetPixSize(const double pixsize);
    8890    void  SetLimitMag(const float mag) { fLimitMag = mag; }
     91    void  SetRotationAngle(const float angle) { fSinAngle = sin(angle/kRad2Deg); fCosAngle = cos(angle/kRad2Deg); }
    8992
    9093    double GetPixSize() const;
Note: See TracChangeset for help on using the changeset viewer.