116 const std::string& usage,
117 const std::string& mode)
123 load(filename, usage, mode);
219 const std::string& usage,
220 const std::string& mode)
223 GFits fits(filename);
229 read(hdu, usage, mode);
248 const bool& clobber)
const
282 const std::string& usage,
283 const std::string& mode)
289 int num = table.
nrows();
292 std::vector<std::string> modes;
296 int nmodes = modes.size();
312 for (
int i = 0; i < num; ++i) {
315 if (!usage.empty() && ptr_usage->
string(i) != usage) {
323 std::string mode = ptr_mode->
string(i);
326 if ((mode ==
"MODIFIED") && (ptr_subkey->
string(i) ==
"LOW")) {
332 for (
int k = 0; k < nmodes; ++k) {
333 if (mode == modes[k]) {
397 col_start_tjd.
unit(
"d");
398 col_end_tjd.
unit(
"d");
401 for (
int i = 0; i <size; ++i) {
414 table.
append(col_start_tjd);
415 table.
append(col_start_tic);
416 table.
append(col_end_tjd);
417 table.
append(col_end_tic);
421 table.
append(col_descrip);
451 result.append(
"=== GCOMTim ===");
466 result.append(
" - ");
472 result.append(
" - ");
476 result.append(
" - ");
480 std::vector<std::string> modes;
481 for (
int i = 0; i <
m_mode.size(); ++i) {
483 if (mode.length() > 0) {
485 for (
int k = 0; k < modes.size(); ++k) {
486 if (mode == modes[k]) {
492 modes.push_back(mode);
498 if (modes.size() == 0) {
500 result.append(
"NONE");
502 else if (modes.size() == 1) {
504 result.append(modes[0]);
508 for (
int k = 0; k < modes.size(); ++k) {
512 result.append(modes[k]);
Implementation of support function used by COMPTEL classes.
COMPTEL Good Time Intervals class definition.
FITS binary table class definition.
FITS table string column class interface definition.
FITS table unsigned long integer column class interface definition.
FITS table abstract base class interface definition.
FITS file class interface definition.
COMPTEL Good Time Intervals class.
GGti m_gti
Good Time intervals.
const GGti & gti(void) const
Return Good Time Intervals.
void write(GFitsBinTable &table) const
Write COMPTEL Good Time Intervals into FITS binary table.
std::vector< std::string > m_usage
Usage string.
std::vector< std::string > m_subkey
Subkey string.
GCOMTim(void)
Void constructor.
virtual void clear(void)
Clear COMPTEL good time intervals.
virtual std::string print(const GChatter &chatter=NORMAL) const
Print COMPTEL Good Time Intervals.
void init_members(void)
Initialise class members.
virtual ~GCOMTim(void)
Destructor.
void read(const GFitsTable &table, const std::string &usage="YES", const std::string &mode="NORMAL|SOLAR80|LOW")
Read COMPTEL Good Time Intervals from FITS table.
GCOMTim & operator=(const GCOMTim &tim)
Assignment operator.
std::vector< std::string > m_descrip
Description string.
void free_members(void)
Delete class members.
void copy_members(const GCOMTim &tim)
Copy class members.
void save(const GFilename &filename, const bool &clobber=false) const
Save Good Time Intervals into FITS file.
void load(const GFilename &filename, const std::string &usage="YES", const std::string &mode="NORMAL|SOLAR80|LOW")
Load COMPTEL Good Time Intervals from FITS file.
virtual GCOMTim * clone(void) const
Clone COMPTEL good time intervals.
std::vector< std::string > m_mode
Mode string.
std::string url(void) const
Return Uniform Resource Locator (URL)
const std::string & extname(void) const
Return extension name.
Abstract interface for FITS table column.
virtual int integer(const int &row, const int &inx=0) const =0
virtual std::string string(const int &row, const int &inx=0) const =0
void unit(const std::string &unit)
Set column unit.
FITS table string column.
FITS table unsigned long integer column.
Abstract interface for FITS table.
GFitsTableCol * append(const GFitsTableCol &column)
Append column to the table.
const int & nrows(void) const
Return number of rows in table.
void saveto(const GFilename &filename, const bool &clobber=false)
Saves to specified FITS file.
GFitsHDU * append(const GFitsHDU &hdu)
Append HDU to FITS file.
void close(void)
Close FITS file.
GFitsTable * table(const int &extno)
Get pointer to table HDU.
Good Time Interval class.
const double & telapse(void) const
Returns elapsed time.
const GTime & tstop(void) const
Returns latest stop time in Good Time Intervals.
int size(void) const
Return number of Good Time Intervals.
const double & ontime(void) const
Returns ontime.
void append(const GTime &tstart, const GTime &tstop)
Append Good Time Interval.
const GTime & tstart(void) const
Returns earliest start time in Good Time Intervals.
void clear(void)
Clear Good Time Intervals.
double mjd(void) const
Return time in Modified Julian Days (TT)
std::string utc(const int &precision=0) const
Return time as string in UTC time system.
std::string parformat(const std::string &s, const int &indent=0)
Convert string in parameter format.
std::string str(const unsigned short int &value)
Convert unsigned short integer value into string.
std::string strip_whitespace(const std::string &arg)
Strip leading and trailing whitespace from string.
int com_tics(const GTime &time)
Convert GTime in COMPTEL tics.
std::vector< std::string > split(const std::string &s, const std::string &sep)
Split string.
int com_tjd(const GTime &time)
Convert GTime in COMPTEL TJD.
GTime com_time(const int &tjd, const int &tics)
Convert TJD and COMPTEL tics in GTime object.