Changeset 4104 for trunk/MagicSoft/Cosy/catalog
- Timestamp:
- 05/20/04 04:42:48 (21 years ago)
- Location:
- trunk/MagicSoft/Cosy/catalog
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Cosy/catalog/CatalogLinkDef.h
r1109 r4104 9 9 #pragma link C++ class SlaPlanets+; 10 10 11 #pragma link C++ class SaoFile+;12 11 #pragma link C++ class StarCatalog+; 13 12 -
trunk/MagicSoft/Cosy/catalog/Makefile
r1109 r4104 31 31 .SUFFIXES: .c .cc .cxx .h .hxx .o 32 32 33 SRCFILES = SaoFile.cc \ 34 Slalib.cc \ 33 SRCFILES = Slalib.cc \ 35 34 SlaStars.cc \ 36 35 SlaPlanets.cc \ -
trunk/MagicSoft/Cosy/catalog/Slalib.cc
r3897 r4104 61 61 return ZdAz(kPiDiv2-alt, az); 62 62 } 63 /*64 Double_t Slalib::Hms2Sec(Int_t deg, UInt_t min, Double_t sec, Char_t sgn)65 {66 const Double_t rc = TMath::Sign((60.0 * (60.0 * (Double_t)TMath::Abs(deg) + (Double_t)min) + sec), (Double_t)deg);67 return sgn=='-' ? -rc : rc;68 }69 70 Double_t Slalib::Dms2Rad(Int_t deg, UInt_t min, Double_t sec, Char_t sgn)71 {72 // pi/(180*3600): arcseconds to radians73 #define DAS2R 4.8481368110953599358991410235794797595635330237270e-674 return Hms2Sec(deg, min, sec, sgn)*DAS2R;75 }76 77 Double_t Slalib::Hms2Rad(Int_t hor, UInt_t min, Double_t sec, Char_t sgn)78 {79 // pi/(12*3600): seconds of time to radians80 #define DS2R 7.2722052166430399038487115353692196393452995355905e-581 return Hms2Sec(hor, min, sec, sgn)*DS2R;82 }83 84 Double_t Slalib::Dms2Deg(Int_t deg, UInt_t min, Double_t sec, Char_t sgn)85 {86 return Hms2Sec(deg, min, sec, sgn)/3600.;87 }88 89 Double_t Slalib::Hms2Deg(Int_t hor, UInt_t min, Double_t sec, Char_t sgn)90 {91 return Hms2Sec(hor, min, sec, sgn)/240.;92 }93 94 Double_t Slalib::Dms2Hor(Int_t deg, UInt_t min, Double_t sec, Char_t sgn)95 {96 return Hms2Sec(deg, min, sec, sgn)/15.;97 }98 99 Double_t Slalib::Hms2Hor(Int_t hor, UInt_t min, Double_t sec, Char_t sgn)100 {101 return Hms2Sec(hor, min, sec, sgn)/3600.;102 }103 104 void Slalib::Day2Hms(Double_t day, Char_t &sgn, UShort_t &hor, UShort_t &min, UShort_t &sec)105 {106 // Handle sign107 sgn = day<0?'-':'+';108 109 // Round interval and express in smallest units required110 Double_t a = Round(86400. * TMath::Abs(day)); // Days to seconds111 112 // Separate into fields113 const Double_t ah = Trunc(a/3600.);114 a -= ah * 3600.;115 const Double_t am = Trunc(a/60.);116 a -= am * 60.;117 const Double_t as = Trunc(a);118 119 // Return results120 hor = (UShort_t)ah;121 min = (UShort_t)am;122 sec = (UShort_t)as;123 }124 125 void Slalib::Rad2Hms(Double_t rad, Char_t &sgn, UShort_t °, UShort_t &min, UShort_t &sec)126 {127 Day2Hms(rad/(TMath::Pi()*2), sgn, deg, min, sec);128 }129 130 void Slalib::Rad2Dms(Double_t rad, Char_t &sgn, UShort_t °, UShort_t &min, UShort_t &sec)131 {132 Rad2Hms(rad*15, sgn, deg, min, sec);133 }134 135 void Slalib::Deg2Dms(Double_t d, Char_t &sgn, UShort_t °, UShort_t &min, UShort_t &sec)136 {137 Day2Hms(d/24, sgn, deg, min, sec);138 }139 140 void Slalib::Deg2Hms(Double_t d, Char_t &sgn, UShort_t °, UShort_t &min, UShort_t &sec)141 {142 Rad2Hms(d/360, sgn, deg, min, sec);143 }144 145 void Slalib::Hor2Dms(Double_t h, Char_t &sgn, UShort_t °, UShort_t &min, UShort_t &sec)146 {147 Day2Hms(h*15/24, sgn, deg, min, sec);148 }149 150 void Slalib::Hor2Hms(Double_t h, Char_t &sgn, UShort_t °, UShort_t &min, UShort_t &sec)151 {152 Day2Hms(h/24, sgn, deg, min, sec);153 }154 155 void Slalib::Day2Hm(Double_t day, Char_t &sgn, UShort_t &hor, Double_t &min)156 {157 // Handle sign158 sgn = day<0?'-':'+';159 160 // Round interval and express in smallest units required161 Double_t a = Round(86400. * TMath::Abs(day)); // Days to seconds162 163 // Separate into fields164 const Double_t ah = Trunc(a/3600.);165 a -= ah * 3600.;166 167 // Return results168 hor = (UShort_t)ah;169 min = a/60.;170 }171 172 void Slalib::Rad2Hm(Double_t rad, Char_t &sgn, UShort_t °, Double_t &min)173 {174 Day2Hm(rad/(TMath::Pi()*2), sgn, deg, min);175 }176 177 void Slalib::Rad2Dm(Double_t rad, Char_t &sgn, UShort_t °, Double_t &min)178 {179 Rad2Hm(rad*15, sgn, deg, min);180 }181 182 void Slalib::Deg2Dm(Double_t d, Char_t &sgn, UShort_t °, Double_t &min)183 {184 Day2Hm(d/24, sgn, deg, min);185 }186 187 void Slalib::Deg2Hm(Double_t d, Char_t &sgn, UShort_t °, Double_t &min)188 {189 Rad2Hm(d/360, sgn, deg, min);190 }191 192 void Slalib::Hor2Dm(Double_t h, Char_t &sgn, UShort_t °, Double_t &min)193 {194 Day2Hm(h*15/24, sgn, deg, min);195 }196 197 void Slalib::Hor2Hm(Double_t h, Char_t &sgn, UShort_t °, Double_t &min)198 {199 Day2Hm(h/24, sgn, deg, min);200 }201 202 */ -
trunk/MagicSoft/Cosy/catalog/StarCatalog.cc
r4076 r4104 196 196 Float_t yy = loc.X()*fSinAngle + loc.Y()*fCosAngle; 197 197 198 if (xx<0 || xx >=768 || yy<0 || yy>=576) 199 continue; 200 198 201 // Store pixel coordinates of star in list 199 202 list.Add(xx+768/2, yy+576/2, -2.5*log10(mag));
Note:
See TracChangeset
for help on using the changeset viewer.