- Timestamp:
- 06/28/06 13:49:23 (18 years ago)
- Location:
- trunk/MagicSoft/Cosy
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Cosy/Changelog
r7763 r7764 13 13 - do not write pointingpos.txt and tracking_error.txt anymore 14 14 15 16 * caos/Ring.h: 15 * caos/Ring.h: 17 16 - added Setter SetXY 18 17 -
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 -
trunk/MagicSoft/Cosy/main/MStargHistograms.cc
r7614 r7764 127 127 } 128 128 129 void MStargHistograms::Fill(Leds &spots, MStarList &stars, ZdAz &d, ZdAz sao, Ring ¢er, ZdAz & centerzdaz, ZdAz &star, Double_t bright, const ZdAz &pos, const MTime &t)129 void MStargHistograms::Fill(Leds &spots, MStarList &stars, ZdAz &d, ZdAz sao, Ring ¢er, ZdAz &star, Double_t bright, const ZdAz &pos, const MTime &t) 130 130 { 131 131 // FIXME! … … 146 146 fCenterX = center.GetX(); 147 147 fCenterY = center.GetY(); 148 fCenterZd = centerzdaz.Zd();149 fCenterAz = centerzdaz.Az();148 //fCenterZd = centerzdaz.Zd(); 149 //fCenterAz = centerzdaz.Az(); 150 150 fStarZd = star.Zd(); 151 151 fStarAz = star.Az(); -
trunk/MagicSoft/Cosy/main/MStargHistograms.h
r4865 r7764 31 31 Double_t fSpots; 32 32 Double_t fBright; 33 Double_t fCenterZd;34 Double_t fCenterAz;33 // Double_t fCenterZd; 34 // Double_t fCenterAz; 35 35 Double_t fStarZd; 36 36 Double_t fStarAz; … … 49 49 50 50 void Fill(Leds &spots, MStarList &stars, ZdAz &d, ZdAz sao, 51 Ring ¢er, ZdAz ¢erzdaz,ZdAz &star, Double_t bright,51 Ring ¢er, /*ZdAz ¢erzdaz,*/ ZdAz &star, Double_t bright, 52 52 const ZdAz &pos, const MTime &t); 53 53 -
trunk/MagicSoft/Cosy/main/MStarguider.cc
r7708 r7764 665 665 else 666 666 { 667 668 667 fStatus = MDriveCom::kStandby; 669 668 … … 684 683 fOperations->DisableEntry(IDM_kStargAnalysis); 685 684 } 686 gSystem->Unlink("tracking_error.txt");685 //gSystem->Unlink("tracking_error.txt"); 687 686 } 688 687 … … 1371 1370 AltAz pos0 = fSao->CalcAltAzFromPix(768/2, 576/2)*kRad2Deg; 1372 1371 AltAz pos1 = fSao->CalcAltAzFromPix(768/2+mx, 576/2+my)*kRad2Deg; 1373 1372 /* 1374 1373 ofstream fout1("pointingpos.txt"); 1375 1374 fout1 << setprecision(10) << fSao->GetMjd()-52000 << " "; … … 1385 1384 fout2 << fCosy->GetPointingPos() << " "; 1386 1385 fout2 << -pos1.Alt() << " " << pos1.Az() << endl; 1387 1386 */ 1388 1387 return ZdAz(-pos1.Alt(), pos1.Az()); 1389 1388 } … … 1853 1852 1854 1853 Ring sgcenter(53.2, 293.6); // Center of camera in SG picture [px] 1855 ZdAz sgcenterzdaz(0, 0); // Center of camera in SG picture [deg]1856 // (0,0)_deg is at (53.2, 293.6)_px1854 //ZdAz sgcenterzdaz(0, 0); // Center of camera in SG picture [deg] 1855 // // (0,0)_deg is at (53.2, 293.6)_px 1857 1856 ZdAz star(0, 0); // Star on curtain in [deg] 1858 1857 … … 1862 1861 if (fCosy) 1863 1862 pos = fCosy->GetPointingPos(); 1864 sgcenter = 1865 fStargCaos->Run(img, kFALSE, kFALSE, pos, t, 30, 3.0); // [px] 1863 1864 sgcenter = fStargCaos->Run(img, kFALSE, kFALSE, pos, t, 30, 3.0); // [px] 1865 1866 1866 const Float_t pixsize = atof(fPixSize->GetText()); // [arcsec/px] 1867 1867 … … 1871 1871 // wrong exspecially near the zenith were az-lines are highly 1872 1872 // curved around the zenith! 1873 sgcenterzdaz.Zd((sgcenter.GetY()-293.6) * pixsize /3600 );1874 sgcenterzdaz.Az((sgcenter.GetX()-53.2) * pixsize /3600 );1873 //sgcenterzdaz.Zd((sgcenter.GetY()-293.6) * pixsize /3600 ); 1874 //sgcenterzdaz.Az((sgcenter.GetX()-53.2) * pixsize /3600 ); 1875 1875 #ifdef EXPERT 1876 1876 cout << "- LEDs imply offset of Zd=" … … 1918 1918 } 1919 1919 1920 // Find Spot on Camera Center in Starguider camera1920 // Find Spot on Camera Center in Starguider camera 1921 1921 1922 1922 if (fOperations->IsEntryChecked(IDM_kRoqueLampAna)) … … 1947 1947 f2.DrawCircle(sgcenter, 115.0, 0x0fa); 1948 1948 } 1949 1950 1951 1949 1952 1950 // we calculate the offset given by the three ETH Leds visible to … … 1958 1956 1959 1957 // Position corresponding to the camera center (53.2, 293.6) 1960 Ring skycenter(392, 318); 1958 //Ring skycenter(392, 318); 1959 Ring skycenter(768/2, 576/2); 1961 1960 // MStarList spots; 1962 1961 … … 1980 1979 // very careful: If center of camera cannot be determined 1981 1980 // sgcenter jumps to (0,0) 1982 double sgcenteroffsetX = 0.0; 1983 double sgcenteroffsetY = 0.0; 1984 if ((double)sgcenter.GetX() > 0.0 && (double)sgcenter.GetY() > 0.0) 1985 { 1986 //Please never change this offsets!!! 1987 sgcenteroffsetX = sgcenter.GetX()-53.2; 1988 sgcenteroffsetY = sgcenter.GetY()-293.6; 1989 } 1981 1982 //Please never change this offsets!!! 1983 // 53.2 and 293.6 are the "preliminary" camera center 1984 // -9 and 28.5 are the offsets of the pointing position in the sky 1985 const XY offset(53.2-9, 293.6+28.5); 1986 1987 const Bool_t centerisvalid = sgcenter.GetX()>0 && sgcenter.GetY()>0; 1988 if (centerisvalid) 1989 skycenter.SetXY(sgcenter.X() - offset.X(), 1990 sgcenter.Y() - offset.Y()); 1990 1991 1991 1992 // we obtain stars in the effective star FOV and draw them. … … 1993 1994 // We determine the ideal starfield using camera sagging info 1994 1995 // from the LEDs 1995 1996 //cout << sgcenteroffsetX << " " << sgcenteroffsetY << endl; 1997 1998 fSao->CalcStars(stars, 530, 292, 1999 -8+2-3+sgcenteroffsetX, //x: star<spot =>subs 2000 31.5-3+sgcenteroffsetY); //y: star<spot =>subs? 2001 1996 fSao->CalcStars(stars, 530, 292, skycenter.GetX(), skycenter.GetY()); 2002 1997 fSao->DrawStars(stars, cimg); 2003 1998 … … 2008 2003 // Next we evaluate the offset given by the LEDs. This we obtain 2009 2004 // in Zd/Az and add it to the tracking error. 2010 2011 2005 if (fDisplay->IsEntryChecked(IDM_kStarguider)) 2012 2006 { … … 2020 2014 fSkyBright->SetText(txt); 2021 2015 2016 const Bool_t brightnessisvalid = bright<1.75*fLastBright && 2017 bright>30 && bright<110; 2018 2019 fLastBright = bright; 2020 2022 2021 ULong_t color; 2023 2022 gClient->GetColorByName("Green", color); … … 2033 2032 const Int_t rc = CalcTrackingError(spots, stars, fD, t, bright, numstars); 2034 2033 2035 if ((bright <= 1.75* fLastBright) && (bright < 110)) 2036 fStatus = MDriveCom::kMonitoring; 2037 else 2038 fStatus = MDriveCom::kError; 2034 const Bool_t monitoring = brightnessisvalid && centerisvalid; 2035 2036 fStatus = monitoring ? MDriveCom::kMonitoring : MDriveCom::kError; 2039 2037 2040 2038 if (fCosy) … … 2043 2041 if (fOperations->IsEntryChecked(IDM_kStargAnalysis)) 2044 2042 fStargHistograms->Fill(spots, stars, fD, 2045 fSao->GetZdAz(), sgcenter, sgcenterzdaz,2043 fSao->GetZdAz(), sgcenter, /*sgcenterzdaz,*/ 2046 2044 star, bright, fPos, t); 2047 2048 fLastBright = bright;2049 2045 2050 2046 if (fCosy) … … 2055 2051 time.GetMjd(), 0, 0); // Report 2056 2052 } 2053 2057 2054 } //kStarguider 2058 2055 2059 f2.DrawCircle(skycenter, 2.0, 0x0a); 2060 2061 f2.DrawCircle(skycenter, 7.4, 0x0a); //0.1deg 2062 2063 f2.DrawCircle(skycenter, 2.06*.5*74.0, 0x0a); 2064 f2.DrawCircle(skycenter, 2.32*.5*74.0, 0x0a); 2065 f2.DrawCircle(skycenter, 3.50*.5*74.0, 0x0a); 2066 f2.DrawCircle(skycenter, 3.84*.5*74.0, 0x0a); 2056 if (centerisvalid) 2057 { 2058 f2.DrawCircle(skycenter, 2.0, 0x0a); 2059 2060 f2.DrawCircle(skycenter, 7.4, 0x0a); //0.1deg 2061 2062 f2.DrawCircle(skycenter, 2.06*.5*74.0, 0x0a); 2063 f2.DrawCircle(skycenter, 2.32*.5*74.0, 0x0a); 2064 f2.DrawCircle(skycenter, 3.50*.5*74.0, 0x0a); 2065 f2.DrawCircle(skycenter, 3.84*.5*74.0, 0x0a); 2066 } 2067 2067 2068 } //CalcStars 2068 2069 -
trunk/MagicSoft/Cosy/tcpip/MDriveCom.cc
r7707 r7764 231 231 if (stat&kError) 232 232 SetStatus(0); 233 if (stat&kStopped)234 SetStatus(1);235 233 if (stat&kStandby) 236 234 SetStatus(2); -
trunk/MagicSoft/Cosy/tcpip/MDriveCom.h
r7707 r7764 29 29 enum 30 30 { 31 kError = 0x01,32 kMoving = 0x02,33 kTracking = 0x04,34 kStopping = 0x08,35 kStopped = 0x10,36 kStandby = 0x20,31 kError = 0x01, 32 kMoving = 0x02, 33 kTracking = 0x04, 34 kStopping = 0x08, 35 kStopped = 0x10, 36 kStandby = 0x20, 37 37 kMonitoring = 0x40 38 38 };
Note:
See TracChangeset
for help on using the changeset viewer.