|
GammaLib 2.2.0.dev
|
COSI event list class. More...
#include <GCOSEventList.hpp>
Public Member Functions | |
| GCOSEventList (void) | |
| Void constructor. | |
| GCOSEventList (const GFilename &filename) | |
| File name constructor. | |
| GCOSEventList (const GCOSEventList &list) | |
| Copy constructor. | |
| virtual | ~GCOSEventList (void) |
| Destructor. | |
| virtual GCOSEventList & | operator= (const GCOSEventList &list) |
| Assignment operator. | |
| virtual GCOSEventAtom * | operator[] (const int &index) |
| COSI event atom access operator. | |
| virtual const GCOSEventAtom * | operator[] (const int &index) const |
| COSI event atom access operator. | |
| virtual void | clear (void) |
| Clear COSI event list. | |
| virtual GCOSEventList * | clone (void) const |
| Clone event list. | |
| virtual std::string | classname (void) const |
| Return class name. | |
| virtual int | size (void) const |
| Return number of events in list. | |
| virtual void | load (const GFilename &filename) |
| Load COSI events from FITS file. | |
| virtual void | save (const GFilename &filename, const bool &clobber=false) const |
| Save COSI events. | |
| virtual void | read (const GFits &fits) |
| Read COSI events from FITS file. | |
| virtual void | write (GFits &fits) const |
| Write COSI event list into FITS file. | |
| virtual double | number (void) const |
| Return number of events in list. | |
| virtual void | roi (const GRoi &roi) |
| Set region of interest. | |
| virtual const GCOSRoi & | roi (void) const |
| Return Region of Interest. | |
| virtual std::string | print (const GChatter &chatter=NORMAL) const |
| Print COSI event list information. | |
| void | append (const GCOSEventAtom &event) |
| Append event to event list. | |
| void | extend (const GCOSEventList &list) |
| Extend event list with another event list. | |
| void | reserve (const int &number) |
| Reserves space for events. | |
| void | remove (const int &index, const int &number=1) |
| Remove events from event list. | |
| void | sort (void) |
| Sort events by increasing time. | |
Public Member Functions inherited from GEventList | |
| GEventList (void) | |
| Void constructor. | |
| GEventList (const GEventList &list) | |
| Copy constructor. | |
| virtual | ~GEventList (void) |
| Destructor. | |
| virtual GEventList & | operator= (const GEventList &list) |
| Assignment operator. | |
Public Member Functions inherited from GEvents | |
| GEvents (void) | |
| Void constructor. | |
| GEvents (const GEvents &events) | |
| Copy constructor. | |
| virtual | ~GEvents (void) |
| Destructor. | |
| virtual GEvents & | operator= (const GEvents &events) |
| Assignment operator. | |
| void | ebounds (const GEbounds &ebounds) |
| Set energy boundaries. | |
| void | gti (const GGti >i) |
| Set Good Time Intervals. | |
| const GEbounds & | ebounds (void) const |
| Return energy boundaries. | |
| const GGti & | gti (void) const |
| Return Good Time Intervals. | |
| const GTime & | tstart (void) const |
| Return start time. | |
| const GTime & | tstop (void) const |
| Return stop time. | |
| const GEnergy & | emin (void) const |
| Return minimum energy. | |
| const GEnergy & | emax (void) const |
| Return maximum energy. | |
Public Member Functions inherited from GBase | |
| virtual | ~GBase (void) |
| Destructor. | |
Protected Member Functions | |
| void | init_members (void) |
| Initialise class members. | |
| void | copy_members (const GCOSEventList &list) |
| Copy class members. | |
| void | free_members (void) |
| Delete class members. | |
| virtual void | set_energies (void) |
| Set energies. | |
| virtual void | set_times (void) |
| Set times. | |
Protected Member Functions inherited from GEventList | |
| void | init_members (void) |
| Initialise class members. | |
| void | copy_members (const GEventList &list) |
| Copy class members. | |
| void | free_members (void) |
| Delete class members. | |
Protected Member Functions inherited from GEvents | |
| void | init_members (void) |
| Initialise class members. | |
| void | copy_members (const GEvents &events) |
| Copy class members. | |
| void | free_members (void) |
| Delete class members. | |
Protected Attributes | |
| GCOSRoi | m_roi |
| Region of interest. | |
| std::vector< GCOSEventAtom > | m_events |
| Events. | |
Protected Attributes inherited from GEvents | |
| GEbounds | m_ebounds |
| Energy boundaries covered by events. | |
| GGti | m_gti |
| Good time intervals covered by events. | |
COSI event list class.
Definition at line 50 of file GCOSEventList.hpp.
| GCOSEventList::GCOSEventList | ( | void | ) |
Void constructor.
Creates an empty COSI event list.
Definition at line 63 of file GCOSEventList.cpp.
References init_members().
Referenced by clone().
|
explicit |
File name constructor.
| [in] | filename | COSI event list filename. |
Construct COSI event list object by loading the events from a FITS file.
Definition at line 81 of file GCOSEventList.cpp.
References init_members(), and load().
| GCOSEventList::GCOSEventList | ( | const GCOSEventList & | list | ) |
Copy constructor.
| [in] | list | COSI event list. |
Definition at line 99 of file GCOSEventList.cpp.
References copy_members(), and init_members().
|
virtual |
| void GCOSEventList::append | ( | const GCOSEventAtom & | event | ) |
Append event to event list.
| [in] | event | Event. |
Appends an event to the end of the event list.
Definition at line 567 of file GCOSEventList.cpp.
References m_events.
|
inlinevirtual |
Return class name.
Implements GEventList.
Definition at line 106 of file GCOSEventList.hpp.
|
virtual |
Clear COSI event list.
Clears COSI event list by resetting all class members to an initial state. Any information that was present before will be lost.
Implements GEventList.
Definition at line 223 of file GCOSEventList.cpp.
References free_members(), GEventList::free_members(), GEvents::free_members(), init_members(), GEventList::init_members(), and GEvents::init_members().
Referenced by read().
|
virtual |
Clone event list.
Implements GEventList.
Definition at line 245 of file GCOSEventList.cpp.
References GCOSEventList().
|
protected |
Copy class members.
| [in] | list | COSI event list. |
Definition at line 732 of file GCOSEventList.cpp.
References m_events, and m_roi.
Referenced by GCOSEventList(), and operator=().
| void GCOSEventList::extend | ( | const GCOSEventList & | list | ) |
Extend event list with another event list.
| [in] | list | Event list. |
Extend event list with another event list. All events of list are appended after the existing events. If a sorted event list is required then call the sort() method after this method.
Definition at line 586 of file GCOSEventList.cpp.
|
protected |
Delete class members.
Definition at line 746 of file GCOSEventList.cpp.
Referenced by clear(), operator=(), and ~GCOSEventList().
|
protected |
Initialise class members.
Definition at line 716 of file GCOSEventList.cpp.
References GCOSRoi::clear(), m_events, and m_roi.
Referenced by clear(), GCOSEventList(), GCOSEventList(), GCOSEventList(), and operator=().
|
virtual |
Load COSI events from FITS file.
| [in] | filename | COSI event list FITS file name. |
Loads COSI events from a FITS file into the event list.
Implements GEventList.
Definition at line 258 of file GCOSEventList.cpp.
References GFits::close(), and read().
Referenced by GCOSEventList().
|
inlinevirtual |
Return number of events in list.
Implements GEventList.
Definition at line 130 of file GCOSEventList.hpp.
References m_events.
|
virtual |
Assignment operator.
| [in] | list | COSI event list. |
Definition at line 137 of file GCOSEventList.cpp.
References copy_members(), free_members(), init_members(), and GEventList::operator=().
|
virtual |
COSI event atom access operator.
| [in] | index | Event index [0,...,size()-1]. |
| GException::out_of_range | Event index outside valid range. |
Returns pointer to a COSI event atom.
Implements GEventList.
Definition at line 172 of file GCOSEventList.cpp.
References G_OPERATOR, m_events, and size().
|
virtual |
COSI event atom access operator.
| [in] | index | Event index [0,...,size()-1]. |
| GException::out_of_range | Event index outside valid range. |
Returns pointer to a COSI event atom.
Implements GEventList.
Definition at line 197 of file GCOSEventList.cpp.
References G_OPERATOR, m_events, and size().
Print COSI event list information.
| [in] | chatter | Chattiness. |
Implements GEventList.
Definition at line 660 of file GCOSEventList.cpp.
References GEvents::ebounds(), GEvents::emax(), GEvents::emin(), GEvents::gti(), number(), gammalib::parformat(), SILENT, size(), gammalib::str(), GEvents::tstart(), and GEvents::tstop().
|
virtual |
Read COSI events from FITS file.
| [in] | fits | FITS file. |
| GException::invalid_value | Invalid data space keyword formatting encountered |
Read the COSI event list from a FITS file object.
Implements GEventList.
Definition at line 312 of file GCOSEventList.cpp.
References clear(), GFits::contains(), gammalib::cos_time(), GEvents::emax(), GEvents::emin(), gammalib::extname_gti, G_READ, GEvents::gti(), GFitsHDU::has_card(), GEnergy::keV(), GSkyDir::lb_deg(), GEvents::m_ebounds, m_events, GEvents::m_gti, m_roi, GFitsTable::nrows(), gammalib::rad2deg, GSkyDir::radec(), GCOSRoi::radius(), GGti::read(), GFitsTableCol::real(), gammalib::replace_segment(), gammalib::rstrip_chars(), gammalib::split(), GFitsHDU::string(), GFits::table(), and gammalib::todouble().
Referenced by load().
| void GCOSEventList::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 620 of file GCOSEventList.cpp.
|
inline |
Reserves space for events.
| [in] | number | Number of events. |
Reserves space for a number events in the event list.
Definition at line 156 of file GCOSEventList.hpp.
References m_events, and number().
Referenced by extend().
|
virtual |
Set region of interest.
| [in] | roi | Region of interest. |
| GException::invalid_argument | Specified RoI is not a COSI RoI. |
Sets the region of interest for the observation.
Implements GEventList.
Definition at line 540 of file GCOSEventList.cpp.
|
inlinevirtual |
Return Region of Interest.
Implements GEventList.
Definition at line 142 of file GCOSEventList.hpp.
References m_roi.
Referenced by roi().
|
virtual |
Save COSI events.
| [in] | filename | COSI event list FITS file name. |
| [in] | clobber | Overwrite existing FITS file? |
Save COSI events into a FITS file.
Implements GEventList.
Definition at line 282 of file GCOSEventList.cpp.
References GFits::close(), GFits::saveto(), and write().
|
inlineprotectedvirtual |
Set energies.
Sets energies.
Implements GEventList.
Definition at line 169 of file GCOSEventList.hpp.
|
inlineprotectedvirtual |
|
inlinevirtual |
Return number of events in list.
Implements GEventList.
Definition at line 118 of file GCOSEventList.hpp.
References m_events.
Referenced by extend(), GCOSEventCube::fill(), operator[](), operator[](), print(), remove(), and write().
| void GCOSEventList::sort | ( | void | ) |
Sort events by increasing time.
Sorts the events in the event list by increasing time value.
Definition at line 644 of file GCOSEventList.cpp.
References m_events.
|
virtual |
Write COSI event list into FITS file.
| [in] | fits | FITS file. |
Write the COSI event list into FITS file.
Implements GEventList.
Definition at line 454 of file GCOSEventList.cpp.
References GFits::append(), GFitsTable::append(), GFitsHDU::card(), gammalib::cos_seconds(), gammalib::deg2rad, GEvents::emax(), GEvents::emin(), GFitsHDU::extname(), gammalib::extname_gti, GEvents::gti(), m_events, m_roi, GCOSRoi::radius(), size(), gammalib::str(), GFitsTableCol::unit(), and GGti::write().
Referenced by save().
|
protected |
Events.
Definition at line 96 of file GCOSEventList.hpp.
Referenced by append(), copy_members(), extend(), init_members(), number(), operator[](), operator[](), read(), remove(), reserve(), size(), sort(), and write().
|
protected |
Region of interest.
Definition at line 95 of file GCOSEventList.hpp.
Referenced by copy_members(), init_members(), read(), roi(), roi(), and write().