GammaLib
2.1.0.dev
|
COMPTEL Solar System Barycentre Data container class. More...
#include <GCOMBvcs.hpp>
Public Member Functions | |
GCOMBvcs (void) | |
Void constructor. More... | |
GCOMBvcs (const GFilename &filename) | |
Filename constructor. More... | |
GCOMBvcs (const GCOMBvcs &bvcs) | |
Copy constructor. More... | |
virtual | ~GCOMBvcs (void) |
Destructor. More... | |
GCOMBvcs & | operator= (const GCOMBvcs &bvcs) |
Assignment operator. More... | |
GCOMBvc & | operator[] (const int &index) |
Return reference to Solar System Barycentre Data. More... | |
const GCOMBvc & | operator[] (const int &index) const |
Return reference to Solar System Barycentre Data (const version) More... | |
void | clear (void) |
Clear COMPTEL Solar System Barycentre Data container. More... | |
GCOMBvcs * | clone (void) const |
Clone COMPTEL Solar System Barycentre Data container. More... | |
std::string | classname (void) const |
Return class name. More... | |
GCOMBvc & | at (const int &index) |
Return reference to Solar System Barycentre Data. More... | |
const GCOMBvc & | at (const int &index) const |
Return reference to Solar System Barycentre Data (const version) More... | |
int | size (void) const |
Return number of Solar System Barycentre Data in container. More... | |
bool | is_empty (void) const |
Signals if there are no Solar System Barycentre Data in container. More... | |
GCOMBvc & | append (const GCOMBvc &bvc) |
Append Solar System Barycentre Data to container. More... | |
GCOMBvc & | insert (const int &index, const GCOMBvc &bvc) |
Insert Solar System Barycentre Data into container. More... | |
void | remove (const int &index) |
Remove Solar System Barycentre Data from container. More... | |
void | reserve (const int &num) |
Reserves space for Solar System Barycentre Data in container. More... | |
void | extend (const GCOMBvcs &bvcs) |
Append Solar System Barycentre Data container. More... | |
void | load (const GFilename &filename) |
Load COMPTEL Solar System Barycentre Data FITS file. More... | |
void | read (const GFitsTable &table) |
Read COMPTEL Solar System Barycentre Data FITS table. More... | |
const GCOMBvc * | find (const GCOMOad &oad) const |
Find Solar System Barycentre Data for Orbit Aspect Data. More... | |
double | tdelta (const GSkyDir &dir, const GTime &time) const |
Return time difference between photon arrival time at CGRO and the Solar System Barycentre (SSB) More... | |
std::string | print (const GChatter &chatter=NORMAL) const |
Print COMPTEL Solar System Barycentre Data container. More... | |
Public Member Functions inherited from GContainer | |
virtual | ~GContainer (void) |
Destructor. 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 GCOMBvcs &bvcs) |
Copy class members. More... | |
void | free_members (void) |
Delete class members. More... | |
Protected Attributes | |
std::vector< GCOMBvc > | m_bvcs |
Solar System Barycentre Data records. More... | |
COMPTEL Solar System Barycentre Data container class.
The COMPTEL Solar System Barycentre Data container class holds records of Solar System Barycentre data that were extracted from one COMPTEL BVC FITS file.
Definition at line 54 of file GCOMBvcs.hpp.
GCOMBvcs::GCOMBvcs | ( | void | ) |
Void constructor.
Constructs an empty COMPTEL Solar System Barycentre Data container
Definition at line 66 of file GCOMBvcs.cpp.
References init_members().
Referenced by clone().
|
explicit |
Filename constructor.
[in] | filename | COMPTEL Solar System Barycentre Data FITS file |
Constructs a COMPTEL Solar System Barycentre Data container from a BVC FITS file.
Definition at line 84 of file GCOMBvcs.cpp.
References init_members(), and load().
GCOMBvcs::GCOMBvcs | ( | const GCOMBvcs & | bvcs | ) |
Copy constructor.
[in] | bvcs | COMPTEL Solar System Barycentre Data container. |
Definition at line 102 of file GCOMBvcs.cpp.
References copy_members(), and init_members().
|
virtual |
Append Solar System Barycentre Data to container.
[in] | bvc | Solar System Barycentre Data. |
Appends Solar System Barycentre Data to the container by making a deep copy of the Solar System Barycentre Data.
Definition at line 252 of file GCOMBvcs.cpp.
GCOMBvc & GCOMBvcs::at | ( | const int & | index | ) |
Return reference to Solar System Barycentre Data.
[in] | index | Solar System Barycentre Data index [0,...,size()-1]. |
GException::out_of_range | Solar System Barycentre Data index is out of range. |
Returns a reference to the Solar System Barycentre Data with the specified index
.
Definition at line 206 of file GCOMBvcs.cpp.
const GCOMBvc & GCOMBvcs::at | ( | const int & | index | ) | const |
Return reference to Solar System Barycentre Data (const version)
[in] | index | Solar System Barycentre Data index [0,...,size()-1]. |
GException::out_of_range | Solar System Barycentre Data index is out of range. |
Returns a reference to the Solar System Barycentre Data with the specified index
.
Definition at line 230 of file GCOMBvcs.cpp.
|
inlinevirtual |
Return class name.
Implements GBase.
Definition at line 104 of file GCOMBvcs.hpp.
|
virtual |
Clear COMPTEL Solar System Barycentre Data container.
Implements GBase.
Definition at line 170 of file GCOMBvcs.cpp.
References free_members(), and init_members().
Referenced by GCOMObservation::init_members(), and read().
|
virtual |
Clone COMPTEL Solar System Barycentre Data container.
Implements GBase.
Definition at line 189 of file GCOMBvcs.cpp.
References GCOMBvcs().
|
protected |
Copy class members.
[in] | bvcs | COMPTEL Solar System Barycentre Data container. |
Definition at line 787 of file GCOMBvcs.cpp.
References m_bvcs.
Referenced by GCOMBvcs(), and operator=().
void GCOMBvcs::extend | ( | const GCOMBvcs & | bvcs | ) |
Append Solar System Barycentre Data container.
[in] | bvcs | COMPTEL Solar System Barycentre Data container. |
Append COMPTEL Solar System Barycentre Data container to the container.
Definition at line 338 of file GCOMBvcs.cpp.
References is_empty(), m_bvcs, reserve(), and size().
Find Solar System Barycentre Data for Orbit Aspect Data.
[in] | oad | Orbit Aspect Data. |
Finds Solar System Barycentre Data that correspond to the specified Orbit Aspect Data. The method returns the Solar System Barycentre Data with the same TJD as the Orbit Aspect Data and the smallest difference in the number of tics.
If this smallest difference is larger than 131072, which is the length of one superpacket, the method returns a NULL pointer.
The method also returns a NULL pointer in case that no matching Solar System Barycentre Data was found.
The client needs to verify the validity of the Solar System Barycentre Data pointer. The client must not deallocate the associated memory.
Definition at line 473 of file GCOMBvcs.cpp.
References abs(), m_bvcs, size(), GCOMOad::tics(), and GCOMOad::tjd().
|
protected |
Delete class members.
Definition at line 800 of file GCOMBvcs.cpp.
Referenced by clear(), operator=(), and ~GCOMBvcs().
|
protected |
Initialise class members.
Definition at line 772 of file GCOMBvcs.cpp.
References m_bvcs.
Referenced by clear(), GCOMBvcs(), and operator=().
Insert Solar System Barycentre Data into container.
[in] | index | Solar System Barycentre Data index (0,...,size()-1). |
[in] | bvc | Solar System Barycentre Data. |
GException::out_of_range | Solar System Barycentre Data index is out of range. |
Inserts Solar System Barycentre Data into the container before the Solar System Barycentre Data with the specified index
.
Definition at line 274 of file GCOMBvcs.cpp.
References G_INSERT, is_empty(), m_bvcs, and size().
|
inlinevirtual |
Signals if there are no Solar System Barycentre Data in container.
Signals if the Solar System Barycentre Data container does not contain any Solar System Barycentre Data.
Implements GContainer.
Definition at line 163 of file GCOMBvcs.hpp.
References m_bvcs.
Referenced by GCOMDri::compute_dre(), extend(), insert(), GCOMObservation::print(), and GCOMObservation::write().
void GCOMBvcs::load | ( | const GFilename & | filename | ) |
Load COMPTEL Solar System Barycentre Data FITS file.
[in] | filename | COMPTEL BVC FITS file name. |
Loads an COMPTEL Solar System Barycentre FITS file in the container.
Definition at line 370 of file GCOMBvcs.cpp.
References GFits::close(), read(), and GFits::table().
Referenced by GCOMBvcs(), and GCOMObservation::load().
Assignment operator.
[in] | bvcs | COMPTEL Solar System Barycentre Data container. |
Definition at line 140 of file GCOMBvcs.cpp.
References copy_members(), free_members(), and init_members().
|
inline |
Return reference to Solar System Barycentre Data.
[in] | index | Solar System Barycentre Data index [0,...,size()-1]. |
Returns a reference to the Solar System Barycentre Data with the specified index
.
Definition at line 119 of file GCOMBvcs.hpp.
References m_bvcs.
|
inline |
Return reference to Solar System Barycentre Data (const version)
[in] | index | Solar System Barycentre Data index [0,...,size()-1]. |
Returns a reference to the Solar System Barycentre Data with the specified index
.
Definition at line 134 of file GCOMBvcs.hpp.
References m_bvcs.
Print COMPTEL Solar System Barycentre Data container.
[in] | chatter | Chattiness. |
Implements GBase.
Definition at line 692 of file GCOMBvcs.cpp.
References m_bvcs, gammalib::parformat(), gammalib::reduce(), SILENT, size(), and gammalib::str().
Referenced by GCOMObservation::print().
void GCOMBvcs::read | ( | const GFitsTable & | table | ) |
Read COMPTEL Solar System Barycentre Data FITS table.
[in] | table | COMPTEL BVC FITS table. |
Reads COMPTEL Solar System Barycentre Data FITS table into the container.
Definition at line 396 of file GCOMBvcs.cpp.
References clear(), gammalib::com_time(), GFitsTableCol::integer(), m_bvcs, GFitsTable::nrows(), GFitsTableCol::real(), GCOMBvc::ssb(), GCOMBvc::tdelta(), GCOMBvc::tics(), GCOMBvc::time(), and GCOMBvc::tjd().
Referenced by load().
|
virtual |
Remove Solar System Barycentre Data from container.
[in] | index | Solar System Barycentre Data index (0,...,size()-1). |
GException::out_of_range | Solar System Barycentre Data index is out of range. |
Remove Solar System Barycentre Data of specified index
from container.
Implements GContainer.
Definition at line 312 of file GCOMBvcs.cpp.
|
inlinevirtual |
Reserves space for Solar System Barycentre Data in container.
[in] | num | Number of Solar System Barycentre Data. |
Reserves space for num
Solar System Barycentre Data in the container.
Implements GContainer.
Definition at line 177 of file GCOMBvcs.hpp.
References m_bvcs.
Referenced by extend().
|
inlinevirtual |
Return number of Solar System Barycentre Data in container.
Returns the number of Solar System Barycentre Data in the container.
Implements GContainer.
Definition at line 148 of file GCOMBvcs.hpp.
References m_bvcs.
Referenced by append(), at(), extend(), find(), insert(), print(), remove(), and tdelta().
Return time difference between photon arrival time at CGRO and the Solar System Barycentre (SSB)
[in] | dir | Source position. |
[in] | time | CGRO photon arrival time. |
GException::invalid_value | Not enough SSB vectors loaded for computation |
Returns the time difference between photon arrival time at CGRO and the Solar System Barycentre (SSB). The arrival time at the SSB is computed by adding the time difference to the photon arrival time as measured by COMPTEL
\[ T_{\rm SSB} = T_{\rm CGRO} + \Delta T \]
The routine implements the algorithm PUL-AL-004 and is inspried from the COMPASS code evpbin02.pulssb.f.
It computes
\[ \Delta T = \Delta T_{\rm travel} - \Delta T_{\rm rel} + \Delta T_{\rm BVC} \]
where
\[ \Delta T_{\rm travel} = \left( \vec{SSB} \cdot \vec{n} \right) \times 10^{-6} \]
is the light travel time in seconds between CGRO and the SSB, with \(\vec{SSB}\) being the vector going from the SSB to CGRO, and \(\vec{n}\) is the normalised vector of the source position, provided by the GSkyDir::celvector() method,
\[ \Delta T_{\rm rel} = -2 R \log \left( 1 + \frac{\Delta T_{\rm travel}}{|\vec{SSB}| * 10^{-6}} \right) \]
is the relativistic delay due to the Sun in seconds, with \(R=0.49254909 \times 10^{-5}\) s, and \(\Delta T_{\rm BVC}\) is the difference in seconds due to the time unit conversion.
The values of \(\vec{SSB}\) and \(\Delta T_{\rm BVC}\) are linearly interpolated from the tabulated values based on the specified time
.
Definition at line 564 of file GCOMBvcs.cpp.
References abs(), GSkyDir::celvector(), gammalib::com_tics(), gammalib::com_tjd(), G_TDELTA, log(), m_bvcs, norm(), size(), and gammalib::str().
Referenced by GCOMDri::compute_dre().
|
protected |
Solar System Barycentre Data records.
Definition at line 94 of file GCOMBvcs.hpp.
Referenced by append(), at(), copy_members(), extend(), find(), init_members(), insert(), is_empty(), operator[](), print(), read(), remove(), reserve(), size(), and tdelta().