| 1 | #ifndef STARCATALOG_H
|
|---|
| 2 | #define STARCATALOG_H
|
|---|
| 3 |
|
|---|
| 4 | #ifndef ROOT_TROOT
|
|---|
| 5 | #include <TROOT.h>
|
|---|
| 6 | #endif
|
|---|
| 7 | #ifndef SAOFILE_H
|
|---|
| 8 | #include "SaoFile.h"
|
|---|
| 9 | #endif
|
|---|
| 10 | #ifndef SLASTARS_H
|
|---|
| 11 | #include "SlaStars.h"
|
|---|
| 12 | #endif
|
|---|
| 13 |
|
|---|
| 14 | #include "coord.h"
|
|---|
| 15 |
|
|---|
| 16 | typedef unsigned char byte;
|
|---|
| 17 |
|
|---|
| 18 | class MStarList;
|
|---|
| 19 |
|
|---|
| 20 | class StarCatalog : public SlaStars
|
|---|
| 21 | {
|
|---|
| 22 | private:
|
|---|
| 23 | SaoFile *fSao;
|
|---|
| 24 | sort_t *fSrt;
|
|---|
| 25 | int fEntries;
|
|---|
| 26 |
|
|---|
| 27 | double fPixSize; // [rad/pix] size of one pixel
|
|---|
| 28 | double fWidth; // size of display
|
|---|
| 29 | double fHeight; //
|
|---|
| 30 |
|
|---|
| 31 | float fLimitMag; // [M] limiting magnitude for display
|
|---|
| 32 |
|
|---|
| 33 | AltAz fAltAz; // [rad]
|
|---|
| 34 | byte fAz0[360];
|
|---|
| 35 | int fAltMin;
|
|---|
| 36 | int fAltMax;
|
|---|
| 37 | int fAzCnt;
|
|---|
| 38 |
|
|---|
| 39 | RaDec fRaDec; // [rad]
|
|---|
| 40 | byte fRa0[360];
|
|---|
| 41 | int fRaCnt;
|
|---|
| 42 | int fDecMin;
|
|---|
| 43 | int fDecMax;
|
|---|
| 44 |
|
|---|
| 45 | static void DrawCross(byte *img, const int x, const int y);
|
|---|
| 46 | static void DrawCircle(int color, byte *img, int xx, int yy, int size);
|
|---|
| 47 |
|
|---|
| 48 | Bool_t DrawAltAz(const int color, byte *img, double alt, double az, int size=0) const;
|
|---|
| 49 | Bool_t DrawRaDec(const int color, byte *img, double ra, double dec, int size=0) const;
|
|---|
| 50 |
|
|---|
| 51 | Bool_t Draw(const int color, byte *img, const AltAz &altaz);
|
|---|
| 52 | Bool_t Draw(const int color, byte *img, const RaDec &radec);
|
|---|
| 53 |
|
|---|
| 54 | //Bool_t Draw(const int color, byte *img, const SaoFile *sao);
|
|---|
| 55 | //void CalcImg(byte *);
|
|---|
| 56 |
|
|---|
| 57 | void CalcStars(MStarList &list) const;
|
|---|
| 58 |
|
|---|
| 59 | static void DrawStars(MStarList &list, byte *img);
|
|---|
| 60 |
|
|---|
| 61 | void SetRaDec(const RaDec &radec);
|
|---|
| 62 | void SetAltAz(const AltAz &altaz);
|
|---|
| 63 | void DrawSCAltAz(byte *img, const int color) const;
|
|---|
| 64 | void DrawSCRaDec(byte *img, const int color) const;
|
|---|
| 65 |
|
|---|
| 66 | void CalcRaDecRange();
|
|---|
| 67 | void CalcAltAzRange();
|
|---|
| 68 |
|
|---|
| 69 | // RaDec AltAz2RaDec(const AltAz &altaz) const;
|
|---|
| 70 | // AltAz RaDec2AltAz(const RaDec &radec, const RaDec &rdpm) const;
|
|---|
| 71 |
|
|---|
| 72 | public:
|
|---|
| 73 | StarCatalog();
|
|---|
| 74 | virtual ~StarCatalog();
|
|---|
| 75 |
|
|---|
| 76 | void GetImg(byte *img, byte *cimg, MStarList &list) const;
|
|---|
| 77 | void GetImg(byte *img, byte *cimg, const double utc, const RaDec &radec);
|
|---|
| 78 | void GetImg(byte *img, byte *cimg, const double utc, const AltAz &altaz);
|
|---|
| 79 |
|
|---|
| 80 | void GetStars(MStarList &list, const double utc, const RaDec &radec);
|
|---|
| 81 | void GetStars(MStarList &list, const double utc, const AltAz &altaz);
|
|---|
| 82 |
|
|---|
| 83 | const AltAz GetAltAz() const { return fAltAz*kRad2Deg; }
|
|---|
| 84 | const ZdAz GetZdAz() const { return ZdAz(kPiDiv2-fAltAz.Alt(), fAltAz.Az())*kRad2Deg; }
|
|---|
| 85 | const RaDec GetRaDec() const { return fRaDec*kRad2Deg; }
|
|---|
| 86 |
|
|---|
| 87 | void SetPixSize(const double pixsize);
|
|---|
| 88 | void SetLimitMag(const float mag) { fLimitMag = mag; }
|
|---|
| 89 |
|
|---|
| 90 | AltAz CalcAltAzFromPix(Double_t pixx, Double_t pixy) const;
|
|---|
| 91 |
|
|---|
| 92 | ClassDef(StarCatalog, 0)
|
|---|
| 93 | };
|
|---|
| 94 |
|
|---|
| 95 | #endif
|
|---|