Changeset 1760 for trunk/MagicSoft/Cosy/base
- Timestamp:
- 02/16/03 17:02:06 (22 years ago)
- Location:
- trunk/MagicSoft/Cosy/base
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Cosy/base/MStarList.h
r1691 r1760 20 20 new (fStars[idx]) MStar(meanx, meany, mag); 21 21 } 22 void Add(Double_t meanx, Double_t meany, Double_t mag )22 void Add(Double_t meanx, Double_t meany, Double_t mag=0) 23 23 { 24 24 AddAt(fStars.GetLast()+1, meanx, meany, mag); -
trunk/MagicSoft/Cosy/base/coord.h
r1393 r1760 5 5 #include <fstream.h> 6 6 7 #include "MAGIC.h" 8 7 9 /* pi/180: degrees to radians */ 8 10 const double kDeg2Rad = 0.017453292519943295769236907684886127134428718885417; 9 11 10 12 /* 180/pi: radians to degrees */ 11 const double kRad2Deg = 57.295779513082320876798154814105170332405472466564;13 //const double kRad2Deg = 57.295779513082320876798154814105170332405472466564; 12 14 13 15 /* pi/2: 90 degrees in radians */ -
trunk/MagicSoft/Cosy/base/timer.cc
r1759 r1760 13 13 fMs = tv_usec; 14 14 15 SetMjd((fMs+fSecs)/(60*60*24) + 40587); 16 15 17 fSec = tv_sec%60; 16 18 tv_sec /= 60; … … 22 24 tv_sec /= 24; 23 25 24 Set(tv_sec + 40587); 25 26 fDiv = fmod((fMs+fSecs)/(60*60*24), 1.0); 26 // fDiv = fmod((fMs+fSecs)/(60*60*24), 1.0); 27 27 } 28 28 /* 29 29 void Timer::Set(const long mjd) 30 30 { 31 SetMjd(mjd); 32 31 33 // 32 34 // Express day in Gregorian calendar 33 35 // (taken from slalib slaDjcl) 34 36 // 35 fMjd = mjd;36 37 37 const long jd = mjd + 2400001; 38 38 const long n4 = (((((jd*4-17918)/146097)*6)/4+1)/2+jd-37)*4; … … 43 43 fDay = (nd10%306)/10 + 1; 44 44 } 45 45 */ 46 46 void Timer::SetTimer(const struct timeval *tv) 47 47 { … … 77 77 void Timer::SetMjd(double mjd) 78 78 { 79 Set((long)mjd); 79 // 80 // Express day in Gregorian calendar 81 // (taken from slalib slaDjcl) 82 // 83 fMjd = mjd; 84 85 const long jd = (long)mjd + 2400001; 86 const long n4 = (((((jd*4-17918)/146097)*6)/4+1)/2+jd-37)*4; 87 const long nd10 = (((n4-237)%1461)/4)*10+5; 88 89 fYea = n4/1461 - 4712; 90 fMon = ((nd10/306+2)%12) + 1; 91 fDay = (nd10%306)/10 + 1; 80 92 81 93 fDiv = fmod(mjd, 1.0); … … 84 96 85 97 mjd *= 24; 86 fHor = (int) mjd;98 fHor = (int)fmod(mjd, 24); 87 99 88 100 mjd *= 60; 89 fMin = (int) mjd;101 fMin = (int)fmod(mjd, 60); 90 102 91 103 mjd *= 60; 92 fSec = (int) mjd;104 fSec = (int)fmod(mjd, 60); 93 105 94 fMs = mjd * 1000;106 fMs = fmod(mjd * 1000, 1000); 95 107 } 96 108 -
trunk/MagicSoft/Cosy/base/timer.h
r1759 r1760 22 22 char fDateStr[30]; 23 23 24 void Set(const long mjd);24 //void Set(const long mjd); 25 25 26 26 public: … … 36 36 37 37 double Now(); //[s] 38 double GetMjd() const { return fMjd +fDiv; }38 double GetMjd() const { return fMjd/*+fDiv*/; } 39 39 40 40 virtual void SetMjd(double mjd);
Note:
See TracChangeset
for help on using the changeset viewer.