CppEphem
Public Member Functions | Private Member Functions | Private Attributes | List of all members
CECorrections Class Reference

CECorrections class handles downloading and retrieving corrections from the IERS bulletins. Current corrections obtainable:

The way this is done is by downloading the corrections data on the fly from: http://maia.usno.navy.mil/ser7/finals2000A.all The downloaded file will be stored locally to prevent the need to re-download it every time it is needed in the future.

IMPORTANT NOTE: These correction values should only be accessed through the CppEphem namespace, and not by directly querying this class. This prevents creating multiple CECorrections objects that could be resource intensive.

Definition at line 28 of file CECorrections.h.

Public Member Functions

 CECorrections ()
 Constructor for coordinate corrections object. More...
 
 CECorrections (const CECorrections &other)
 Copy constructor. More...
 
double deps (const double &mjd) const
 Return the offset in obliquity correction parameter (radians) More...
 
double dpsi (const double &mjd) const
 Return the offset in longitude correction parameter (radians) More...
 
double dut1 (const double &mjd) const
 Return the DUT1 correction parameter (represents UT1 - UTC in seconds) More...
 
std::string NutationFile (void) const
 Returns the name of the nutation corrections file. More...
 
CECorrectionsoperator= (const CECorrections &other)
 Overloaded assignment operator. More...
 
void SetInterp (bool set_interp)
 Defines that the correction values should be interpolated. More...
 
void SetNutationFile (const std::string &filename)
 Sets the name of the nutation corrections file. More...
 
void SetTtUt1HistFile (const std::string &filename)
 Sets the name of the historic values TT-UT1 corrections file. More...
 
void SetTtUt1PredFile (const std::string &filename)
 Sets the name of the predicted values TT-UT1 corrections file. More...
 
double ttut1 (const double &mjd) const
 Return the TT-UT1 correction at a given date (in seconds) More...
 
std::string TtUt1HistFile (void) const
 Returns the name of the historic TT-UT1 corrections file. More...
 
std::string TtUt1PredFile (void) const
 Returns the name of the precited TT-UT1 corrections file. More...
 
double xpolar (const double &mjd) const
 Return the x-polar motion correction parameter (radians) More...
 
double ypolar (const double &mjd) const
 Return the y-polar motion correction parameter (radians) More...
 
virtual ~CECorrections ()
 

Private Member Functions

void copy_members (const CECorrections &other)
 Copy data members from another object. More...
 
bool DownloadTable (const std::string &filename, const std::string &url) const
 Downloads the IERS earth orientation correction parameters. More...
 
void free_members (void)
 Free data member objects. More...
 
void init_members (void)
 Initialize data members. More...
 
double InterpValue (const double &x, const double &x0, const double &x1, const double &y0, const double &y1) const
 Return the interpolated value at a given x value between two known values. More...
 
std::ifstream LoadFile (const std::string &filename, const std::string &url) const
 Initialize data members. More...
 
bool LoadNutation (void) const
 Loads the IERS earth orientation correction parameters. More...
 
bool LoadTtUt1 (void) const
 Loads the TT-UT1 correction values. More...
 
void UpdateNutationCache (const double &mjd) const
 Recompute cached values of nutation valeus if necessary. More...
 
void UpdateTtUt1Cache (const double &mjd) const
 Recompute cached values of nutation valeus if necessary. More...
 

Private Attributes

double cache_nut_deps_
 
double cache_nut_dpsi_
 
double cache_nut_dut1_
 
double cache_nut_mjd_
 
double cache_nut_xp_
 
double cache_nut_yp_
 
double cache_ttut1_delt_
 
double cache_ttut1_mjd_
 
bool interp_
 
std::vector< double > nutation_deps_
 
std::vector< double > nutation_dpsi_
 
std::vector< double > nutation_dut1_
 
std::string nutation_file_
 File for nutation corrections. More...
 
std::vector< int > nutation_mjd_
 
std::vector< double > nutation_xp_
 
std::vector< double > nutation_yp_
 
std::vector< double > ttut1_delt_
 
std::string ttut1_file_hist_
 File for historic TT-UT1 corrections. More...
 
std::string ttut1_file_pred_
 File for predicted TT-UT1 corrections. More...
 
std::vector< double > ttut1_mjd_
 

#include <CECorrections.h>

Constructor & Destructor Documentation

◆ CECorrections() [1/2]

CECorrections::CECorrections ( )

Constructor for coordinate corrections object.

Definition at line 58 of file CECorrections.cpp.

◆ CECorrections() [2/2]

CECorrections::CECorrections ( const CECorrections other)

Copy constructor.

Definition at line 67 of file CECorrections.cpp.

◆ ~CECorrections()

