Changeset 9156 for trunk


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

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r9154 r9156  
    1818
    1919                                                 -*-*- 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
    2037
    2138 2008/11/11 Thomas Bretz
  • 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);
  • trunk/MagicSoft/Mars/mbase/MTime.cc

    r9027 r9156  
    179179// --------------------------------------------------------------------------
    180180//
     181// Set the time corresponding to the moon period.
     182//
     183//   see MTime::GetMoonPeriod and MAstro::GetMoonPeriod
     184//
     185void MTime::SetMoonPeriod(Double_t p)
     186{
     187    SetMjd(MAstro::GetMoonPeriodMjd(p));
     188}
     189
     190// --------------------------------------------------------------------------
     191//
    181192// To get the moon period as defined for MAGIC observation we take the
    182193// nearest integer mjd, eg:
     
    208219}
    209220
     221// --------------------------------------------------------------------------
     222//
     223// Set the start time (noon) of a MAGIC period
     224//
     225//   see MTime::GetMagicPeriod and MAstro::GetMagicPeriod
     226//
     227void MTime::SetMagicPeriodStart(Int_t p)
     228{
     229    SetMjd(MAstro::GetMagicPeriodStart(p));
     230}
    210231
    211232// --------------------------------------------------------------------------
  • trunk/MagicSoft/Mars/mbase/MTime.h

    r8996 r9156  
    104104    void     SetMjd(Double_t m);
    105105    void     SetAxisTime(Double_t time);
     106    void     SetMoonPeriod(Double_t p);
     107    void     SetMagicPeriodStart(Int_t p);
    106108    void     SetUnixTime(Long64_t sec, ULong64_t usec=0);
    107109    void     SetEaster(Short_t year=0);
Note: See TracChangeset for help on using the changeset viewer.