Changeset 7764 for trunk/MagicSoft/Cosy/catalog
- Timestamp:
- 06/28/06 13:49:23 (19 years ago)
- Location:
- trunk/MagicSoft/Cosy/catalog
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Cosy/catalog/StarCatalog.cc
r4865 r7764 142 142 } 143 143 144 /* 144 145 void StarCatalog::CalcStars(MStarList &list) 145 146 { 146 147 // full FOV 147 fBox=768; 148 CalcStars(list, 0, 576, 0, 0); 149 } 148 fBox=768/2; 149 CalcStars(list, 768/2, 576/2, 0, 0); 150 } 151 */ 150 152 151 153 void StarCatalog::CalcStars(MStarList &list, int xc, int yc, 152 154 int xo, int yo) const 153 155 { 156 // For an apropriate unit conversion to pixels [pix/rad] 157 const Double_t scale = TMath::RadToDeg()*sqrt(768*768 + 576*576)/(fAstro->GetRadiusFOV()*2); 158 159 // Offsets to shift [-n/2;n/2] to [0;n] and to 160 // move the stars in the counterdirection of the LEDs 161 const Float_t offx = 768/2 + xo; 162 const Float_t offy = 576/2 + yo; 163 164 // Allow catalog stars to be a bit outside [0.2deg] of the 165 // monitored window. To get the std behaviour set offset=0 166 const Int_t offset = TMath::Nint(0.2*TMath::DegToRad()*scale); 167 const Int_t box = fBox+offset; 154 168 155 169 // 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; 170 // This defined the box in which stars are really returned 171 int x0 = (768-xc)-box; 172 int x1 = (768-xc)+box; 173 int y0 = yc-box; 174 int y1 = yc+box; 175 176 if (x0< -offset) x0= -offset; 177 if (y0< -offset) y0= -offset; 178 if (x1>fW+offset) x1=fW+offset; 179 if (y1>fH+offset) y1=fH+offset; 165 180 166 181 // Align stars into telescope system … … 171 186 align.RotateZ(TMath::Pi()/2); 172 187 173 // For an apropriate unit conversion to pixels174 const Double_t scale = TMath::RadToDeg()*sqrt(768*768 + 576*576)/(fAstro->GetRadiusFOV()*2);175 176 188 // Get List of stars from catalog 177 189 TIter Next(fAstro->GetList()); … … 213 225 214 226 // Rotate by the rotation angle of the video camera 215 Float_t xx = loc.X()*fCosAngle - loc.Y()*fSinAngle; 216 Float_t yy = loc.X()*fSinAngle + loc.Y()*fCosAngle; 217 218 if (xx<(x0-768/2) || xx >=(x1-768/2) 219 || yy<(y0-(576/2+yo)) || yy>=(y1-(576/2+yo))) 227 // and add the offsets on both axis 228 Float_t xx = loc.X()*fCosAngle - loc.Y()*fSinAngle + offx; 229 Float_t yy = loc.X()*fSinAngle + loc.Y()*fCosAngle + offy; 230 231 // Check if the resulting star is in the 232 // search box for the real stars 233 if (rx<x0 || rx>=x1 || ry<y0 || ry>=y1) 220 234 continue; 221 235 222 236 // Store pixel coordinates of star in list 223 list.Add(xx+768/2+xo, yy+576/2+yo, -2.5*log10(mag)); 224 237 list.Add(rx, ry, -2.5*log10(mag)); 225 238 } 226 239 } -
trunk/MagicSoft/Cosy/catalog/StarCatalog.h
r6867 r7764 76 76 } 77 77 78 //void CalcStars(MStarList &list); 78 79 void CalcStars(MStarList &list, int xc, int yc, int xo, int yo) const; 79 void CalcStars(MStarList &list);80 80 static void DrawStars(MStarList &list, byte *img); 81 81
Note:
See TracChangeset
for help on using the changeset viewer.