Ignore:
Timestamp:
11/12/08 13:55:31 (16 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mastro
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mastro/MAstro.cc

    r8999 r9156  
    1818!   Author(s): Thomas Bretz, 11/2003 <mailto:tbretz@astro.uni-wuerzburg.de>
    1919!
    20 !   Copyright: MAGIC Software Development, 2000-2004
     20!   Copyright: MAGIC Software Development, 2000-2008
    2121!
    2222!
     
    4646
    4747ClassImp(MAstro);
     48
     49const Double_t MAstro::kSynMonth = 29.53058868; // synodic month (new Moon to new Moon)
     50const Double_t MAstro::kEpoch0   = 44240.37917; // First full moon after 1980/1/1
    4851
    4952Double_t MAstro::RadToHor()
     
    616619Double_t MAstro::GetMoonPeriod(Double_t mjd)
    617620{
    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//
     632Double_t MAstro::GetMoonPeriodMjd(Double_t p)
     633{
     634    return p*kSynMonth+kEpoch0;
    623635}
    624636
     
    629641//   53257.8 --> 53258
    630642//   53258.3 --> 53258
    631 // Which is the time between 13h and 12:59h of the following day. To
     643// Which is the time between 12h and 11:59h of the following day. To
    632644// this day-period we assign the moon-period at midnight. To get
    633645// the MAGIC definition we now substract 284.
     
    653665
    654666    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//
     676Double_t MAstro::GetMagicPeriodStart(Int_t p)
     677{
     678    return TMath::Floor(GetMoonPeriodMjd(p+284))+0.5;
    655679}
    656680
  • trunk/MagicSoft/Mars/mastro/MAstro.h

    r8907 r9156  
    1616{
    1717private:
     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
    1821    static Double_t Round(Double_t val);
    1922    static Double_t Trunc(Double_t val);
     
    8790    static Double_t GetMoonPhase(Double_t mjd);
    8891    static Double_t GetMoonPeriod(Double_t mjd);
     92    static Double_t GetMoonPeriodMjd(Double_t p);
    8993    static Int_t    GetMagicPeriod(Double_t mjd);
     94    static Double_t GetMagicPeriodStart(Int_t p);
    9095
    9196    static Double_t EstimateCulminationTime(Double_t mjd, Double_t longit, Double_t ra);
Note: See TracChangeset for help on using the changeset viewer.