Ignore:
Timestamp:
07/18/11 16:22:42 (13 years ago)
Author:
tbretz
Message:
Write a proper FITS header; removed obsolete fMjdRef data member
File:
1 edited

Legend:

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

    r11405 r11441  
    258258        }
    259259                       
    260         //As requested by Roland, the reference MjD is 0.0
    261         fRefMjD = 0;//* static_cast<double*>(fStandardPointers[0]);
    262260        if (!updating)
    263261                return WriteHeaderKeys();
     
    293291bool Fits::WriteHeaderKeys()
    294292{
    295         if (!fTable)
    296                 return false;
    297 
    298         string stringValue = Time().GetAsStr();
    299         stringValue[10]= 'T';
    300 
    301         if (!WriteSingleHeaderKey("EXTREL", 1.0f, "Release Number")) return false;
    302         if (!WriteSingleHeaderKey("TELESCOP", "FACT", "Telescope that acquired this data")) return false;
    303         if (!WriteSingleHeaderKey("ORIGIN", "ISDC", "Institution that wrote the file")) return false;
    304         if (!WriteSingleHeaderKey("CREATOR", "FACT++ DataLogger", "Program that wrote this file")) return false;
    305         if (!WriteSingleHeaderKey("DATE", stringValue, "File creation data")) return false;
    306         if (!WriteSingleHeaderKey("TIMESYS", "TT", "Time frame system")) return false;
    307         if (!WriteSingleHeaderKey("TIMEUNIT", "d", "Time unit")) return false;
    308         if (!WriteSingleHeaderKey("TIMEREF", "UTC", "Time reference frame")) return false;
    309         if (!WriteSingleHeaderKey("MJDREF", fRefMjD, "Modified Julian Date of origin")) return false;
    310         if (!WriteSingleHeaderKey("TSTOP", fEndMjD, "Time of the last receied data")) return false;
     293    if (!fTable)
     294        return false;
     295
     296    const Time now;
     297    if (!WriteSingleHeaderKey("EXTREL",   1.0f, "Release Number")) return false;
     298    if (!WriteSingleHeaderKey("TELESCOP", "FACT", "Telescope that acquired this data")) return false;
     299    if (!WriteSingleHeaderKey("ORIGIN",   "ISDC", "Institution that wrote the file")) return false;
     300    if (!WriteSingleHeaderKey("CREATOR",  "fadctrl", "Program that wrote this file (FACT++ datalogger)")) return false;
     301    if (!WriteSingleHeaderKey("PACKAGE",   PACKAGE_NAME, "Package name")) return false;
     302    if (!WriteSingleHeaderKey("VERSION",   PACKAGE_VERSION, "Package description")) return false;
     303    if (!WriteSingleHeaderKey("COMPILED",  __DATE__" "__TIME__, "Compile time")) return false;
     304    if (!WriteSingleHeaderKey("REVISION",  REVISION, "SVN revision")) return false;
     305    if (!WriteSingleHeaderKey("DATE",     now.Iso(), "File creation date")) return false;
     306    if (!WriteSingleHeaderKey("NIGHT",    now.NightAsInt(), "Night as int")) return false;
     307    if (!WriteSingleHeaderKey("TIMESYS",  "UTC", "Time systen")) return false;
     308    if (!WriteSingleHeaderKey("TSTART",   "", "Time of the first receied data")) return false;
     309    if (!WriteSingleHeaderKey("TSTOP",    "", "Time of the last receied data")) return false;
    311310    return true;
    312311}
     
    360359    {
    361360        const double doubleValue = *reinterpret_cast<double*>(fStandardPointers[0]);
    362         WriteSingleHeaderKey("TSTART", doubleValue,
     361        WriteSingleHeaderKey("TSTART", Time(doubleValue).Iso(),
    363362                             "Time of the first received data");
    364363    }
     
    393392//          CCfits::FITS* backupFits = fFile;
    394393//          fFile = NULL;
    395             WriteSingleHeaderKey("TSTOP", fEndMjD, "Time of the last receied data");
     394            WriteSingleHeaderKey("TSTOP", Time(fEndMjD).Iso(), "Time of the last receied data");
    396395            delete fFile;
    397396
Note: See TracChangeset for help on using the changeset viewer.