virtual CECorrections::~CECorrections ( )
inlinevirtual

Definition at line 50 of file CECorrections.h.

Member Function Documentation

◆ copy_members()

void CECorrections::copy_members ( const CECorrections other)
private

Copy data members from another object.

Parameters
[in]otherCECorrections object to be copied

Definition at line 260 of file CECorrections.cpp.

◆ deps()

double CECorrections::deps ( const double &  mjd) const

Return the offset in obliquity correction parameter (radians)

Parameters
[in]mjdModified Julian date
Returns
Obliquity correction parameter (radians)

Definition at line 127 of file CECorrections.cpp.

◆ DownloadTable()

bool CECorrections::DownloadTable ( const std::string &  filename,
const std::string &  url 
) const
private

Downloads the IERS earth orientation correction parameters.

Returns
Whether or not the download was successful

Definition at line 360 of file CECorrections.cpp.

◆ dpsi()

double CECorrections::dpsi ( const double &  mjd) const

Return the offset in longitude correction parameter (radians)

Parameters
[in]mjdModified Julian date
Returns
longitude offset correction parameter (radians)

Definition at line 143 of file CECorrections.cpp.

◆ dut1()

double CECorrections::dut1 ( const double &  mjd) const

Return the DUT1 correction parameter (represents UT1 - UTC in seconds)

Parameters
[in]mjdModified Julian date
Returns
DUT1 correction parameter (represents UT1 - UTC in seconds)

Definition at line 79 of file CECorrections.cpp.

◆ free_members()

void CECorrections::free_members ( void  )
private

Free data member objects.

Definition at line 239 of file CECorrections.cpp.

◆ init_members()

void CECorrections::init_members ( void  )
private

Initialize data members.

Definition at line 289 of file CECorrections.cpp.

◆ InterpValue()

double CECorrections::InterpValue ( const double &  x,
const double &  x0,
const double &  x1,
const double &  y0,
const double &  y1 
) const
private

Return the interpolated value at a given x value between two known values.

Parameters
[in]xDesired position for interpolation
[in]x0Lower position where value is known
[in]x1Upper position where value is known
[in]y0Known value at position x0
[in]y1Known value at position x1
Returns
Obliquity correction parameter

Definition at line 707 of file CECorrections.cpp.

◆ LoadFile()

std::ifstream CECorrections::LoadFile ( const std::string &  filename,
const std::string &  url 
) const
private

Initialize data members.

Definition at line 324 of file CECorrections.cpp.

◆ LoadNutation()

bool CECorrections::LoadNutation ( void  ) const
private

Loads the IERS earth orientation correction parameters.

Returns
Whether or not the load was successful

Definition at line 404 of file CECorrections.cpp.

◆ LoadTtUt1()

bool CECorrections::LoadTtUt1 ( void  ) const
private

Loads the TT-UT1 correction values.

Returns
Whether or not the load was successful

Definition at line 494 of file CECorrections.cpp.

◆ NutationFile()

std::string CECorrections::NutationFile ( void  ) const
inline

Returns the name of the nutation corrections file.

Returns
Nutation corrections filename

Definition at line 107 of file CECorrections.h.

◆ operator=()

CECorrections & CECorrections::operator= ( const CECorrections other)

Overloaded assignment operator.

Parameters
[in]otherCECorrections object to be copied
Returns
Reference to this object post-assignment

Definition at line 175 of file CECorrections.cpp.

◆ SetInterp()

void CECorrections::SetInterp ( bool  set_interp)

Defines that the correction values should be interpolated.

Parameters
[in]set_interpNew interpolation boolean

Definition at line 224 of file CECorrections.cpp.

◆ SetNutationFile()

void CECorrections::SetNutationFile ( const std::string &  filename)

Sets the name of the nutation corrections file.

Parameters
[in]filenameFilename to read/write corrections from/to

Definition at line 191 of file CECorrections.cpp.

◆ SetTtUt1HistFile()

void CECorrections::SetTtUt1HistFile ( const std::string &  filename)

Sets the name of the historic values TT-UT1 corrections file.

Parameters
[in]filenameFilename to read/write corrections from/to

Definition at line 202 of file CECorrections.cpp.

◆ SetTtUt1PredFile()

void CECorrections::SetTtUt1PredFile ( const std::string &  filename)

Sets the name of the predicted values TT-UT1 corrections file.

Parameters
[in]filenameFilename to read/write corrections from/to

Definition at line 213 of file CECorrections.cpp.

◆ ttut1()

double CECorrections::ttut1 ( const double &  mjd) const

Return the TT-UT1 correction at a given date (in seconds)

Parameters
[in]mjdModified Julian date
Returns
TT-UT1 offset correction parameter at a given MJD (seconds)

