Changeset 12618
- Timestamp:
- 11/22/11 23:39:34 (13 years ago)
- Location:
- trunk/FACT++/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/DataWriteFits.cc
r12615 r12618 246 246 const Time stop (fTstop[0], fTstop[1]); 247 247 248 fFile.WriteKey("TSTARTI", floor(start.UnixTime()),248 fFile.WriteKey("TSTARTI", uint32_t(floor(start.UnixDate())), 249 249 "Time when first event received (integral part)"); 250 fFile.WriteKey("TSTARTF", fmod(start.Unix Time(), 1),250 fFile.WriteKey("TSTARTF", fmod(start.UnixDate(), 1), 251 251 "Time when first event received (fractional part)"); 252 fFile.WriteKey("TSTOPI", floor(stop.UnixTime()),252 fFile.WriteKey("TSTOPI", uint32_t(floor(stop.UnixDate())), 253 253 "Time when last event received (integral part)"); 254 fFile.WriteKey("TSTOPF", fmod(stop.Unix Time(), 1),254 fFile.WriteKey("TSTOPF", fmod(stop.UnixDate(), 1), 255 255 "Time when last event received (fractional part)"); 256 256 fFile.WriteKey("DATE-OBS", start.Iso(), -
trunk/FACT++/src/Fits.cc
r12616 r12618 322 322 const double doubleValue = *reinterpret_cast<double*>(fStandardPointers[0]); 323 323 324 const double start = Time(doubleValue).Unix Time();325 const double stop = Time(fEndMjD).Unix Time();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)");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 331 332 332 fFile->WriteKeyNT("DATE-OBS", Time(doubleValue).Iso(), … … 353 353 if (fFile->IsOpen() && fFile->IsOwner()) 354 354 { 355 const double stop = Time(fEndMjD).Unix Time();355 const double stop = Time(fEndMjD).UnixDate(); 356 356 357 357 // FIMXE: Check for error? (It is allowed that fFile is NULL) 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)");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 360 361 361 fFile->WriteKeyNT("DATE-END", Time(fEndMjD).Iso(), -
trunk/FACT++/src/Time.cc
r11440 r12618 186 186 // -------------------------------------------------------------------------- 187 187 // 188 // @returns days since 1970/1/1 189 // 190 double Time::UnixDate() const 191 { 192 return (date().modjulian_day()-40587) + SecondsOfDay()/(24*60*60); 193 } 194 195 // -------------------------------------------------------------------------- 196 // 188 197 // @returns seconds since 1970/1/1 189 198 // -
trunk/FACT++/src/Time.h
r11439 r12618 98 98 time_t Time_t() const; 99 99 double UnixTime() const; 100 double UnixDate() const; 100 101 double RootTime() const; 101 102
Note:
See TracChangeset
for help on using the changeset viewer.