GammaLib  2.1.0.dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GCOMTim Class Reference

COMPTEL Good Time Intervals class. More...

#include <GCOMTim.hpp>

Inheritance diagram for GCOMTim:
GBase

Public Member Functions

 GCOMTim (void)
 Void constructor. More...
 
 GCOMTim (const GGti &gti)
 Good Time Interval constructor. More...
 
 GCOMTim (const GCOMTim &tim)
 Copy constructor. More...
 
 GCOMTim (const GFilename &filename, const std::string &usage="YES", const std::string &mode="NORMAL")
 File name constructor. More...
 
virtual ~GCOMTim (void)
 Destructor. More...
 
GCOMTimoperator= (const GCOMTim &tim)
 Assignment operator. More...
 
virtual void clear (void)
 Clear COMPTEL good time intervals. More...
 
virtual GCOMTimclone (void) const
 Clone COMPTEL good time intervals. More...
 
virtual std::string classname (void) const
 Return class name. More...
 
virtual std::string print (const GChatter &chatter=NORMAL) const
 Print COMPTEL Good Time Intervals. More...
 
bool contains (const GTime &time) const
 Check if time is comprised in the Good Time Intervals. More...
 
void reduce (const GGti &gti)
 Reduces Good Time Intervals to intersection with intervals. More...
 
const GGtigti (void) const
 Return Good Time Intervals. More...
 
void gti (const GGti &gti)
 Set Good Time Intervals. More...
 
void load (const GFilename &filename, const std::string &usage="YES", const std::string &mode="NORMAL")
 Load COMPTEL Good Time Intervals from FITS file. More...
 
void save (const GFilename &filename, const bool &clobber=false) const
 Save Good Time Intervals into FITS file. More...
 
void read (const GFitsTable &table, const std::string &usage="YES", const std::string &mode="NORMAL")
 Read COMPTEL Good Time Intervals from FITS table. More...
 
void write (GFitsBinTable &table) const
 Write COMPTEL Good Time Intervals into FITS binary table. More...
 
- Public Member Functions inherited from GBase
virtual ~GBase (void)
 Destructor. More...
 

Protected Member Functions

void init_members (void)
 Initialise class members. More...
 
void copy_members (const GCOMTim &tim)
 Copy class members. More...
 
void free_members (void)
 Delete class members. More...
 

Protected Attributes

GGti m_gti
 Good Time intervals. More...
 

Detailed Description

COMPTEL Good Time Intervals class.

Todo:
Add class description.

Definition at line 50 of file GCOMTim.hpp.

Constructor & Destructor Documentation

GCOMTim::GCOMTim ( void  )

Void constructor.

Definition at line 59 of file GCOMTim.cpp.

References init_members().

Referenced by clone().

GCOMTim::GCOMTim ( const GGti gti)
explicit

Good Time Interval constructor.

Parameters
[in]gtiGood Time Intervals.

Definition at line 74 of file GCOMTim.cpp.

References gti(), init_members(), and m_gti.

GCOMTim::GCOMTim ( const GCOMTim tim)

Copy constructor.

Parameters
[in]timCOMPTEL Good Time Intervals.

Definition at line 92 of file GCOMTim.cpp.

References copy_members(), and init_members().

GCOMTim::GCOMTim ( const GFilename filename,
const std::string &  usage = "YES",
const std::string &  mode = "NORMAL" 
)

File name constructor.

Parameters
[in]filenameTIM file name.
[in]usageUsage selection (blank: accept all usage strings).
[in]modeMode selection (blank: accept all mode strings).

Constructs COMPTEL Good Time Intervals from the information in a TIM FITS file.

Definition at line 115 of file GCOMTim.cpp.

References init_members(), and load().

GCOMTim::~GCOMTim ( void  )
virtual

Destructor.

Definition at line 133 of file GCOMTim.cpp.

References free_members().

Member Function Documentation

std::string GCOMTim::classname ( void  ) const
inlinevirtual

Return class name.

Returns
String containing the class name ("GCOMTim").

Implements GBase.

Definition at line 99 of file GCOMTim.hpp.

void GCOMTim::clear ( void  )
virtual

Clear COMPTEL good time intervals.

Implements GBase.

Definition at line 185 of file GCOMTim.cpp.

References free_members(), and init_members().

Referenced by GCOMObservation::init_members(), and read().

GCOMTim * GCOMTim::clone ( void  ) const
virtual

Clone COMPTEL good time intervals.

Returns
Pointer to deep copy of COMPTEL Good Time Intervals.

Implements GBase.

Definition at line 203 of file GCOMTim.cpp.

References GCOMTim().

bool GCOMTim::contains ( const GTime time) const
inline

Check if time is comprised in the Good Time Intervals.

Parameters
[in]timeTime.
Returns
True if time is within Good Time Intervals, false otherwise.

Checks if a time is comprised in the Good Time Intervals.

Definition at line 114 of file GCOMTim.hpp.

References GGti::contains(), and m_gti.

Referenced by GCOMDri::use_superpacket().

void GCOMTim::copy_members ( const GCOMTim tim)
protected

Copy class members.

Parameters
[in]timCOMPTEL Good Time Intervals.

