GammaLib
2.1.0.dev
|
Pulsar class. More...
#include <GPulsar.hpp>
Public Member Functions | |
GPulsar (void) | |
Void constructor. More... | |
GPulsar (const GFilename &filename, const std::string &name="") | |
Filename constructor. More... | |
GPulsar (const GPulsar &pulsar) | |
Copy constructor. More... | |
virtual | ~GPulsar (void) |
Destructor. More... | |
GPulsar & | operator= (const GPulsar &pulsar) |
Assignment operator. More... | |
GPulsarEphemeris & | operator[] (const int &index) |
Return reference to ephemeris. More... | |
const GPulsarEphemeris & | operator[] (const int &index) const |
Return reference to ephemeris (const version) More... | |
virtual void | clear (void) |
Clear Pulsar. More... | |
virtual GPulsar * | clone (void) const |
Clone Pulsar. More... | |
virtual std::string | classname (void) const |
Return class name. More... | |
virtual std::string | print (const GChatter &chatter=NORMAL) const |
Print Pulsar. More... | |
int | size (void) const |
Return number of ephemerides for pulsar. More... | |
bool | is_empty (void) const |
Signals if there are no ephemerides for pulsar. More... | |
GPulsarEphemeris & | at (const int &index) |
Return reference to ephemeris. More... | |
const GPulsarEphemeris & | at (const int &index) const |
Return reference to ephemeris (const version) More... | |
const std::string & | name (void) const |
Return pulsar name. More... | |
void | name (const std::string &name) |
Set pulsar name. More... | |
const GPulsarEphemeris & | ephemeris (const GTime &time) const |
Return pulsar ephemeris. More... | |
GGti | validity (void) const |
Return validity intervals of pulsar ephemerides. More... | |
void | load (const GFilename &filename, const std::string &name="") |
Load Pulsar from ephemerides file. 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 GPulsar &pulsar) |
Copy class members. More... | |
void | free_members (void) |
Delete class members. More... | |
void | load_fits (const GFilename &filename, const std::string &name="") |
Load Pulsar from ephemerides FITS file. More... | |
void | load_integral (const GFitsTable *table, const std::string &name="") |
Load Pulsar from INTEGRAL ephemerides FITS table. More... | |
void | load_fermi (const GFitsTable *table, const std::string &name="") |
Load Pulsar from Fermi ephemerides FITS table. More... | |
void | load_psrtime (const GFilename &filename, const std::string &name="") |
Load Pulsar from ephemerides psrtime file. More... | |
void | load_parfile (const GFilename &filename) |
Load Pulsar from ephemeris par file. More... | |
Protected Attributes | |
std::string | m_name |
Pulsar name. More... | |
std::vector< GPulsarEphemeris > | m_ephemerides |
Pulsar ephemerides. More... | |
Pulsar class.
This class implements a pulsar, defined by a name and a list of pulsar ephemerides.
Definition at line 53 of file GPulsar.hpp.
GPulsar::GPulsar | ( | void | ) |
Void constructor.
Definition at line 65 of file GPulsar.cpp.
References init_members().
Referenced by clone().
GPulsar::GPulsar | ( | const GFilename & | filename, |
const std::string & | name = "" |
||
) |
Filename constructor.
[in] | filename | File name of pulsar ephemerides |
[in] | name | Pulsar name |
Constructs a pulsar from an ephemerides file. In case that several pulsars are present in the specified ephemerides file the name of the pulsar that should be constructed is to be specified.
Definition at line 85 of file GPulsar.cpp.
References init_members(), and load().
GPulsar::GPulsar | ( | const GPulsar & | pulsar | ) |
Copy constructor.
[in] | pulsar | Pulsar. |
Definition at line 103 of file GPulsar.cpp.
References copy_members(), and init_members().
|
virtual |
GPulsarEphemeris & GPulsar::at | ( | const int & | index | ) |
Return reference to ephemeris.
[in] | index | Ephemeris index [0,...,size()-1]. |
GException::out_of_range | Ephemeris index is out of range. |
Returns a reference to the ephemeris with the specified index
.
Definition at line 204 of file GPulsar.cpp.
References G_AT, m_ephemerides, and size().
const GPulsarEphemeris & GPulsar::at | ( | const int & | index | ) | const |
Return reference to ephemeris (const version)
[in] | index | Ephemeris index [0,...,size()-1]. |
GException::out_of_range | Ephemeris index is out of range. |
Returns a const reference to the ephemeris with the specified index
.
Definition at line 228 of file GPulsar.cpp.
References G_AT, m_ephemerides, and size().
|
inlinevirtual |
Return class name.
Implements GBase.
Definition at line 136 of file GPulsar.hpp.
|
virtual |
Clear Pulsar.
Implements GBase.
Definition at line 171 of file GPulsar.cpp.
References free_members(), and init_members().
Referenced by GCOMSelection::init_members(), and load().
|
virtual |
Clone Pulsar.
Implements GBase.
Definition at line 189 of file GPulsar.cpp.
References GPulsar().
|
protected |
Copy class members.
[in] | pulsar | Pulsar. |
Definition at line 450 of file GPulsar.cpp.
References m_ephemerides, and m_name.
Referenced by GPulsar(), and operator=().
const GPulsarEphemeris & GPulsar::ephemeris | ( | const GTime & | time | ) | const |
Return pulsar ephemeris.
param[in] time Time.
GException::invalid_argument | No valid ephemeris found for specified time . |
Returns the pulsar ephemeris as function of time.
Definition at line 253 of file GPulsar.cpp.
References G_EPHEMERIS, m_ephemerides, GTime::mjd(), size(), and gammalib::str().
Referenced by GCOMDri::compute_dre(), load_fermi(), load_integral(), load_parfile(), and load_psrtime().
|
protected |
Delete class members.
Definition at line 464 of file GPulsar.cpp.
Referenced by clear(), operator=(), and ~GPulsar().
|
protected |
Initialise class members.
Definition at line 434 of file GPulsar.cpp.
References m_ephemerides, and m_name.
Referenced by clear(), GPulsar(), and operator=().
|
inline |
Signals if there are no ephemerides for pulsar.
Signals if there are no ephemerides for pulsar.
Definition at line 164 of file GPulsar.hpp.
References m_ephemerides.
Referenced by GCOMSelection::print(), and print().
void GPulsar::load | ( | const GFilename & | filename, |
const std::string & | name = "" |
||
) |
Load Pulsar from ephemerides file.
[in] | filename | File name of pulsar ephemerides |
[in] | name | Pulsar name |
GException::file_error | Could not open specified file as an ASCII file |
Load a pulsar from an ephemerides file. In case that several pulsars are present in the specified ephemerides file the name of the pulsar that should be constructed is to be specified.
Definition at line 314 of file GPulsar.cpp.
References clear(), G_LOAD, GFilename::is_fits(), load_fits(), load_parfile(), load_psrtime(), gammalib::split(), and GFilename::url().
Referenced by GPulsar().
|
protected |
Load Pulsar from Fermi ephemerides FITS table.
[in] | table | Fermi ephemerides FITS table |
[in] | name | Pulsar name |
GException::invalid_argument | Specified pulsar name not found in FITS table |
Load a pulsar from Fermi ephemerides FITS table.
Definition at line 632 of file GPulsar.cpp.
References GPulsarEphemeris::dir(), ephemeris(), GPulsarEphemeris::f0(), GPulsarEphemeris::f1(), GPulsarEphemeris::f2(), G_LOAD_FERMI, GFitsTableCol::integer(), m_ephemerides, m_name, GTime::mjd(), GPulsarEphemeris::name(), name(), GFitsTableCol::nrows(), GPulsarEphemeris::phase(), GSkyDir::radec_deg(), GFitsTableCol::real(), gammalib::sec_in_day, GFitsTableCol::string(), GPulsarEphemeris::t0(), GPulsarEphemeris::tstart(), and GPulsarEphemeris::tstop().
Referenced by load_fits().
|
protected |
Load Pulsar from ephemerides FITS file.
[in] | filename | Name of pulsar ephemerides FITS file |
[in] | name | Pulsar name |
GException::file_error | FITS file format not recognised |
Load a pulsar from an ephemerides FITS file. In case that several pulsars are present in the specified ephemerides file the name of the pulsar that should be constructed is to be specified.
Definition at line 484 of file GPulsar.cpp.
References GFits::contains(), G_LOAD_FITS, load_fermi(), load_integral(), GFits::table(), and GFilename::url().
Referenced by load().
|
protected |
Load Pulsar from INTEGRAL ephemerides FITS table.
[in] | table | INTEGRAL ephemerides FITS table |
[in] | name | Pulsar name |
GException::invalid_argument | Specified pulsar name not found in FITS table |
Load a pulsar from INTEGRAL ephemerides FITS table. In the INTEGRAL format only a single pulsar will be present in the FITS file, specified by the SOURCEID keyword.
Definition at line 529 of file GPulsar.cpp.
References GPulsarEphemeris::dir(), ephemeris(), GPulsarEphemeris::f0(), GPulsarEphemeris::f1(), GPulsarEphemeris::f2(), G_LOAD_INTEGRAL, m_ephemerides, m_name, GTime::mjd(), GPulsarEphemeris::name(), GFitsTableCol::nrows(), GPulsarEphemeris::phase(), GSkyDir::radec_deg(), GFitsTableCol::real(), GFitsHDU::real(), GFitsHDU::string(), GPulsarEphemeris::t0(), GPulsarEphemeris::tstart(), and GPulsarEphemeris::tstop().
Referenced by load_fits().
|
protected |
Load Pulsar from ephemeris par file.
[in] | filename | Name of pulsar ephemeris par file |
GException::file_error | Could not open ephemeris ASCII file |
GException::invalid_argument | No valid Right Ascension and Declination found |
Load a pulsar from an ephemeris par file.
Definition at line 885 of file GPulsar.cpp.
References GPulsarEphemeris::dir(), ephemeris(), GPulsarEphemeris::f0(), GPulsarEphemeris::f1(), GPulsarEphemeris::f2(), G_LOAD_PARFILE, m_ephemerides, m_name, GTime::mjd(), GPulsarEphemeris::name(), GSkyDir::radec_deg(), gammalib::rstrip_chars(), gammalib::split(), gammalib::str(), GPulsarEphemeris::t0(), gammalib::todouble(), GPulsarEphemeris::tstart(), GPulsarEphemeris::tstop(), and GFilename::url().
Referenced by load().
|
protected |
Load Pulsar from ephemerides psrtime file.
[in] | filename | Name of pulsar ephemerides psrtime file |
[in] | name | Pulsar name |
GException::file_error | Could not open ephemerides ASCII file |
GException::invalid_argument | No pulsar name specified for a file that contains multiple pulsars |
Load a pulsar from an ephemerides psrtime file. In case that several pulsars are present in the specified ephemerides file the name of the pulsar that should be constructed is to be specified.
Definition at line 740 of file GPulsar.cpp.
References GPulsarEphemeris::dir(), ephemeris(), GPulsarEphemeris::f0(), GPulsarEphemeris::f1(), GPulsarEphemeris::f2(), G_LOAD_PSRTIME, GEphemerides::geo2ssb(), m_ephemerides, m_name, GTime::mjd(), GPulsarEphemeris::name(), name(), GPulsarEphemeris::phase(), GSkyDir::radec_deg(), gammalib::replace_segment(), gammalib::sec_in_day, gammalib::split(), GPulsarEphemeris::t0(), GPulsarEphemeris::timesys(), gammalib::todouble(), GPulsarEphemeris::tstart(), GPulsarEphemeris::tstop(), GFilename::url(), and GTime::utc2tt().
Referenced by load().
|
inline |
Return pulsar name.
Definition at line 176 of file GPulsar.hpp.
References m_name.
Referenced by load_fermi(), load_psrtime(), and name().
|
inline |
Assignment operator.
[in] | pulsar | Pulsar. |
Definition at line 141 of file GPulsar.cpp.
References copy_members(), free_members(), and init_members().
|
inline |
Return reference to ephemeris.
[in] | index | Ephemeris index [0,...,size()-1]. |
Returns a reference to the ephemeris with the specified index
.
Definition at line 110 of file GPulsar.hpp.
References m_ephemerides.
|
inline |
Return reference to ephemeris (const version)
[in] | index | Ephemeris index [0,...,size()-1]. |
Returns a const reference to the ephemeris with the specified index
.
Definition at line 124 of file GPulsar.hpp.
References m_ephemerides.
Print Pulsar.
[in] | chatter | Chattiness. |
Implements GBase.
Definition at line 381 of file GPulsar.cpp.
References EXPLICIT, is_empty(), m_ephemerides, m_name, GTime::mjd(), gammalib::parformat(), SILENT, gammalib::str(), GGti::tstart(), GGti::tstop(), GTime::utc(), and validity().
Referenced by GCOMSelection::print().
|
inline |
Return number of ephemerides for pulsar.
Returns the number of ephemerides for pulsar.
Definition at line 150 of file GPulsar.hpp.
References m_ephemerides.
Referenced by at(), ephemeris(), and validity().
GGti GPulsar::validity | ( | void | ) | const |
Return validity intervals of pulsar ephemerides.
Returns the validity intervals of pulsar ephemerides as Good Time Intervals.
Definition at line 286 of file GPulsar.cpp.
References GGti::append(), m_ephemerides, and size().
Referenced by GCOMDri::compute_dre(), GCOMDri::compute_drg(), GCOMDris::compute_drws_energy(), GCOMDris::compute_drws_phibar(), GCOMDri::compute_drx(), print(), GCOMDris::vetorate_generate(), and GCOMDris::vetorate_setup().
|
protected |
Pulsar ephemerides.
Definition at line 98 of file GPulsar.hpp.
Referenced by at(), copy_members(), ephemeris(), init_members(), is_empty(), load_fermi(), load_integral(), load_parfile(), load_psrtime(), operator[](), print(), size(), and validity().
|
protected |
Pulsar name.
Definition at line 97 of file GPulsar.hpp.
Referenced by copy_members(), init_members(), load_fermi(), load_integral(), load_parfile(), load_psrtime(), name(), and print().