source: trunk/MagicSoft/Cosy/catalog/StarCatalog.h@ 3766

Last change on this file since 3766 was 1953, checked in by tbretz, 22 years ago
*** empty log message ***
File size: 2.8 KB
Line 
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
16typedef unsigned char byte;
17
18class MStarList;
19
20class StarCatalog : public SlaStars
21{
22private:
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 double fSinAngle;
31 double fCosAngle;
32
33 float fLimitMag; // [M] limiting magnitude for display
34
35 AltAz fAltAz; // [rad]
36 byte fAz0[360];
37 int fAltMin;
38 int fAltMax;
39 int fAzCnt;
40
41 RaDec fRaDec; // [rad]
42 byte fRa0[360];
43 int fRaCnt;
44 int fDecMin;
45 int fDecMax;
46
47 static void DrawCross(byte *img, const int x, const int y);
48 static void DrawCircle(int color, byte *img, int xx, int yy, int size);
49
50 Bool_t DrawAltAz(const int color, byte *img, double alt, double az, int size=0) const;
51 Bool_t DrawRaDec(const int color, byte *img, double ra, double dec, int size=0) const;
52
53 Bool_t Draw(const int color, byte *img, const AltAz &altaz);
54 Bool_t Draw(const int color, byte *img, const RaDec &radec);
55
56 //Bool_t Draw(const int color, byte *img, const SaoFile *sao);
57 //void CalcImg(byte *);
58
59 void CalcStars(MStarList &list) const;
60
61 static void DrawStars(MStarList &list, byte *img);
62
63 void SetRaDec(const RaDec &radec);
64 void SetAltAz(const AltAz &altaz);
65 void DrawSCAltAz(byte *img, const int color) const;
66 void DrawSCRaDec(byte *img, const int color) const;
67
68 void CalcRaDecRange();
69 void CalcAltAzRange();
70
71// RaDec AltAz2RaDec(const AltAz &altaz) const;
72// AltAz RaDec2AltAz(const RaDec &radec, const RaDec &rdpm) const;
73
74public:
75 StarCatalog(MObservatory::LocationName_t key);
76 virtual ~StarCatalog();
77
78 void GetImg(byte *img, byte *cimg, MStarList &list) const;
79 void GetImg(byte *img, byte *cimg, const double utc, const RaDec &radec);
80 void GetImg(byte *img, byte *cimg, const double utc, const AltAz &altaz);
81
82 void GetStars(MStarList &list, const double utc, const RaDec &radec);
83 void GetStars(MStarList &list, const double utc, const AltAz &altaz);
84
85 const AltAz GetAltAz() const { return fAltAz*kRad2Deg; }
86 const ZdAz GetZdAz() const { return ZdAz(kPiDiv2-fAltAz.Alt(), fAltAz.Az())*kRad2Deg; }
87 const RaDec GetRaDec() const { return fRaDec*kRad2Deg; }
88
89 void SetPixSize(const double pixsize);
90 void SetLimitMag(const float mag) { fLimitMag = mag; }
91 void SetRotationAngle(const float angle) { fSinAngle = sin(angle/kRad2Deg); fCosAngle = cos(angle/kRad2Deg); }
92
93 double GetPixSize() const;
94
95 AltAz CalcAltAzFromPix(Double_t pixx, Double_t pixy) const;
96
97 ClassDef(StarCatalog, 0)
98};
99
100#endif
Note: See TracBrowser for help on using the repository browser.