GammaLib 2.0.0
Loading...
Searching...
No Matches
GCOMTim Class Reference

COMPTEL Good Time Intervals class. More...

#include <GCOMTim.hpp>

Inheritance diagram for GCOMTim:
GBase

Public Member Functions

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

Protected Member Functions

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

Protected Attributes

GGti m_gti
 Good Time intervals.
 

Detailed Description

COMPTEL Good Time Intervals class.

Todo
Add class description.

Definition at line 50 of file GCOMTim.hpp.

Constructor & Destructor Documentation

◆ GCOMTim() [1/4]

GCOMTim::GCOMTim ( void )

Void constructor.

Definition at line 59 of file GCOMTim.cpp.

References init_members().

Referenced by clone().

◆ GCOMTim() [2/4]

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() [3/4]

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() [4/4]

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::~GCOMTim ( void )
virtual

Destructor.

Definition at line 133 of file GCOMTim.cpp.

References free_members().

Member Function Documentation

◆ classname()

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.

◆ clear()

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().

◆ clone()

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().

◆ contains()

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().

◆ copy_members()

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=().

◆ free_members()

void GCOMTim::free_members ( void )
protected

Delete class members.

Definition at line 489 of file GCOMTim.cpp.

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

◆ gti() [1/2]

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.

◆ gti() [2/2]

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(), GCOMObservation::print(), and reduce().

◆ init_members()

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(), GCOMTim(), GCOMTim(), GCOMTim(), and operator=().

◆ load()

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().

◆ operator=()

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().

◆ print()

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().

◆ read()

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().

◆ reduce()

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 gti(), m_gti, and GGti::reduce().

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

◆ save()

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().

◆ 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

◆ m_gti

GGti GCOMTim::m_gti
protected

Good Time intervals.

Definition at line 89 of file GCOMTim.hpp.

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


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