39 #define G_D1STATUS "GCOMStatus::d1status(int&, int&)"
40 #define G_D2STATUS "GCOMStatus::d2status(int&, int&)"
41 #define G_UPDATE_CACHE "GCOMStatus::update_cache(int&)"
42 #define G_LOAD_STATUS "GCOMStatus::load_status()"
117 if (
this != &status) {
196 if (module < 1 || module > 7) {
197 std::string msg =
"Invalid D1 module number ("+
gammalib::str(module)+
198 "). Number needs to be comprised within [1,7].";
225 if (module < 1 || module > 14) {
226 std::string msg =
"Invalid D2 module number ("+
gammalib::str(module)+
227 "). Number needs to be comprised within [1,14].";
254 result.append(
"=== GCOMStatus ===");
259 result.append(
"not loaded");
262 result.append(
"loaded");
267 result.append(
" - ");
269 result.append(
" days");
351 bool success =
false;
354 for (
int i = 0; i <
m_tjds.size(); ++i) {
365 std::string msg =
"No COMPTEL status information found for TJD "+
367 "Please exclude that day from your analysis.";
392 GCaldb caldb(
"cgro",
"comptel");
399 std::string msg =
"COMPTEL status information not found in COMPTEL "
400 "calibration database. Make sure that the COMPTEL "
401 "calibration database is in the path of the $CALDB "
402 "environment variable.";
407 GFits fits(filename);
413 int num = table.
nrows();
429 for (
int i = 0; i < num; ++i) {
436 for (
int k = 0; k < 7; ++k) {
437 d1status.push_back(ptr_d1status->
integer(i,k));
443 for (
int k = 0; k < 14; ++k) {
444 d2status.push_back(ptr_d2status->
integer(i,k));
COMPTEL instrument status class.
COMPTEL instrument status class definition.
GFitsTable * table(const int &extno)
Get pointer to table HDU.
std::vector< int > m_last_d2status
Last D2 module status.
virtual void clear(void)
Clear COMPTEL instrument status.
void free_members(void)
Delete class members.
void load_status(void) const
Load status information from database.
bool is_empty(void) const
Signal if filename is empty.
GFilename filename(const std::string &detector, const std::string &filter, const std::string &codename, const std::string &date, const std::string &time, const std::string &expr)
Return calibration file name based on selection parameters.
virtual ~GCOMStatus(void)
Destructor.
std::vector< int > m_tjds
TJD for status.
FITS file class interface definition.
virtual GCOMStatus * clone(void) const
Clone COMPTEL instrument status.
GCOMStatus & operator=(const GCOMStatus &status)
Assignment operator.
Calibration database class.
void copy_members(const GCOMStatus &status)
Copy class members.
Abstract interface for FITS table column.
Abstract interface for FITS table.
GCOMStatus(void)
Void constructor.
std::vector< std::vector< int > > m_d1status
D1 module status.
int d1status(const int &tjd, const int &module) const
Return D1 module status.
Calibration database class interface definition.
const int & nrows(void) const
Return number of rows in table.
int d2status(const int &tjd, const int &module) const
Return D2 module status.
virtual int integer(const int &row, const int &inx=0) const =0
std::vector< std::vector< int > > m_d2status
D2 module status.
std::vector< int > m_last_d1status
Last D1 module status.
Exception handler interface definition.
void init_members(void)
Initialise class members.
void load(void) const
Load COMPTEL instrument status database.
std::string parformat(const std::string &s, const int &indent=0)
Convert string in parameter format.
void update_cache(const int &tjd) const
Update module status cache.
void close(void)
Close FITS file.
virtual std::string print(const GChatter &chatter=NORMAL) const
Print COMPTEL instrument status.
std::string str(const unsigned short int &value)
Convert unsigned short integer value into string.
FITS table abstract base class interface definition.