Ignore:
Timestamp:
02/16/07 09:21:13 (18 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mastro
Files:
3 edited

Legend:

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

    r8066 r8324  
    446446}
    447447
     448// --------------------------------------------------------------------------
     449//
     450// Estimates the time at which a source culminates.
     451//
     452// ra: right ascension [rad]
     453// elong: observers longitude [rad]
     454// mjd: modified julian date (utc)
     455//
     456// return time in [-12;12]
     457//
     458Double_t MAstro::EstimateCulminationTime(Double_t mjd, Double_t elong, Double_t ra)
     459{
     460    // startime at 1.1.2000 for greenwich 0h
     461    const Double_t gmt0 = 6.664520;
     462
     463    // difference of startime for greenwich for two calendar days [h]
     464    const Double_t d0 = 0.06570982224;
     465
     466    // mjd of greenwich 1.1.2000 0h
     467    const Double_t mjd0 = 51544;
     468
     469    // mjd today
     470    const Double_t mjd1 = TMath::Floor(mjd);
     471
     472    // scale between star-time and sun-time
     473    const Double_t scale = 1;//1.00273790926;
     474
     475    const Double_t UT = (ra-elong)*RadToHor() - (gmt0 + d0 * (mjd1-mjd0))/scale;
     476
     477    return fmod(2412 + UT, 24) - 12;
     478}
    448479
    449480// --------------------------------------------------------------------------
  • trunk/MagicSoft/Mars/mastro/MAstro.h

    r8140 r8324  
    3131    static Double_t HorToDeg()        { return 1./15; }
    3232
    33     static Double_t RadToHor()        { return 15/TMath::TwoPi(); }
    34     static Double_t HorToRad()        { return TMath::TwoPi()/15; }
     33    static Double_t RadToHor()        { return 24/TMath::TwoPi(); }
     34    static Double_t HorToRad()        { return TMath::TwoPi()/24; }
    3535
    3636    // Angle/Time conversion functions
     
    8686    static Int_t    GetMagicPeriod(Double_t mjd);
    8787
     88    static Double_t EstimateCulminationTime(Double_t mjd, Double_t longit, Double_t ra);
     89
    8890    // Estimate some parameters around the sun
    8991    static Double_t GetSunRaDec(Double_t mjd, Double_t &ra, Double_t &dec);
  • trunk/MagicSoft/Mars/mastro/MObservatory.cc

    r8066 r8324  
    110110    *fLog << all;
    111111    *fLog << underline << fObservatoryName << ":" << endl;
    112     *fLog << "Latitude:  " << TMath::Abs(fLatitude*kRad2Deg)  << " deg " << (fLatitude  > 0 ? "W" : "E") << endl;
    113     *fLog << "Longitude: " << TMath::Abs(fLongitude*kRad2Deg) << " deg " << (fLongitude < 0 ? "N" : "S") << endl;
     112    *fLog << "Latitude:  " << TMath::Abs(fLatitude*kRad2Deg)  << " deg " << (fLatitude  > 0 ? "N" : "S") << endl;
     113    *fLog << "Longitude: " << TMath::Abs(fLongitude*kRad2Deg) << " deg " << (fLongitude < 0 ? "E" : "W") << endl;
    114114    *fLog << "Height:    " << fHeight << "m" << endl;
    115115}
Note: See TracChangeset for help on using the changeset viewer.