FACT++  1.0
bool FitsFile::WriteDefaultKeys ( const string &  prgname,
float  version = 1.0 
)

Definition at line 21 of file FitsFile.cc.

References AddColumn(), Error(), Time::Iso(), Time::NightAsInt(), PACKAGE_NAME, PACKAGE_VERSION, REVISION, str, and type.

Referenced by ~FitsFile().

22 {
23  if (!fTable)
24  return false;
25 
26  try
27  {
28  const Time now;
29  WriteKey("TELESCOP", "FACT", "Telescope that acquired this data");
30  WriteKey("PACKAGE", PACKAGE_NAME, "Package name");
31  WriteKey("VERSION", PACKAGE_VERSION, "Package description");
32  WriteKey("CREATOR", prgname, "Program that wrote this file");
33  WriteKey("EXTREL", version, "Release Number");
34  WriteKey("COMPILED", __DATE__ " " __TIME__, "Compile time");
35  WriteKey("REVISION", REVISION, "SVN revision");
36  WriteKey("ORIGIN", "FACT", "Institution that wrote the file");
37  WriteKey("DATE", now.Iso(), "File creation date");
38  WriteKey("NIGHT", now.NightAsInt(), "Night as int");
39  WriteKey("TIMESYS", "UTC", "Time system");
40  WriteKey("TIMEUNIT", "d", "Time given in days w.r.t. to MJDREF");
41  WriteKey("MJDREF", 40587, "Store times in UNIX time (for convenience, seconds since 1970/1/1)");
42 
43  //WriteKey("CONTACT", PACKAGE_BUGREPORT, "Current package maintainer");
44  //WriteKey("URL", PACKAGE_URL, "Current repositiory location");
45  }
46  catch (const CCfits::FitsException &e)
47  {
48  Error("CCfits::Table::addKey failed for '"+fTable->name()+"' in '"+fFile->name()+"': "+e.message());
49  return false;
50  }
51 
52  return true;
53 }
#define PACKAGE_NAME
Definition: ofits.h:8
CCfits::Table * fTable
The pointer to the CCfits FITS file.
Definition: FitsFile.h:19
std::string Iso() const
Definition: Time.cc:253
Adds some functionality to boost::posix_time::ptime for our needs.
Definition: Time.h:30
uint32_t NightAsInt() const
Definition: Time.cc:397
void WriteKey(const string &name, const T &value, const string &comment)
Definition: FitsFile.h:55
#define PACKAGE_VERSION
Definition: ofits.h:12
#define REVISION
Definition: ofits.h:16
CCfits::FITS * fFile
Definition: FitsFile.h:18
int Error(const std::string &str)
Definition: MessageImp.h:49
Changes for version
Definition: README_v11.txt:85

+ Here is the call graph for this function:

+ Here is the caller graph for this function: