Ignore:
Timestamp:
11/22/11 14:13:53 (13 years ago)
Author:
tbretz
Message:
Changed TSTART/TSTOP according to match the latest changes in the raw data header.
File:
1 edited

Legend:

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

    r12536 r12616  
    238238        return false;
    239239
    240     if (!fFile->WriteKeyNT("TSTART", "", "Time of the first receied data"))
    241         return false;
    242 
    243     if (!fFile->WriteKeyNT("TSTOP",  "", "Time of the last receied data"))
     240    if (!fFile->WriteKeyNT("TSTARTI",  0, "Time when first event received (integral part)")   ||
     241        !fFile->WriteKeyNT("TSTARTF",  0, "Time when first event received (fractional part)") ||
     242        !fFile->WriteKeyNT("TSTOPI",   0, "Time when last event received (integral part)")    ||
     243        !fFile->WriteKeyNT("TSTOPF",   0, "Time when last event received (fractional part)")  ||
     244        !fFile->WriteKeyNT("DATE-OBS", 0, "Time when first event received") ||
     245        !fFile->WriteKeyNT("DATE-END", 0, "Time when last event received"))
    244246        return false;
    245247
     
    319321        // FIXME: Check error?
    320322        const double doubleValue = *reinterpret_cast<double*>(fStandardPointers[0]);
    321         fFile->WriteKeyNT("TSTART", Time(doubleValue).Iso(),
    322                           "Time of the first received data");
    323         fFile->WriteKeyNT("TSTOP", Time(fEndMjD).Iso(),
    324                           "Time of the last receied data");
     323
     324        const double start = Time(doubleValue).UnixTime();
     325        const double stop  = Time(fEndMjD).UnixTime();
     326
     327        fFile->WriteKeyNT("TSTARTI", 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",  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(),
     333                          "Time when first event received");
     334
     335        fFile->WriteKeyNT("DATE-END", Time(fEndMjD).Iso(),
     336                          "Time when last event received");
    325337    }
    326338    fEndMjD = *reinterpret_cast<double*>(fStandardPointers[0]);
     
    341353    if (fFile->IsOpen() && fFile->IsOwner())
    342354    {
     355        const double stop = Time(fEndMjD).UnixTime();
     356
    343357        // FIMXE: Check for error? (It is allowed that fFile is NULL)
    344         fFile->WriteKeyNT("TSTOP", Time(fEndMjD).Iso(),
    345                           "Time of the last receied data");
     358        fFile->WriteKeyNT("TSTOPI", 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(),
     362                          "Time when last event received");
    346363    }
    347364
Note: See TracChangeset for help on using the changeset viewer.