Changeset 9156
- Timestamp:
- 11/12/08 13:55:31 (16 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r9154 r9156 18 18 19 19 -*-*- END OF LINE -*-*- 20 21 2008/11/12 Thomas Bretz 22 23 * datacenter/macros/plotstat.C: 24 - added descriptions for the tabs 25 - added legend to all tabs 26 - added beginning and end of period to all tabs 27 28 * mastro/MAstro.[h,cc]: 29 - added new member function GetMoonPeriodMjd 30 - added new member function GetMagicPeriodStart 31 32 * mbase/MTime.[h,cc]: 33 - added new member function SetMoonPeriod 34 - added new member function SetMagicPeriodStart 35 36 20 37 21 38 2008/11/11 Thomas Bretz -
trunk/MagicSoft/Mars/mastro/MAstro.cc
r8999 r9156 18 18 ! Author(s): Thomas Bretz, 11/2003 <mailto:tbretz@astro.uni-wuerzburg.de> 19 19 ! 20 ! Copyright: MAGIC Software Development, 2000-200 420 ! Copyright: MAGIC Software Development, 2000-2008 21 21 ! 22 22 ! … … 46 46 47 47 ClassImp(MAstro); 48 49 const Double_t MAstro::kSynMonth = 29.53058868; // synodic month (new Moon to new Moon) 50 const Double_t MAstro::kEpoch0 = 44240.37917; // First full moon after 1980/1/1 48 51 49 52 Double_t MAstro::RadToHor() … … 616 619 Double_t MAstro::GetMoonPeriod(Double_t mjd) 617 620 { 618 const Double_t synmonth = 29.53058868; // synodic month (new Moon to new Moon) 619 const Double_t epoch0 = 44240.37917; // First full moon after 1980/1/1 620 621 const Double_t et = mjd-epoch0; // Ellapsed time 622 return et/synmonth; 621 const Double_t et = mjd-kEpoch0; // Elapsed time 622 return et/kSynMonth; 623 } 624 625 // -------------------------------------------------------------------------- 626 // 627 // Convert a moon period back to a mjd 628 // 629 // See also 630 // MAstro::GetMoonPeriod 631 // 632 Double_t MAstro::GetMoonPeriodMjd(Double_t p) 633 { 634 return p*kSynMonth+kEpoch0; 623 635 } 624 636 … … 629 641 // 53257.8 --> 53258 630 642 // 53258.3 --> 53258 631 // Which is the time between 1 3h and 12:59h of the following day. To643 // Which is the time between 12h and 11:59h of the following day. To 632 644 // this day-period we assign the moon-period at midnight. To get 633 645 // the MAGIC definition we now substract 284. … … 653 665 654 666 return (Int_t)TMath::Floor(period)-284; 667 } 668 669 // -------------------------------------------------------------------------- 670 // 671 // Get the start time (12h noon) of the MAGIC period p. 672 // 673 // See also 674 // MAstro::GetMagicPeriod 675 // 676 Double_t MAstro::GetMagicPeriodStart(Int_t p) 677 { 678 return TMath::Floor(GetMoonPeriodMjd(p+284))+0.5; 655 679 } 656 680 -
trunk/MagicSoft/Mars/mastro/MAstro.h
r8907 r9156 16 16 { 17 17 private: 18 static const Double_t kSynMonth; // synodic month (new Moon to new Moon) 19 static const Double_t kEpoch0; // First full moon after 1980/1/1 20 18 21 static Double_t Round(Double_t val); 19 22 static Double_t Trunc(Double_t val); … … 87 90 static Double_t GetMoonPhase(Double_t mjd); 88 91 static Double_t GetMoonPeriod(Double_t mjd); 92 static Double_t GetMoonPeriodMjd(Double_t p); 89 93 static Int_t GetMagicPeriod(Double_t mjd); 94 static Double_t GetMagicPeriodStart(Int_t p); 90 95 91 96 static Double_t EstimateCulminationTime(Double_t mjd, Double_t longit, Double_t ra); -
trunk/MagicSoft/Mars/mbase/MTime.cc
r9027 r9156 179 179 // -------------------------------------------------------------------------- 180 180 // 181 // Set the time corresponding to the moon period. 182 // 183 // see MTime::GetMoonPeriod and MAstro::GetMoonPeriod 184 // 185 void MTime::SetMoonPeriod(Double_t p) 186 { 187 SetMjd(MAstro::GetMoonPeriodMjd(p)); 188 } 189 190 // -------------------------------------------------------------------------- 191 // 181 192 // To get the moon period as defined for MAGIC observation we take the 182 193 // nearest integer mjd, eg: … … 208 219 } 209 220 221 // -------------------------------------------------------------------------- 222 // 223 // Set the start time (noon) of a MAGIC period 224 // 225 // see MTime::GetMagicPeriod and MAstro::GetMagicPeriod 226 // 227 void MTime::SetMagicPeriodStart(Int_t p) 228 { 229 SetMjd(MAstro::GetMagicPeriodStart(p)); 230 } 210 231 211 232 // -------------------------------------------------------------------------- -
trunk/MagicSoft/Mars/mbase/MTime.h
r8996 r9156 104 104 void SetMjd(Double_t m); 105 105 void SetAxisTime(Double_t time); 106 void SetMoonPeriod(Double_t p); 107 void SetMagicPeriodStart(Int_t p); 106 108 void SetUnixTime(Long64_t sec, ULong64_t usec=0); 107 109 void SetEaster(Short_t year=0);
Note:
See TracChangeset
for help on using the changeset viewer.