Changeset 2891


Ignore:
Timestamp:
01/23/04 14:47:01 (21 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r2890 r2891  
    44
    55                                                 -*-*- END OF LINE -*-*-
     6
     7 2004/01/23: Thomas Bretz
     8
     9   * mbase/MAstro.cc:
     10     - Fixed calculation of MJD. In Ymd2Mjd a plus should be a minus.
     11
     12
    613
    714 2004/01/23: Abelardo Moralejo
     
    1724     - Added missing support for analysis of stereo files.
    1825
     26
     27
    1928 2004/01/23: Raquel de los Reyes
    2029
    2130   * macros/CCDataCheck.C
    2231     - Added the temperature distribution of the optical links.
     32
     33
    2334
    2435 2004/01/22: Abelardo Moralejo
     
    4657       histogram used in the light calibration is written to the output
    4758       file.
     59
     60
    4861
    4962 2004/01/22: Thomas Bretz
  • trunk/MagicSoft/Mars/mbase/MAstro.cc

    r2604 r2891  
    216216Int_t MAstro::Ymd2Mjd(UShort_t y, Byte_t m, Byte_t d)
    217217{
    218    // Month lengths in days
    219    static int months[12] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
     218    // Month lengths in days
     219    static int months[12] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
    220220
    221221    // Validate month
     
    230230        return -1;
    231231
    232     // Lengthen year and month numbers to avoid overflow
     232    // Precalculate some values
    233233    const Byte_t  lm = 12-m;
    234     const ULong_t lm10 = 4712 + y + lm/10;
     234    const ULong_t lm10 = 4712 + y - lm/10;
    235235
    236236    // Perform the conversion
    237     return 1461L*lm10/4 + (306*((21-lm)%12)+5)/10 - (3*((lm10+188)/100))/4 + d - 2399904;
    238 }
     237    return 1461L*lm10/4 + (306*((m+9)%12)+5)/10 - (3*((lm10+188)/100))/4 + d - 2399904;
     238}
Note: See TracChangeset for help on using the changeset viewer.