Changeset 4865 for trunk/MagicSoft/Cosy/catalog
- Timestamp:
- 09/05/04 18:56:47 (21 years ago)
- Location:
- trunk/MagicSoft/Cosy/catalog
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Cosy/catalog/StarCatalog.cc
r4104 r4865 16 16 ClassImp(StarCatalog); 17 17 18 StarCatalog::StarCatalog(MObservatory::LocationName_t key) : SlaStars(key), f Astro(0), /*fSao(NULL), fSrt(NULL), fEntries(0),*/ fSinAngle(0), fCosAngle(1)18 StarCatalog::StarCatalog(MObservatory::LocationName_t key) : SlaStars(key), fW(768), fH(576), fAstro(0), /*fSao(NULL), fSrt(NULL), fEntries(0),*/ fSinAngle(0), fCosAngle(1), fBox(768) 19 19 { 20 20 fAstro = new MAstroCatalog; … … 136 136 { 137 137 const int mag = (10 - (star->GetMag()>1 ? (int)star->GetMag() : 1))/2; 138 139 Double_t color = 0xf0; //0x0f; 140 DrawCircle(color, img, (int)star->GetX(), (int)star->GetY(), mag);138 Double_t color = 0xf0; //0x0f; 139 // DrawStars flips the picture in X defaultwise now 140 DrawCircle(color, img, 768-(int)star->GetX(), (int)star->GetY(), mag); 141 141 } 142 142 } 143 143 144 void StarCatalog::CalcStars(MStarList &list) const 145 { 144 void StarCatalog::CalcStars(MStarList &list) 145 { 146 // full FOV 147 fBox=768; 148 CalcStars(list, 0, 576, 0, 0); 149 } 150 151 void StarCatalog::CalcStars(MStarList &list, int xc, int yc, 152 int xo, int yo) const 153 { 154 155 // CalcStars flips the picture in X defaultwise now 156 int x0 = (768-xc)-fBox; 157 int x1 = (768-xc)+fBox; 158 int y0 = yc-fBox; 159 int y1 = yc+fBox; 160 161 if (x0<0) x0=0; 162 if (y0<0) y0=0; 163 if (x1>fW) x1=fW; 164 if (y1>fH) y1=fH; 165 146 166 // Align stars into telescope system 147 167 // (Move the telescope to pointing position) … … 196 216 Float_t yy = loc.X()*fSinAngle + loc.Y()*fCosAngle; 197 217 198 if (xx<0 || xx >=768 || yy<0 || yy>=576) 218 if (xx<(x0-768/2) || xx >=(x1-768/2) 219 || yy<(y0-(576/2+yo)) || yy>=(y1-(576/2+yo))) 199 220 continue; 200 221 201 222 // Store pixel coordinates of star in list 202 list.Add(xx+768/2, yy+576/2, -2.5*log10(mag)); 223 list.Add(xx+768/2+xo, yy+576/2+yo, -2.5*log10(mag)); 224 203 225 } 204 226 } -
trunk/MagicSoft/Cosy/catalog/StarCatalog.h
r4076 r4865 25 25 { 26 26 private: 27 28 int fW; 29 int fH; 30 31 27 32 MAstroCatalog *fAstro; 28 33 … … 41 46 void SetRaDec(const RaDec &radec); 42 47 void SetAltAz(const AltAz &altaz); 48 49 int fBox; 43 50 44 51 public: … … 69 76 } 70 77 71 void CalcStars(MStarList &list) const; 78 void CalcStars(MStarList &list, int xc, int yc, int xo, int yo) const; 79 void CalcStars(MStarList &list); 72 80 static void DrawStars(MStarList &list, byte *img); 81 82 void SetBox(int box) { fBox = box; } 73 83 74 84 ClassDef(StarCatalog, 0)
Note:
See TracChangeset
for help on using the changeset viewer.