Changeset 12636


Ignore:
Timestamp:
11/24/11 15:50:07 (13 years ago)
Author:
tbretz
Message:
Adapted writing of TSTART and TSTOP to fMjd in the data logger now being unix time.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/Fits.cc

    r12618 r12636  
    320320    {
    321321        // FIXME: Check error?
    322         const double doubleValue = *reinterpret_cast<double*>(fStandardPointers[0]);
    323 
    324         const double start = Time(doubleValue).UnixDate();
    325         const double stop  = Time(fEndMjD).UnixDate();
    326 
    327         fFile->WriteKeyNT("TSTARTI", uint32_t(floor(start)), "Time when first event received (integral part)");
    328         fFile->WriteKeyNT("TSTARTF", fmod(start, 1),         "Time when first event received (fractional part)");
    329         fFile->WriteKeyNT("TSTOPI",  uint32_t(floor(stop)),  "Time when last event received (integral part)");
    330         fFile->WriteKeyNT("TSTOPF",  fmod(stop, 1),          "Time when last event received (fractional part)");
    331 
    332         fFile->WriteKeyNT("DATE-OBS", Time(doubleValue).Iso(),
     322        const double time = *reinterpret_cast<double*>(fStandardPointers[0]);
     323
     324        fFile->WriteKeyNT("TSTARTI", uint32_t(floor(time)),    "Time when first event received (integral part)");
     325        fFile->WriteKeyNT("TSTARTF", fmod(time, 1),            "Time when first event received (fractional part)");
     326        fFile->WriteKeyNT("TSTOPI",  uint32_t(floor(fEndMjD)), "Time when last event received (integral part)");
     327        fFile->WriteKeyNT("TSTOPF",  fmod(fEndMjD, 1),         "Time when last event received (fractional part)");
     328
     329        fFile->WriteKeyNT("DATE-OBS", Time(time+40587).Iso(),
    333330                          "Time when first event received");
    334331
    335         fFile->WriteKeyNT("DATE-END", Time(fEndMjD).Iso(),
     332        fFile->WriteKeyNT("DATE-END", Time(fEndMjD+40587).Iso(),
    336333                          "Time when last event received");
    337334    }
    338     fEndMjD = *reinterpret_cast<double*>(fStandardPointers[0]);
     335    fEndMjD = time;
    339336
    340337    return true;
     
    353350    if (fFile->IsOpen() && fFile->IsOwner())
    354351    {
    355         const double stop = Time(fEndMjD).UnixDate();
    356 
    357352        // FIMXE: Check for error? (It is allowed that fFile is NULL)
    358         fFile->WriteKeyNT("TSTOPI", uint32_t(floor(stop)),  "Time when last event received (integral part)");
    359         fFile->WriteKeyNT("TSTOPF", fmod(stop, 1),           "Time when last event received (fractional part)");
    360 
    361         fFile->WriteKeyNT("DATE-END", Time(fEndMjD).Iso(),
     353        fFile->WriteKeyNT("TSTOPI", uint32_t(floor(fEndMjD)), "Time when last event received (integral part)");
     354        fFile->WriteKeyNT("TSTOPF", fmod(fEndMjD, 1),         "Time when last event received (fractional part)");
     355
     356        fFile->WriteKeyNT("DATE-END", Time(fEndMjD+40587).Iso(),
    362357                          "Time when last event received");
    363358    }
Note: See TracChangeset for help on using the changeset viewer.