Changeset 14023 for trunk/FACT++/src


Ignore:
Timestamp:
06/01/12 16:06:28 (12 years ago)
Author:
tbretz
Message:
Moved the creation of the default keys to a static function so that it can be accessed from the outside, too.
Location:
trunk/FACT++/src
Files:
2 edited

Legend:

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

    r13030 r14023  
    55
    66using namespace std;
     7
     8void DataWriteFits2::WriteDefaultKeys(ofits &file)
     9{
     10    const Time now;
     11    file.SetStr(  "TELESCOP", "FACT",               "Telescope that acquired this data");
     12    file.SetStr(  "PACKAGE",   PACKAGE_NAME,        "Package name");
     13    file.SetStr(  "VERSION",   PACKAGE_VERSION,     "Package description");
     14    file.SetStr(  "CREATOR",   "fadctrl",           "Program that wrote this file");
     15    file.SetFloat("EXTREL",    1.0,                 "Release Number");
     16    file.SetStr(  "COMPILED",  __DATE__" "__TIME__, "Compile time");
     17    file.SetStr(  "REVISION",  REVISION,            "SVN revision");
     18    file.SetStr(  "ORIGIN",   "FACT",               "Institution that wrote the file");
     19    file.SetStr(  "DATE",     now.Iso(),            "File creation date");
     20    file.SetInt(  "NIGHT",    now.NightAsInt(),     "Night as int");
     21    file.SetStr(  "TIMESYS",  "UTC",                "Time system");
     22    file.SetStr(  "TIMEUNIT", "d",                  "Time given in days w.r.t. to MJDREF");
     23    file.SetInt(  "MJDREF",   40587,                "MJD to UNIX time (seconds since 1970/1/1)");
     24}
    725
    826void DataWriteFits2::WriteHeader(const RUN_HEAD* h, const FAD::RunDescription &d)
     
    3250    }
    3351
    34     // =============== Default keys from all files ===============
    35     const Time now;
    36     fFile.SetStr(  "TELESCOP", "FACT",               "Telescope that acquired this data");
    37     fFile.SetStr(  "PACKAGE",   PACKAGE_NAME,        "Package name");
    38     fFile.SetStr(  "VERSION",   PACKAGE_VERSION,     "Package description");
    39     fFile.SetStr(  "CREATOR",   "fadctrl",           "Program that wrote this file");
    40     fFile.SetFloat("EXTREL",    1.0,                 "Release Number");
    41     fFile.SetStr(  "COMPILED",  __DATE__" "__TIME__, "Compile time");
    42     fFile.SetStr(  "REVISION",  REVISION,            "SVN revision");
    43     fFile.SetStr(  "ORIGIN",   "FACT",               "Institution that wrote the file");
    44     fFile.SetStr(  "DATE",     now.Iso(),            "File creation date");
    45     fFile.SetInt(  "NIGHT",    now.NightAsInt(),     "Night as int");
    46     fFile.SetStr(  "TIMESYS",  "UTC",                "Time system");
    47     fFile.SetStr(  "TIMEUNIT", "d",                  "Time given in days w.r.t. to MJDREF");
    48     fFile.SetInt(  "MJDREF",   40587,                "MJD to UNIX time (seconds since 1970/1/1)");
    49     //WriteKey("CONTACT",   PACKAGE_BUGREPORT, "Current package maintainer");
    50     //WriteKey("URL",       PACKAGE_URL, "Current repositiory location");
     52    // =============== Default keys for all files ================
     53    WriteDefaultKeys(fFile);
    5154
    5255    // ================ Header keys for raw-data =================
  • trunk/FACT++/src/DataWriteFits2.h

    r12997 r14023  
    3030    bool WriteEvt(EVENT *e);
    3131    bool Close(RUN_TAIL *rt = 0);
     32
     33    static void WriteDefaultKeys(std::ofits &file);
    3234};
    3335
Note: See TracChangeset for help on using the changeset viewer.