Definition at line 159 of file CECorrections.cpp.

◆ TtUt1HistFile()

std::string CECorrections::TtUt1HistFile ( void  ) const
inline

Returns the name of the historic TT-UT1 corrections file.

Returns
Historic TT-UT1 corrections filename

Definition at line 119 of file CECorrections.h.

◆ TtUt1PredFile()

std::string CECorrections::TtUt1PredFile ( void  ) const
inline

Returns the name of the precited TT-UT1 corrections file.

Returns
Predicted TT-UT1 corrections filename

Definition at line 131 of file CECorrections.h.

◆ UpdateNutationCache()

void CECorrections::UpdateNutationCache ( const double &  mjd) const
private

Recompute cached values of nutation valeus if necessary.

Parameters
[in]mjdModified Julian date for lookup

Definition at line 590 of file CECorrections.cpp.

◆ UpdateTtUt1Cache()

void CECorrections::UpdateTtUt1Cache ( const double &  mjd) const
private

Recompute cached values of nutation valeus if necessary.

Parameters
[in]mjdModified Julian date for lookup

Definition at line 654 of file CECorrections.cpp.

◆ xpolar()

double CECorrections::xpolar ( const double &  mjd) const

Return the x-polar motion correction parameter (radians)

Parameters
[in]mjdModified Julian date
Returns
x-polar motion correction parameter (radians)

Definition at line 95 of file CECorrections.cpp.

◆ ypolar()

double CECorrections::ypolar ( const double &  mjd) const

Return the y-polar motion correction parameter (radians)

Parameters
[in]mjdModified Julian date
Returns
y-polar motion correction parameter (radians)

Definition at line 111 of file CECorrections.cpp.

Member Data Documentation

◆ cache_nut_deps_

double CECorrections::cache_nut_deps_
mutableprivate

Definition at line 112 of file CECorrections.h.

◆ cache_nut_dpsi_

double CECorrections::cache_nut_dpsi_
mutableprivate

Definition at line 113 of file CECorrections.h.

◆ cache_nut_dut1_

double CECorrections::cache_nut_dut1_
mutableprivate

Definition at line 109 of file CECorrections.h.

◆ cache_nut_mjd_

double CECorrections::cache_nut_mjd_
mutableprivate

Definition at line 108 of file CECorrections.h.

◆ cache_nut_xp_

double CECorrections::cache_nut_xp_
mutableprivate

Definition at line 110 of file CECorrections.h.

◆ cache_nut_yp_

double CECorrections::cache_nut_yp_
mutableprivate

Definition at line 111 of file CECorrections.h.

◆ cache_ttut1_delt_

double CECorrections::cache_ttut1_delt_
mutableprivate

Definition at line 115 of file CECorrections.h.

◆ cache_ttut1_mjd_

double CECorrections::cache_ttut1_mjd_
mutableprivate

Definition at line 114 of file CECorrections.h.

◆ interp_

bool CECorrections::interp_
private

Definition at line 104 of file CECorrections.h.

◆ nutation_deps_

std::vector<double> CECorrections::nutation_deps_
mutableprivate

Definition at line 95 of file CECorrections.h.

◆ nutation_dpsi_

std::vector<double> CECorrections::nutation_dpsi_
mutableprivate

Definition at line 96 of file CECorrections.h.

◆ nutation_dut1_

std::vector<double> CECorrections::nutation_dut1_
mutableprivate

Definition at line 92 of file CECorrections.h.

◆ nutation_file_

std::string CECorrections::nutation_file_
mutableprivate

File for nutation corrections.

Definition at line 86 of file CECorrections.h.

◆ nutation_mjd_

std::vector<int> CECorrections::nutation_mjd_
mutableprivate

Definition at line 91 of file CECorrections.h.

◆ nutation_xp_

std::vector<double> CECorrections::nutation_xp_
mutableprivate

Definition at line 93 of file CECorrections.h.

◆ nutation_yp_

std::vector<double> CECorrections::nutation_yp_
mutableprivate

Definition at line 94 of file CECorrections.h.

◆ ttut1_delt_

std::vector<double> CECorrections::ttut1_delt_
mutableprivate

Definition at line 99 of file CECorrections.h.

◆ ttut1_file_hist_

std::string CECorrections::ttut1_file_hist_
mutableprivate

File for historic TT-UT1 corrections.

Definition at line 87 of file CECorrections.h.

◆ ttut1_file_pred_

std::string CECorrections::ttut1_file_pred_
mutableprivate

File for predicted TT-UT1 corrections.

Definition at line 88 of file CECorrections.h.

◆ ttut1_mjd_

std::vector<double> CECorrections::ttut1_mjd_
mutableprivate

Definition at line 98 of file CECorrections.h.


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