source: trunk/MagicSoft/Mars/mastro/MAstroCatalog.h@ 3440

Last change on this file since 3440 was 3402, checked in by tbretz, 21 years ago
*** empty log message ***
File size: 2.8 KB
Line 
1#ifndef MARS_MAstroCatalog
2#define MARS_MAstroCatalog
3
4#ifndef ROOT_TVector3
5#include <TVector3.h>
6#endif
7#ifndef ROOT_TList
8#include <TList.h>
9#endif
10
11class MTime;
12class MObservatory;
13class TArrayI;
14
15class MVector3 : public TVector3
16{
17 enum VectorType_t
18 {
19 kIsInvalid,
20 kIsRaDec,
21 kIsZdAz,
22 kIsAltAz,
23 kIsArbitrary
24 };
25
26 VectorType_t fType;
27
28public:
29 /*
30 MVector3(Double_t theta=0, Double_t phi=0, Double_t mag=1)
31 {
32 SetMagThetaPhi(exp(mag), theta, phi);
33 }*/
34 MVector3() { fType=kIsInvalid; }
35 MVector3(const TVector3 &v3) : TVector3(v3) { fType=kIsArbitrary; }
36 Double_t Magnitude() const { return TMath::Log(Mag()); }
37
38 void SetRaDec(Double_t ra, Double_t dec, Double_t mag)
39 {
40 fType = kIsRaDec;
41 SetMagThetaPhi(exp(mag), TMath::Pi()/2-dec, ra);
42 }
43 void SetZdAz(Double_t zd, Double_t az, Double_t mag)
44 {
45 fType = kIsZdAz;
46 SetMagThetaPhi(exp(mag), zd, az);
47 }
48 void SetAltAz(Double_t alt, Double_t az, Double_t mag)
49 {
50 fType = kIsAltAz;
51 SetMagThetaPhi(exp(mag), TMath::Pi()/2-alt, az);
52 }
53
54 MVector3 GetZdAz(const MObservatory &obs, Double_t gmst) const;
55 MVector3 GetZdAz(const MTime &time, MObservatory &obs) const;
56
57 ClassDef(MVector3, 0)
58};
59
60class MAstroCatalog : public TObject
61{
62private:
63 Double_t fLimMag; // [1] Limiting Magnitude
64 Double_t fRadiusFOV; // [deg] Radius of Field of View
65 MVector3 fRaDec; // pointing position
66
67 TList fList;
68
69 TString FindToken(TString &line, Char_t tok=',');
70
71 Int_t atoi(const TSubString &sub);
72 Float_t atof(const TSubString &sub);
73 Int_t atoi(const TString &s);
74 Float_t atof(const TString &s);
75
76public:
77 MAstroCatalog() : fLimMag(99), fRadiusFOV(99)
78 {
79 fList.SetOwner();
80 }
81
82 void SetLimMag(Double_t mag) { fLimMag=mag; }
83 void SetRadiusFOV(Double_t deg) { fRadiusFOV=deg; }
84 void SetRaDec(Double_t ra, Double_t dec) { fRaDec.SetRaDec(ra, dec, 1); }
85 void SetRaDec(const TVector3 &v) { fRaDec=v; }
86 void Delete(Option_t *o="") { fList.Delete(o); }
87
88 Int_t ReadXephem(TString catalog = "/usr/X11R6/lib/xephem/catalogs/YBS.edb");
89 Int_t ReadNGC2000(TString catalog = "ngc2000.dat");
90 Int_t ReadBSC(TString catalog = "bsc5.dat");
91
92 void Print(Option_t *o="") const { fList.Print(); }
93
94 TList *GetList() { return &fList; }
95
96 virtual Bool_t Convert(const TRotation &rot, TVector2 &v, Int_t type);
97 virtual Bool_t PaintLine(const TVector2 &v0, Double_t dx, Double_t dy, const TRotation &rot, Int_t type);
98
99 void Paint(const TVector2 &v0, const TRotation &rot, TArrayI &dx, TArrayI &dy, Byte_t type);
100 void PaintNet(const TVector2 &v0, const TRotation &rot, Int_t type=0);
101 void Paint(Option_t *o="");
102
103 ClassDef(MAstroCatalog, 0)
104};
105#endif
Note: See TracBrowser for help on using the repository browser.