GammaLib  1.7.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...
 
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 58 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 73 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 91 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 114 of file GCOMTim.cpp.

References init_members(), and load().

GCOMTim::~GCOMTim ( void  )
virtual

Destructor.

Definition at line 132 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 98 of file GCOMTim.hpp.

void GCOMTim::clear ( void  )
virtual

Clear COMPTEL good time intervals.

Implements GBase.

Definition at line 184 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 202 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 113 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 472 of file GCOMTim.cpp.

References m_gti.

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

void GCOMTim::free_members ( void  )
protected

Delete class members.

Definition at line 485 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 127 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 141 of file GCOMTim.hpp.

References gti(), and m_gti.

void GCOMTim::init_members ( void  )
protected

Initialise class members.

Definition at line 457 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 217 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 154 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 404 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 279 of file GCOMTim.cpp.

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

Referenced by load().

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 246 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 339 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 88 of file GCOMTim.hpp.

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


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