Definition at line 476 of file GCOMTim.cpp.

References m_gti.

Referenced by GCOMTim(), and operator=().

void GCOMTim::free_members ( void  )
protected

Delete class members.

Definition at line 489 of file GCOMTim.cpp.

Referenced by clear(), operator=(), and ~GCOMTim().

const GGti & GCOMTim::gti ( void  ) const
inline

Return Good Time Intervals.

Returns
Good Time Intervals.

Returns the Good Time Intervals.

Definition at line 144 of file GCOMTim.hpp.

References m_gti.

Referenced by GCOMTim(), gti(), GCOMObservation::load(), and GCOMObservation::print().

void GCOMTim::gti ( const GGti gti)
inline

Set Good Time Intervals.

Parameters
[in]gtiGood Time Intervals.

Sets the Good Time Intervals.

Definition at line 158 of file GCOMTim.hpp.

References gti(), and m_gti.

void GCOMTim::init_members ( void  )
protected

Initialise class members.

Definition at line 461 of file GCOMTim.cpp.

References GGti::clear(), and m_gti.

Referenced by clear(), GCOMTim(), and operator=().

void GCOMTim::load ( const GFilename filename,
const std::string &  usage = "YES",
const std::string &  mode = "NORMAL" 
)

Load COMPTEL Good Time Intervals from FITS file.

Parameters
[in]filenameTIM file name.
[in]usageUsage selection (blank: accept all usage strings).
[in]modeMode selection (blank: accept all mode strings).

Load COMPTEL Good Time Intervals from the information in a TIM FITS file.

Definition at line 218 of file GCOMTim.cpp.

References GFits::close(), read(), and GFits::table().

Referenced by GCOMTim(), and GCOMObservation::load().

GCOMTim & GCOMTim::operator= ( const GCOMTim tim)

Assignment operator.

Parameters
[in]timCOMPTEL Good Time Intervals.
Returns
COMPTEL Good Time Intervals.

Definition at line 155 of file GCOMTim.cpp.

References copy_members(), free_members(), and init_members().

std::string GCOMTim::print ( const GChatter chatter = NORMAL) const
virtual

Print COMPTEL Good Time Intervals.

Parameters
[in]chatterChattiness.
Returns
String containing COMPTEL Good Time Intervals information.

Implements GBase.

Definition at line 408 of file GCOMTim.cpp.

References gammalib::com_tics(), gammalib::com_tjd(), m_gti, GTime::mjd(), GGti::ontime(), gammalib::parformat(), SILENT, GGti::size(), gammalib::str(), GGti::telapse(), GGti::tstart(), GGti::tstop(), and GTime::utc().

Referenced by GCOMObservation::print().

void GCOMTim::read ( const GFitsTable table,
const std::string &  usage = "YES",
const std::string &  mode = "NORMAL" 
)

Read COMPTEL Good Time Intervals from FITS table.

Parameters
[in]tableTIM FITS table.
[in]usageUsage selection (blank: accept all usage strings).
[in]modeMode selection (blank: accept all mode strings).

Reads COMPTEL Good Time Intervals from the information in a TIM FITS table.

Definition at line 280 of file GCOMTim.cpp.

References clear(), gammalib::com_time(), GGti::insert(), GFitsTableCol::integer(), m_gti, GGti::merge(), GFitsTable::nrows(), and GFitsTableCol::string().

Referenced by load().

void GCOMTim::reduce ( const GGti gti)
inline

Reduces Good Time Intervals to intersection with intervals.

Parameters
[in]gtiGood Time Intervals.

Reduces the Good Time Intervals to the intersection with the specified list of Good Time Intervals.

Definition at line 129 of file GCOMTim.hpp.

References m_gti, and GGti::reduce().

Referenced by GCOMDri::compute_dre(), GCOMDri::compute_drg(), GCOMDri::compute_drx(), GCOMDris::vetorate_generate(), and GCOMDris::vetorate_setup().

void GCOMTim::save ( const GFilename filename,
const bool &  clobber = false 
) const

Save Good Time Intervals into FITS file.

Parameters
[in]filenameFITS file name.
[in]clobberOverwrite existing FITS file.

Saves the event list into a FITS file. See the write() method for details.

Definition at line 247 of file GCOMTim.cpp.

References GFits::append(), GFits::saveto(), GFilename::url(), and write().

void GCOMTim::write ( GFitsBinTable table) const

Write COMPTEL Good Time Intervals into FITS binary table.

Parameters
[in]tableTIM FITS table.

Writes COMPTEL Good Time Intervals from the information in a TIM FITS binary table.

Definition at line 343 of file GCOMTim.cpp.

References GFitsTable::append(), gammalib::com_tics(), gammalib::com_tjd(), GFitsHDU::extname(), m_gti, GGti::size(), GGti::tstart(), GGti::tstop(), and GFitsTableCol::unit().

Referenced by save().

Member Data Documentation

GGti GCOMTim::m_gti
protected

Good Time intervals.

Definition at line 89 of file GCOMTim.hpp.

Referenced by contains(), copy_members(), GCOMTim(), gti(), init_members(), print(), read(), reduce(), and write().


The documentation for this class was generated from the following files: