GammaLib
2.1.0.dev
|
Fermi/LAT event list class. More...
#include <GLATEventList.hpp>
Public Member Functions | |
GLATEventList (void) | |
Void constructor. More... | |
GLATEventList (const GFilename &filename) | |
File name constructor. More... | |
GLATEventList (const GLATEventList &list) | |
Copy constructor. More... | |
virtual | ~GLATEventList (void) |
Destructor. More... | |
virtual GLATEventList & | operator= (const GLATEventList &list) |
Assignment operator. More... | |
virtual GLATEventAtom * | operator[] (const int &index) |
Event atom access operator. More... | |
virtual const GLATEventAtom * | operator[] (const int &index) const |
Event atom access operator. More... | |
virtual void | clear (void) |
Clear event list. More... | |
virtual GLATEventList * | clone (void) const |
Clone event list. More... | |
virtual std::string | classname (void) const |
Return class name. More... | |
virtual int | size (void) const |
Return number of events in list. More... | |
virtual void | load (const GFilename &filename) |
Load LAT events from FITS file. More... | |
virtual void | save (const GFilename &filename, const bool &clobber=false) const |
Save LAT events. More... | |
virtual void | read (const GFits &file) |
Read LAT events from FITS file. More... | |
virtual void | write (GFits &file) const |
Write LAT event list into FITS file. More... | |
virtual int | number (void) const |
Return number of events in list. More... | |
virtual void | roi (const GRoi &roi) |
Set Region of Interest. More... | |
virtual const GLATRoi & | roi (void) const |
Return Region of Interest. More... | |
virtual std::string | print (const GChatter &chatter=NORMAL) const |
Print event list information. More... | |
void | append (const GLATEventAtom &event) |
Append event to event list. More... | |
void | reserve (const int &number) |
Reserves space for events. More... | |
void | remove (const int &index, const int &number=1) |
Remove events from event list. More... | |
Public Member Functions inherited from GEventList | |
GEventList (void) | |
Void constructor. More... | |
GEventList (const GEventList &list) | |
Copy constructor. More... | |
virtual | ~GEventList (void) |
Destructor. More... | |
virtual GEventList & | operator= (const GEventList &list) |
Assignment operator. More... | |
Public Member Functions inherited from GEvents | |
GEvents (void) | |
Void constructor. More... | |
GEvents (const GEvents &events) | |
Copy constructor. More... | |
virtual | ~GEvents (void) |
Destructor. More... | |
virtual GEvents & | operator= (const GEvents &events) |
Assignment operator. More... | |
void | ebounds (const GEbounds &ebounds) |
Set energy boundaries. More... | |
void | gti (const GGti >i) |
Set Good Time Intervals. More... | |
const GEbounds & | ebounds (void) const |
Return energy boundaries. More... | |
const GGti & | gti (void) const |
Return Good Time Intervals. More... | |
const GTime & | tstart (void) const |
Return start time. More... | |
const GTime & | tstop (void) const |
Return stop time. More... | |
const GEnergy & | emin (void) const |
Return minimum energy. More... | |
const GEnergy & | emax (void) const |
Return maximum energy. 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 GLATEventList &list) |
Copy class members. More... | |
void | free_members (void) |
Delete class members. More... | |
virtual void | set_energies (void) |
virtual void | set_times (void) |
void | read_events (const GFitsTable &hdu) |
Read LAT events from FITS table. More... | |
void | read_ds_keys (const GFitsHDU &hdu) |
Read data selection keywords from FITS HDU. More... | |
Protected Member Functions inherited from GEventList | |
void | init_members (void) |
Initialise class members. More... | |
void | copy_members (const GEventList &list) |
Copy class members. More... | |
void | free_members (void) |
Delete class members. More... | |
Protected Member Functions inherited from GEvents | |
void | init_members (void) |
Initialise class members. More... | |
void | copy_members (const GEvents &events) |
Copy class members. More... | |
void | free_members (void) |
Delete class members. More... | |
Protected Attributes | |
GLATRoi | m_roi |
Region of interest. More... | |
std::vector< GLATEventAtom > | m_events |
Events. More... | |
std::vector< std::string > | m_difrsp_label |
Diffuse response model labels. More... | |
std::vector< std::string > | m_ds_type |
Data selection types. More... | |
std::vector< std::string > | m_ds_unit |
Data selection units. More... | |
std::vector< std::string > | m_ds_value |
Data selection values. More... | |
std::vector< std::string > | m_ds_reference |
Data selection references. More... | |
Protected Attributes inherited from GEvents | |
GEbounds | m_ebounds |
Energy boundaries covered by events. More... | |
GGti | m_gti |
Good time intervals covered by events. More... | |
Fermi/LAT event list class.
Definition at line 54 of file GLATEventList.hpp.
GLATEventList::GLATEventList | ( | void | ) |
Void constructor.
Definition at line 63 of file GLATEventList.cpp.
References init_members().
Referenced by clone().
|
explicit |
File name constructor.
[in] | filename | Event list filename. |
Construct event list object by loading the events from a FITS file.
Definition at line 80 of file GLATEventList.cpp.
References init_members(), and load().
GLATEventList::GLATEventList | ( | const GLATEventList & | list | ) |
Copy constructor.
[in] | list | LAT event list. |
Definition at line 98 of file GLATEventList.cpp.
References copy_members(), and init_members().
|
virtual |
void GLATEventList::append | ( | const GLATEventAtom & | event | ) |
Append event to event list.
[in] | event | Event. |
Appends an event to the end of the event list.
Definition at line 396 of file GLATEventList.cpp.
References m_events.
|
inlinevirtual |
Return class name.
Implements GEventList.
Definition at line 115 of file GLATEventList.hpp.
|
virtual |
Clear event list.
Implements GEventList.
Definition at line 217 of file GLATEventList.cpp.
References GEventList::free_members(), free_members(), GEvents::free_members(), GEventList::init_members(), init_members(), and GEvents::init_members().
Referenced by read().
|
virtual |
Clone event list.
Implements GEventList.
Definition at line 239 of file GLATEventList.cpp.
References GLATEventList().
|
protected |
Copy class members.
[in] | list | LAT event list. |
Definition at line 516 of file GLATEventList.cpp.
References m_difrsp_label, m_ds_reference, m_ds_type, m_ds_unit, m_ds_value, m_events, and m_roi.
Referenced by GLATEventList(), and operator=().
|
protected |
Delete class members.
Definition at line 535 of file GLATEventList.cpp.
Referenced by clear(), operator=(), and ~GLATEventList().
|
protected |
Initialise class members.
Definition at line 495 of file GLATEventList.cpp.
References GLATRoi::clear(), m_difrsp_label, m_ds_reference, m_ds_type, m_ds_unit, m_ds_value, m_events, and m_roi.
Referenced by clear(), GLATEventList(), and operator=().
|
virtual |
Load LAT events from FITS file.
[in] | filename | FITS filename. |
This method loads LAT events from a FT1 file.
Implements GEventList.
Definition at line 252 of file GLATEventList.cpp.
References GFits::close(), and read().
Referenced by GLATEventList().
|
inlinevirtual |
Return number of events in list.
Implements GEventList.
Definition at line 139 of file GLATEventList.hpp.
References m_events.
|
virtual |
Assignment operator.
[in] | list | Fermi/LAT event list. |
Definition at line 136 of file GLATEventList.cpp.
References copy_members(), free_members(), init_members(), and GEventList::operator=().
|
virtual |
Event atom access operator.
[in] | index | Event index [0,...,size()-1]. |
GException::out_of_range | Event index outside valid range. |
Returns pointer to an event atom.
Implements GEventList.
Definition at line 170 of file GLATEventList.cpp.
References G_OPERATOR, m_events, and size().
|
virtual |
Event atom access operator.
[in] | index | Event index [0,...,size()-1]. |
GException::out_of_range | Event index outside valid range. |
Returns pointer to an event atom.
Implements GEventList.
Definition at line 194 of file GLATEventList.cpp.
References G_OPERATOR, m_events, and size().
Print event list information.
[in] | chatter | Chattiness. |
Implements GEventList.
Definition at line 442 of file GLATEventList.cpp.
References m_difrsp_label, m_ds_reference, m_ds_type, m_ds_unit, number(), gammalib::parformat(), SILENT, and gammalib::str().
|
virtual |
Read LAT events from FITS file.
[in] | file | FITS file. |
This method read the LAT event list from a FITS file.
The method clears the object before loading, thus any events residing in the object before loading will be lost.
Implements GEventList.
Definition at line 296 of file GLATEventList.cpp.
References GGti::append(), clear(), GFits::contains(), gammalib::extname_gti, gammalib::extname_lat_events, GEvents::gti(), GEvents::m_gti, GGti::read(), read_ds_keys(), read_events(), GFitsHDU::real(), GGti::reference(), GFits::table(), GEvents::tstart(), and GEvents::tstop().
Referenced by load(), and GLATObservation::load_unbinned().
|
protected |
Read data selection keywords from FITS HDU.
[in] | hdu | FITS HDU pointer. |
Declared header card const in to GFitsHDU.
Add check key method to GFitsHDU to avoid unneccesary try/catch blocks.
Definition at line 661 of file GLATEventList.cpp.
References GFitsHDU::has_card(), GFitsHDU::integer(), m_ds_reference, m_ds_type, m_ds_unit, m_ds_value, and GFitsHDU::string().
Referenced by read().
|
protected |
Read LAT events from FITS table.
[in] | table | Event table. |
Read the LAT events from the event table.
Definition at line 549 of file GLATEventList.cpp.
References GFitsHDU::has_card(), GFitsTableCol::integer(), GFitsHDU::integer(), m_difrsp_label, m_events, GEvents::m_gti, GLATEventAtom::m_time, GFitsTableCol::real(), GGti::reference(), GTime::set(), and GFitsHDU::string().
Referenced by read().
void GLATEventList::remove | ( | const int & | index, |
const int & | number = 1 |
||
) |
Remove events from event list.
[in] | index | Index from which on events should be removed. |
[in] | number | Number of event to remove (default: 1). |
Removes events from the event list. This method does nothing if index
points beyond the event list. The method does also gently accept number
arguments where index
+ number
reach beyond the event list. In that case, all events from event index
on will be removed.
Definition at line 417 of file GLATEventList.cpp.
|
inline |
Reserves space for events.
[in] | number | Number of events. |
Reserves space for number events in the event list.
Definition at line 165 of file GLATEventList.hpp.
References m_events.
|
virtual |
Set Region of Interest.
[in] | roi | Region of Interest. |
GException::invalid_argument | Region of Interest roi in not a LAT Region of Interest. |
Implements GEventList.
Definition at line 368 of file GLATEventList.cpp.
|
inlinevirtual |
Return Region of Interest.
Implements GEventList.
Definition at line 151 of file GLATEventList.hpp.
References m_roi.
Referenced by roi().
|
virtual |
Save LAT events.
[in] | filename | FITS filename. |
[in] | clobber | Overwrite existing FITS file (default=false). |
This method saves LAT events into a FT1 file.
Implements GEventList.
Definition at line 278 of file GLATEventList.cpp.
|
inlineprotectedvirtual |
Implements GEventList.
Definition at line 93 of file GLATEventList.hpp.
|
inlineprotectedvirtual |
Implements GEventList.
Definition at line 94 of file GLATEventList.hpp.
|
inlinevirtual |
Return number of events in list.
Implements GEventList.
Definition at line 127 of file GLATEventList.hpp.
References m_events.
Referenced by operator[](), and remove().
|
virtual |
Write LAT event list into FITS file.
[in] | file | FITS file. |
Write the LAT event list into FITS file.
Implements GEventList.
Definition at line 353 of file GLATEventList.cpp.
|
protected |
Diffuse response model labels.
Definition at line 101 of file GLATEventList.hpp.
Referenced by copy_members(), init_members(), print(), and read_events().
|
protected |
Data selection references.
Definition at line 105 of file GLATEventList.hpp.
Referenced by copy_members(), init_members(), print(), and read_ds_keys().
|
protected |
Data selection types.
Definition at line 102 of file GLATEventList.hpp.
Referenced by copy_members(), init_members(), print(), and read_ds_keys().
|
protected |
Data selection units.
Definition at line 103 of file GLATEventList.hpp.
Referenced by copy_members(), init_members(), print(), and read_ds_keys().
|
protected |
Data selection values.
Definition at line 104 of file GLATEventList.hpp.
Referenced by copy_members(), init_members(), and read_ds_keys().
|
protected |
Events.
Definition at line 100 of file GLATEventList.hpp.
Referenced by append(), copy_members(), init_members(), number(), operator[](), read_events(), remove(), reserve(), and size().
|
protected |
Region of interest.
Definition at line 99 of file GLATEventList.hpp.
Referenced by copy_members(), init_members(), and roi().