4 #include <CCfits/CCfits> 28 return fMsg.
Write(time, txt, qos);
33 fMsg(imp), fFile(0), fTable(0), fNumRows(0), fCursor(0)
40 void AddColumn(
char type,
const string &name,
int numElems=1,
const string &unit=
"");
41 void AddColumn(
const string &name,
const string &format,
const string &unit=
"");
42 void AddColumn(
char type,
const string &name,
const string &unit)
49 bool OpenFile(
const string &filename,
bool allow_open=
false);
50 bool SetFile(CCfits::FITS *file=0);
52 bool OpenNewTable(
const string &tableName,
int maxtry=1);
55 void WriteKey(
const string &name,
const T &value,
const string &comment)
58 fTable->addKey(name, value, comment);
62 bool WriteKeyNT(
const string &name,
const T &value,
const string &comment)
69 fTable->addKey(name, value, comment);
71 catch (CCfits::FitsException e)
73 Error(
"CCfits::Table::addKey failed for '"+name+
"' in '"+fFile->name()+
'/'+fTable->name()+
"': "+e.message());
90 return WriteData(fCursor, vec.data(), vec.size()*
sizeof(T));
100 string GetName()
const {
return fFile ? fFile->name() :
"<no file open>"; }
size_t fNumRows
The pointer to the CCfits binary table.
FitsFile(MessageImp &imp)
size_t GetDataSize() const
CCfits::Table * fTable
The pointer to the CCfits FITS file.
The base implementation of a distributed messaging system.
Adds some functionality to boost::posix_time::ptime for our needs.
const std::vector< std::string > & GetColumnTypes() const
void WriteKey(const string &name, const T &value, const string &comment)
bool SetFile(CCfits::FITS *file=0)
bool WriteDefaultKeys(const string &prgname, float version=1.0)
size_t GetNumRows() const
bool WriteData(const std::vector< T > &vec)
virtual int Write(const Time &time, const std::string &txt, int qos=kMessage)
int Error(const std::string &str)
bool OpenFile(const string &filename, bool allow_open=false)
std::vector< std::string > fColTypes
bool OpenTable(const string &tablename)
Warning because the service this data corrsponds to might have been last updated longer ago than Local time
bool WriteKeyNT(const string &name, const T &value, const string &comment)
size_t fCursor
the number of rows that have been written already to the FITS file.
bool WriteData(const void *ptr, size_t size)
FITS writter for the FACT project.
std::vector< std::string > fColUnits
void AddColumn(char type, const string &name, int numElems=1, const string &unit="")
bool WriteData(size_t &start, const void *ptr, size_t size)
std::vector< std::string > fColNames
bool OpenNewTable(const string &tableName, int maxtry=1)
int Write(const Time &time, const std::string &txt, int qos)
void AddColumn(char type, const string &name, const string &unit)