GammaLib
2.0.0
|
Ephemerides class. More...
#include <GEphemerides.hpp>
Public Member Functions | |
GEphemerides (void) | |
Void constructor. More... | |
GEphemerides (const GEphemerides &ephemerides) | |
Copy constructor. More... | |
virtual | ~GEphemerides (void) |
Destructor. More... | |
GEphemerides & | operator= (const GEphemerides &ephemerides) |
Assignment operator. More... | |
virtual void | clear (void) |
Clear Ephemerides. More... | |
virtual GEphemerides * | clone (void) const |
Clone Ephemerides. More... | |
virtual std::string | classname (void) const |
Return class name. More... | |
virtual std::string | print (const GChatter &chatter=NORMAL) const |
Print Ephemerides. More... | |
int | size (void) const |
Return number of ephemerides. More... | |
bool | is_empty (void) const |
Signals if there are no ephemerides. More... | |
const std::string & | name (void) const |
Return ephemerides name. More... | |
void | name (const std::string &name) |
Set ephemerides name. More... | |
void | load (const GFilename &filename) |
Load Ephemerides. More... | |
void | ephemeris (const GTime &time, GVector *rce, GVector *rcs, GVector *vce, double *etut) const |
Get ephemeris vector and TBD->TT value for a given time. More... | |
double | geo2ssb (const GSkyDir &srcdir, const GTime &time) const |
Get time difference between geocentric and SSB (seconds) More... | |
double | geo2ssb (const GSkyDir &srcdir, const GTime &time, const GVector &obs) const |
Get time difference between observatory and SSB (seconds) 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 GEphemerides &ephemerides) |
Copy class members. More... | |
void | free_members (void) |
Delete class members. More... | |
void | fetch_data (void) |
Fetch ephemerides data. More... | |
Protected Attributes | |
std::string | m_name |
Ephemerides (e.g. DE200) More... | |
GFilename | m_filename |
Ephemerides filename. More... | |
GTime | m_tstart |
Ephemerides validity start time. More... | |
GTime | m_tstop |
Ephemerides validity stop time. More... | |
std::vector< GTime > | m_times |
Times of vectors. More... | |
std::vector< GVector > | m_earth |
Earth vectors. More... | |
std::vector< GVector > | m_earth_dt |
First derivative of Earth vectors. More... | |
std::vector< GVector > | m_earth_d2t |
Second derivative of Earth vectors. More... | |
std::vector< GVector > | m_earth_d3t |
Third derivative of Earth vectors. More... | |
std::vector< GVector > | m_sun |
Sun vectors. More... | |
std::vector< double > | m_tdb2tt |
TBD to TT conversion term. More... | |
Ephemerides class.
This class implements the JPL ephemerides.
Definition at line 51 of file GEphemerides.hpp.
GEphemerides::GEphemerides | ( | void | ) |
Void constructor.
Definition at line 59 of file GEphemerides.cpp.
References init_members().
Referenced by clone().
GEphemerides::GEphemerides | ( | const GEphemerides & | ephemerides | ) |
Copy constructor.
[in] | ephemerides | Ephemerides. |
Definition at line 74 of file GEphemerides.cpp.
References copy_members(), and init_members().
|
virtual |
|
inlinevirtual |
Return class name.
Implements GBase.
Definition at line 113 of file GEphemerides.hpp.
|
virtual |
Clear Ephemerides.
Implements GBase.
Definition at line 142 of file GEphemerides.cpp.
References free_members(), and init_members().
Referenced by load().
|
virtual |
Clone Ephemerides.
Implements GBase.
Definition at line 160 of file GEphemerides.cpp.
References GEphemerides().
|
protected |
Copy class members.
[in] | ephemerides | Ephemerides. |
Definition at line 542 of file GEphemerides.cpp.
References m_earth, m_earth_d2t, m_earth_d3t, m_earth_dt, m_filename, m_name, m_sun, m_tdb2tt, m_times, m_tstart, and m_tstop.
Referenced by GEphemerides(), and operator=().
void GEphemerides::ephemeris | ( | const GTime & | time, |
GVector * | rce, | ||
GVector * | rcs, | ||
GVector * | vce, | ||
double * | etut | ||
) | const |
Get ephemeris vector and TBD->TT value for a given time.
[in] | time | Time. |
[out] | rce | Pointer to vector from SSBC to Earth (light-s). |
[out] | rcs | Pointer to vector from SSBC to Sun (light-s). |
[out] | vce | Pointer to first time derivative of vector from SSBC to Earth (light-s/s). |
[out] | etut | Time difference TDB-TT (s) |
Get ephemeris vector and TBD-TT value for a given time. Information is only returned for pointers that are not NULL.
The code was inspired from the ftools routine xtereadeph.f and the COMPASS routine bvceph.f.
Definition at line 274 of file GEphemerides.cpp.
References fetch_data(), G_EPHEMERIS, GTime::jd(), m_earth, m_earth_d2t, m_earth_d3t, m_earth_dt, m_sun, m_tdb2tt, m_tstart, m_tstop, gammalib::sec2day, size(), and gammalib::str().
Referenced by geo2ssb().
|
protected |
Fetch ephemerides data.
GException::file_error | Ephemerides data file not found. |
This method loads the DE200 ephemerides data from the file provided in the reference data repository if no ephemerides are loaded.
Definition at line 581 of file GEphemerides.cpp.
References G_FETCH_DATA, is_empty(), GFilename::is_fits(), load(), and GFilename::url().
Referenced by ephemeris().
|
protected |
Delete class members.
Definition at line 565 of file GEphemerides.cpp.
Referenced by clear(), operator=(), and ~GEphemerides().
Get time difference between geocentric and SSB (seconds)
[in] | srcdir | Source direction. |
[in] | time | Geocentric time. |
Definition at line 360 of file GEphemerides.cpp.
References GSkyDir::celvector(), ephemeris(), log(), and norm().
Referenced by GCOMDri::compute_dre(), geo2ssb(), and GPulsar::load_psrtime().
double GEphemerides::geo2ssb | ( | const GSkyDir & | srcdir, |
const GTime & | time, | ||
const GVector & | obs | ||
) | const |
Get time difference between observatory and SSB (seconds)
[in] | srcdir | Source direction. |
[in] | time | Geocentric time. |
[in] | obs | Observatory vector (km). |
Computes the time difference between the location of an observatory, specified by an observatory position vector obs
in units of km, and the Solar System Barycentre.
Definition at line 417 of file GEphemerides.cpp.
References GSkyDir::celvector(), ephemeris(), geo2ssb(), log(), norm(), and gammalib::speed_of_light.
|
protected |
Initialise class members.
Definition at line 517 of file GEphemerides.cpp.
References GFilename::clear(), GTime::clear(), m_earth, m_earth_d2t, m_earth_d3t, m_earth_dt, m_filename, m_name, m_sun, m_tdb2tt, m_times, m_tstart, and m_tstop.
Referenced by clear(), GEphemerides(), and operator=().
|
inline |
Signals if there are no ephemerides.
Signals if there are no ephemerides.
Definition at line 141 of file GEphemerides.hpp.
References m_times.
Referenced by fetch_data(), and print().
void GEphemerides::load | ( | const GFilename & | filename | ) |
Load Ephemerides.
[in] | filename | Ephemerides file name. |
Load ephemerides from FITS file.
Definition at line 173 of file GEphemerides.cpp.
References clear(), GTime::jd(), m_earth, m_earth_d2t, m_earth_d3t, m_earth_dt, m_filename, m_name, m_sun, m_tdb2tt, m_times, m_tstart, m_tstop, GFitsTable::nrows(), GFitsTableCol::real(), GFitsHDU::real(), GFitsHDU::string(), and GFits::table().
Referenced by fetch_data().
|
inline |
Return ephemerides name.
Definition at line 153 of file GEphemerides.hpp.
References m_name.
Referenced by name().
|
inline |
Set ephemerides name.
[in] | name | Ephemerides name. |
Definition at line 165 of file GEphemerides.hpp.
GEphemerides & GEphemerides::operator= | ( | const GEphemerides & | ephemerides | ) |
Assignment operator.
[in] | ephemerides | Ephemerides. |
Definition at line 112 of file GEphemerides.cpp.
References copy_members(), free_members(), and init_members().
Print Ephemerides.
[in] | chatter | Chattiness. |
Implements GBase.
Definition at line 474 of file GEphemerides.cpp.
References is_empty(), m_filename, m_name, m_tstart, m_tstop, GTime::mjd(), gammalib::parformat(), SILENT, gammalib::str(), GFilename::url(), and GTime::utc().
|
inline |
Return number of ephemerides.
Returns the number of ephemerides.
Definition at line 127 of file GEphemerides.hpp.
References m_times.
Referenced by ephemeris().
|
protected |
Earth vectors.
Definition at line 98 of file GEphemerides.hpp.
Referenced by copy_members(), ephemeris(), init_members(), and load().
|
protected |
Second derivative of Earth vectors.
Definition at line 100 of file GEphemerides.hpp.
Referenced by copy_members(), ephemeris(), init_members(), and load().
|
protected |
Third derivative of Earth vectors.
Definition at line 101 of file GEphemerides.hpp.
Referenced by copy_members(), ephemeris(), init_members(), and load().
|
protected |
First derivative of Earth vectors.
Definition at line 99 of file GEphemerides.hpp.
Referenced by copy_members(), ephemeris(), init_members(), and load().
|
protected |
Ephemerides filename.
Definition at line 94 of file GEphemerides.hpp.
Referenced by copy_members(), init_members(), load(), and print().
|
protected |
Ephemerides (e.g. DE200)
Definition at line 93 of file GEphemerides.hpp.
Referenced by copy_members(), init_members(), load(), name(), and print().
|
protected |
Sun vectors.
Definition at line 102 of file GEphemerides.hpp.
Referenced by copy_members(), ephemeris(), init_members(), and load().
|
protected |
TBD to TT conversion term.
Definition at line 103 of file GEphemerides.hpp.
Referenced by copy_members(), ephemeris(), init_members(), and load().
|
protected |
Times of vectors.
Definition at line 97 of file GEphemerides.hpp.
Referenced by copy_members(), init_members(), is_empty(), load(), and size().
|
protected |
Ephemerides validity start time.
Definition at line 95 of file GEphemerides.hpp.
Referenced by copy_members(), ephemeris(), init_members(), load(), and print().
|
protected |
Ephemerides validity stop time.
Definition at line 96 of file GEphemerides.hpp.
Referenced by copy_members(), ephemeris(), init_members(), load(), and print().