176 (*fNumOpenFitsFiles)++;
212 string fileNameWithoutFits =
fFileName.substr(0, fileName.size()-4);
214 while (counter < 100)
216 ostringstream newFileName;
217 newFileName << fileNameWithoutFits << counter <<
".fits";
218 ifstream testStream(newFileName.str().c_str());
221 if (rename(
fFileName.c_str(), newFileName.str().c_str()))
236 (*fNumOpenFitsFiles)++;
278 str <<
"TTYPE" << i+1;
281 str <<
"TCOMM" << i+1;
315 catch (
const CCfits::FitsException &e)
317 cout <<
"Exception !" << endl;
318 fMess->
Error(
"Opening or creating table '"+tableName+
"' in '"+fileName+
"': "+e.message());
vector< string > fDataFormats
the data format of the data columns
vector< char > fCopyBuffer
the copy buffer. Required to put the standard and data variable in contguous memory ...
size_t GetDataSize() const
CCfits::Table * fTable
The pointer to the CCfits FITS file.
Adds some functionality to boost::posix_time::ptime for our needs.
bool WriteHeaderKeys()
Write the FITS header keys.
bool SetFile(CCfits::FITS *file=0)
size_t GetNumRows() const
vector< Description > fStandardColDesc
MessageImp * fMess
were to log the errors
int Error(const std::string &str)
bool OpenFile(const string &filename, bool allow_open=false)
bool WriteKeyNT(const string &name, const T &value, const string &comment)
FITS writter for the FACT project.
uint32_t * fNumOpenFitsFiles
Keep track of number of opened fits.
int32_t fRunNumber
current run number being logged
vector< string > fStandardFormats
Format of the standard columns.
void AddColumn(char type, const string &name, int numElems=1, const string &unit="")
bool OpenNewTable(const string &tableName, int maxtry=1)
vector< Description > fDataColDesc
the vector of data column names
double fEndMjD
to keep track of the time of the latest written entry (to update the header when closing the file) ...
void Close()
Close the currently opened file.