GammaLib  2.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GEphemerides Class Reference

Ephemerides class. More...

#include <GEphemerides.hpp>

Inheritance diagram for GEphemerides:
GBase

Public Member Functions

 GEphemerides (void)
 Void constructor. More...
 
 GEphemerides (const GEphemerides &ephemerides)
 Copy constructor. More...
 
virtual ~GEphemerides (void)
 Destructor. More...
 
GEphemeridesoperator= (const GEphemerides &ephemerides)
 Assignment operator. More...
 
virtual void clear (void)
 Clear Ephemerides. More...
 
virtual GEphemeridesclone (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< GTimem_times
 Times of vectors. More...
 
std::vector< GVectorm_earth
 Earth vectors. More...
 
std::vector< GVectorm_earth_dt
 First derivative of Earth vectors. More...
 
std::vector< GVectorm_earth_d2t
 Second derivative of Earth vectors. More...
 
std::vector< GVectorm_earth_d3t
 Third derivative of Earth vectors. More...
 
std::vector< GVectorm_sun
 Sun vectors. More...
 
std::vector< double > m_tdb2tt
 TBD to TT conversion term. More...
 

Detailed Description

Ephemerides class.

This class implements the JPL ephemerides.

Definition at line 51 of file GEphemerides.hpp.

Constructor & Destructor Documentation

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.

Parameters
[in]ephemeridesEphemerides.

Definition at line 74 of file GEphemerides.cpp.

References copy_members(), and init_members().

GEphemerides::~GEphemerides ( void  )
virtual

Destructor.

Definition at line 90 of file GEphemerides.cpp.

References free_members().

Member Function Documentation

std::string GEphemerides::classname ( void  ) const
inlinevirtual

Return class name.

Returns
String containing the class name ("GEphemerides").

Implements GBase.

Definition at line 113 of file GEphemerides.hpp.

void GEphemerides::clear ( void  )
virtual

Clear Ephemerides.

Implements GBase.

Definition at line 142 of file GEphemerides.cpp.

References free_members(), and init_members().

Referenced by load().

GEphemerides * GEphemerides::clone ( void  ) const
virtual

Clone Ephemerides.

Returns
Pointer to deep copy of Ephemerides.

Implements GBase.

Definition at line 160 of file GEphemerides.cpp.

References GEphemerides().

void GEphemerides::copy_members ( const GEphemerides ephemerides)
protected

Copy class members.

Parameters
[in]ephemeridesEphemerides.

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.

Parameters
[in]timeTime.
[out]rcePointer to vector from SSBC to Earth (light-s).
[out]rcsPointer to vector from SSBC to Sun (light-s).
[out]vcePointer to first time derivative of vector from SSBC to Earth (light-s/s).
[out]etutTime 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().

void GEphemerides::fetch_data ( void  )
protected

Fetch ephemerides data.

Exceptions
GException::file_errorEphemerides 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().

void GEphemerides::free_members ( void  )
protected

Delete class members.

Definition at line 565 of file GEphemerides.cpp.

Referenced by clear(), operator=(), and ~GEphemerides().

double GEphemerides::geo2ssb ( const GSkyDir srcdir,
const GTime time 
) const

Get time difference between geocentric and SSB (seconds)

Parameters
[in]srcdirSource direction.
[in]timeGeocentric time.
Returns
Time difference in seconds.

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)

Parameters
[in]srcdirSource direction.
[in]timeGeocentric time.
[in]obsObservatory vector (km).
Returns
Time difference in seconds.

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.

void GEphemerides::init_members ( void  )
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=().

bool GEphemerides::is_empty ( void  ) const
inline

Signals if there are no ephemerides.

Returns
True if there are no ephemerides, false otherwise.

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.

Parameters
[in]filenameEphemerides 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().

const std::string & GEphemerides::name ( void  ) const
inline

Return ephemerides name.

Returns
Ephemerides name

Definition at line 153 of file GEphemerides.hpp.

References m_name.

Referenced by name().

void GEphemerides::name ( const std::string &  name)
inline

Set ephemerides name.

Parameters
[in]nameEphemerides name.

Definition at line 165 of file GEphemerides.hpp.

References m_name, and name().

GEphemerides & GEphemerides::operator= ( const GEphemerides ephemerides)

Assignment operator.

Parameters
[in]ephemeridesEphemerides.
Returns
Ephemerides.

Definition at line 112 of file GEphemerides.cpp.

References copy_members(), free_members(), and init_members().

std::string GEphemerides::print ( const GChatter chatter = NORMAL) const
virtual

Print Ephemerides.

Parameters
[in]chatterChattiness.
Returns
String containing Ephemerides information.

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().

int GEphemerides::size ( void  ) const
inline

Return number of ephemerides.

Returns
Number of ephemerides.

Returns the number of ephemerides.

Definition at line 127 of file GEphemerides.hpp.

References m_times.

Referenced by ephemeris().

Member Data Documentation

std::vector<GVector> GEphemerides::m_earth
protected

Earth vectors.

Definition at line 98 of file GEphemerides.hpp.

Referenced by copy_members(), ephemeris(), init_members(), and load().

std::vector<GVector> GEphemerides::m_earth_d2t
protected

Second derivative of Earth vectors.

Definition at line 100 of file GEphemerides.hpp.

Referenced by copy_members(), ephemeris(), init_members(), and load().

std::vector<GVector> GEphemerides::m_earth_d3t
protected

Third derivative of Earth vectors.

Definition at line 101 of file GEphemerides.hpp.

Referenced by copy_members(), ephemeris(), init_members(), and load().

std::vector<GVector> GEphemerides::m_earth_dt
protected

First derivative of Earth vectors.

Definition at line 99 of file GEphemerides.hpp.

Referenced by copy_members(), ephemeris(), init_members(), and load().

GFilename GEphemerides::m_filename
protected

Ephemerides filename.

Definition at line 94 of file GEphemerides.hpp.

Referenced by copy_members(), init_members(), load(), and print().

std::string GEphemerides::m_name
protected

Ephemerides (e.g. DE200)

Definition at line 93 of file GEphemerides.hpp.

Referenced by copy_members(), init_members(), load(), name(), and print().

std::vector<GVector> GEphemerides::m_sun
protected

Sun vectors.

Definition at line 102 of file GEphemerides.hpp.

Referenced by copy_members(), ephemeris(), init_members(), and load().

std::vector<double> GEphemerides::m_tdb2tt
protected

TBD to TT conversion term.

Definition at line 103 of file GEphemerides.hpp.

Referenced by copy_members(), ephemeris(), init_members(), and load().

std::vector<GTime> GEphemerides::m_times
protected

Times of vectors.

Definition at line 97 of file GEphemerides.hpp.

Referenced by copy_members(), init_members(), is_empty(), load(), and size().

GTime GEphemerides::m_tstart
protected

Ephemerides validity start time.

Definition at line 95 of file GEphemerides.hpp.

Referenced by copy_members(), ephemeris(), init_members(), load(), and print().

GTime GEphemerides::m_tstop
protected

Ephemerides validity stop time.

Definition at line 96 of file GEphemerides.hpp.

Referenced by copy_members(), ephemeris(), init_members(), load(), and print().


The documentation for this class was generated from the following files: