Changeset 11441


Ignore:
Timestamp:
07/18/11 16:22:42 (13 years ago)
Author:
tbretz
Message:
Write a proper FITS header; removed obsolete fMjdRef data member
Location:
trunk/FACT++/src
Files:
3 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
  • trunk/FACT++/src/Fits.h

    r11405 r11441  
    4747                ///to keep track of the time of the latest written entry (to update the header when closing the file)
    4848                double fEndMjD;
    49                 ///to keep track of the reference MjD
    50                 double fRefMjD;
    5149                ///Write the FITS header keys
    5250                bool WriteHeaderKeys();
     
    7270                                         fTotalNumBytes(0),
    7371                                         fEndMjD(0.0),
    74                                          fRefMjD(0.0),
    7572                                         fFileName(""),
    7673                                         fNumOpenFitsFiles(NULL),
  • trunk/FACT++/src/datalogger.cc

    r11416 r11441  
    21532153{
    21542154    //Init the time columns of the file
    2155     Description dateDesc(string("Time"), string("Modified Julian Date"), string("MjD"));
     2155    Description dateDesc(string("Time"), string("Modified Julian Date"), string("MJD"));
    21562156    sub.nightlyFile.AddStandardColumn(dateDesc, "1D", &fMjD, sizeof(double));
    21572157    sub.runFile.AddStandardColumn(dateDesc, "1D", &fMjD, sizeof(double));
    21582158
    2159     Description QoSDesc("Qos", "Quality of service", "None");
     2159    Description QoSDesc("QoS", "Quality of service", "");
    21602160    sub.nightlyFile.AddStandardColumn(QoSDesc, "1J", &fQuality, sizeof(int));
    21612161    sub.runFile.AddStandardColumn(QoSDesc, "1J", &fQuality, sizeof(int));
Note: See TracChangeset for help on using the changeset viewer.