source: trunk/Cosy/catalog/StarCatalog.h@ 10075

Last change on this file since 10075 was 9439, checked in by tbretz, 16 years ago
*** empty log message ***
File size: 2.2 KB
Line 
1#ifndef STARCATALOG_H
2#define STARCATALOG_H
3
4#ifndef ROOT_TROOT
5#include <TROOT.h>
6#endif
7#ifndef ROOT_GuiTypes
8#include <GuiTypes.h>
9#endif
10#ifndef COSY_SlaStars
11#include "SlaStars.h"
12#endif
13
14typedef unsigned char byte;
15
16class MStarList;
17class MAstroCatalog;
18
19class StarCatalog : public SlaStars
20{
21private:
22
23 int fW;
24 int fH;
25
26
27 MAstroCatalog *fAstro;
28
29 double fPixSize; // [rad/pix] size of one pixel
30 double fSinAngle;
31 double fCosAngle;
32 double fAngle;
33
34 float fLimitMag; // [M] limiting magnitude for display
35
36 AltAz fAltAz; // [rad]
37 RaDec fRaDec; // [rad]
38
39 static void DrawCross(byte *img, const int x, const int y);
40 static void DrawCircle(int color, byte *img, int xx, int yy, int size);
41
42 void SetRaDec(const RaDec &radec);
43
44 int fBoxX;
45 int fBoxY;
46
47public:
48 StarCatalog(MObservatory::LocationName_t key);
49 virtual ~StarCatalog();
50
51 void SetAltAz(const AltAz &altaz);
52
53 void GetImg(byte *img, byte *cimg, MStarList &list) const;
54 void PaintImg(unsigned char *buf, int w, int h);
55
56 const AltAz GetAltAz() const /*[deg]*/ { return fAltAz*TMath::RadToDeg(); }
57 const ZdAz GetZdAz() const /*[deg]*/ { return ZdAz(TMath::Pi()/2-fAltAz.Alt(), fAltAz.Az())*kRad2Deg; }
58 const RaDec GetRaDec() const /*[deg]*/ { return fRaDec*kRad2Deg; }
59
60 void SetPixSize(const double pixsize);
61 void SetLimitMag(const float mag);
62 void SetRotationAngle(const double angle) { fSinAngle = sin(angle/kRad2Deg); fCosAngle = cos(angle/kRad2Deg); fAngle=angle; }
63 void Reload();
64
65 double GetRotationAngle() { return fAngle; }
66
67 double GetPixSize() const;
68
69 //AltAz CalcAltAzFromPix(Double_t pixx, Double_t pixy) const;
70 ZdAz CalcDeltaZdAzFromPix(Double_t pixx, Double_t pixy) const;
71
72 virtual void SetMjd(double mjd);
73
74 void SetPointing(double mjd, const RaDec &radec)
75 {
76 SetMjd(mjd); SetRaDec(radec);
77 }
78
79 //void CalcStars(MStarList &list);
80 void CalcStars(MStarList &list, int xc, int yc, float xo, float yo) const;
81 static void DrawStars(MStarList &list, byte *img);
82
83 void SetBox(int box) { fBoxX = fBoxY = box; }
84 void SetBox(int boxx, int boxy) { fBoxX = boxx; fBoxY=boxy; }
85
86 ClassDef(StarCatalog, 0)
87};
88
89#endif
Note: See TracBrowser for help on using the repository browser.