orsa_units.h File Reference

#include <cmath>
#include <string>
#include <cstdio>
#include "orsa_secure_math.h"
#include "orsa_coord.h"
#include "orsa_error.h"
#include "orsa_file_jpl.h"

Include dependency graph for orsa_units.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  orsa

Enumerations

enum  time_unit {
  YEAR = 1, DAY = 2, HOUR = 3, MINUTE = 4,
  SECOND = 5
}
enum  length_unit {
  MPARSEC = 1, KPARSEC = 2, PARSEC = 3, LY = 4,
  AU = 5, EARTHMOON = 6, REARTH = 7, RMOON = 8,
  KM = 9, M = 10, CM = 11, LD = EARTHMOON,
  ER = REARTH, MR = RMOON
}
enum  mass_unit {
  MSUN = 1, MJUPITER = 2, MEARTH = 3, MMOON = 4,
  KG = 5, GRAM = 6
}
enum  TimeScale {
  UTC = 1, UT = 2, TAI = 3, TDT = 4,
  GPS = 5, UT1 = UT, ET = TDT, TT = TDT
}
 TimeScale enum, useful only when using a Real Universe. More information can be obtained here: http://www.hartrao.ac.za/nccsdoc/slalib/sun67.htx/node217.html. More...
enum  ReferenceSystem { EQUATORIAL = 1, ECLIPTIC = 2 }

Functions

void convert (time_unit &tu, const unsigned int i)
void convert (length_unit &lu, const unsigned int i)
void convert (mass_unit &mu, const unsigned int i)
double GetG ()
double GetG_MKS ()
double GetMSun ()
double GetC ()
double FromUnits (const double, const time_unit, const int=1)
std::string TimeLabel ()
std::string LengthLabel ()
std::string MassLabel ()
void convert (TimeScale &ts, const unsigned int i)
UniverseTypeAwareTimeStep operator * (const int, const UniverseTypeAwareTimeStep &)
UniverseTypeAwareTimeStep operator * (const UniverseTypeAwareTimeStep &, const int)
double sin (const Angle &alpha)
double cos (const Angle &alpha)
double tan (const Angle &alpha)
void sincos (const Angle &alpha, double &s, double &c)
void convert (ReferenceSystem &rs, const unsigned int i)
void alpha_delta_meridian (const JPL_planets, const Date &, Angle &alpha_zero, Angle &delta_zero, Angle &W)

Variables

Units * units = 0


Enumeration Type Documentation

enum length_unit
 

Enumeration values:
MPARSEC 
KPARSEC 
PARSEC 
LY 
AU 
EARTHMOON 
REARTH 
RMOON 
KM 
M 
CM 
LD 
ER 
MR 

Definition at line 60 of file orsa_units.h.

00060                    {
00061     MPARSEC=1,
00062     KPARSEC=2,
00063     PARSEC=3,
00064     LY=4,
00065     AU=5,
00066     EARTHMOON=6,
00067     REARTH=7,
00068     RMOON=8,
00069     KM=9,
00070     M=10,
00071     CM=11,
00072     // aliases
00073     LD=EARTHMOON,
00074     ER=REARTH,
00075     MR=RMOON
00076   };

enum mass_unit
 

Enumeration values:
MSUN 
MJUPITER 
MEARTH 
MMOON 
KG 
GRAM 

Definition at line 98 of file orsa_units.h.

00098                  {
00099     MSUN=1,
00100     MJUPITER=2,
00101     MEARTH=3,
00102     MMOON=4,
00103     KG=5,
00104     GRAM=6
00105   };

enum ReferenceSystem
 

Enumeration values:
EQUATORIAL 
ECLIPTIC 

Definition at line 585 of file orsa_units.h.

00585                        {
00586     EQUATORIAL=1,
00587     ECLIPTIC=2
00588   };

enum time_unit
 

Enumeration values:
YEAR 
DAY 
HOUR 
MINUTE 
SECOND 

Definition at line 38 of file orsa_units.h.

00038                  {
00039     YEAR=1,
00040     DAY=2,
00041     HOUR=3,
00042     MINUTE=4,
00043     SECOND=5
00044   };

enum TimeScale
 

TimeScale enum, useful only when using a Real Universe. More information can be obtained here: http://www.hartrao.ac.za/nccsdoc/slalib/sun67.htx/node217.html.

Enumeration values:
UTC 
UT 
TAI 
TDT 
GPS 
UT1 
ET 
TT 

Definition at line 250 of file orsa_units.h.

00250                  {
00251     UTC=1,
00252     UT=2,
00253     TAI=3,
00254     TDT=4,
00255     GPS=5,
00256     // aliases
00257     UT1=UT,
00258     ET=TDT,
00259     TT=TDT
00260   };


Function Documentation

void alpha_delta_meridian const   JPL_planets,
const Date &  ,
Angle &  alpha_zero,
Angle &  delta_zero,
Angle &  W
 

void convert ReferenceSystem rs,
const unsigned int  i
[inline]
 

Definition at line 590 of file orsa_units.h.

References orsa::ECLIPTIC, orsa::EQUATORIAL, and ORSA_ERROR.

00590                                                                   {
00591     switch(i) {
00592     case 1: rs = EQUATORIAL; break;
00593     case 2: rs = ECLIPTIC; break;
00594       //
00595     default:
00596       ORSA_ERROR("conversion problem: i = %i",i);
00597       break;
00598     }
00599   }

void convert TimeScale ts,
const unsigned int  i
[inline]
 

Definition at line 262 of file orsa_units.h.

References orsa::GPS, ORSA_ERROR, orsa::TAI, orsa::TDT, orsa::UT, and orsa::UTC.

00262                                                             {
00263     switch(i) {
00264     case 1: ts = UTC; break;
00265     case 2: ts = UT;  break;
00266     case 3: ts = TAI; break;
00267     case 4: ts = TDT; break;
00268     case 5: ts = GPS; break;
00269       //
00270     default:
00271       ORSA_ERROR("conversion problem: i = %i",i);
00272       break;       
00273     }
00274   }

void convert mass_unit mu,
const unsigned int  i
[inline]
 

Definition at line 107 of file orsa_units.h.

References orsa::GRAM, orsa::KG, orsa::MEARTH, orsa::MJUPITER, orsa::MMOON, orsa::MSUN, and ORSA_ERROR.

00107                                                             {
00108     switch(i) {
00109     case 1: mu = MSUN;     break;
00110     case 2: mu = MJUPITER; break;
00111     case 3: mu = MEARTH;   break;
00112     case 4: mu = MMOON;    break;
00113     case 5: mu = KG;       break;
00114     case 6: mu = GRAM;     break;    
00115       //
00116     default:
00117       ORSA_ERROR("conversion problem: i = %i",i);
00118       break;       
00119     }
00120   }

void convert length_unit lu,
const unsigned int  i
[inline]
 

Definition at line 78 of file orsa_units.h.

References orsa::AU, orsa::CM, orsa::EARTHMOON, orsa::KM, orsa::KPARSEC, orsa::LY, orsa::M, orsa::MPARSEC, ORSA_ERROR, orsa::PARSEC, orsa::REARTH, and orsa::RMOON.

00078                                                               {
00079     switch(i) {
00080     case 1:  lu = MPARSEC;   break;
00081     case 2:  lu = KPARSEC;   break;
00082     case 3:  lu = PARSEC;    break;
00083     case 4:  lu = LY;        break;
00084     case 5:  lu = AU;        break;
00085     case 6:  lu = EARTHMOON; break;
00086     case 7:  lu = REARTH;    break;
00087     case 8:  lu = RMOON;     break;
00088     case 9:  lu = KM;        break;
00089     case 10: lu = M;         break;
00090     case 11: lu = CM;        break;
00091       //
00092     default:
00093       ORSA_ERROR("conversion problem: i = %i",i);
00094       break;       
00095     }
00096   }

void convert time_unit tu,
const unsigned int  i
[inline]
 

Definition at line 46 of file orsa_units.h.

References orsa::DAY, orsa::HOUR, orsa::MINUTE, ORSA_ERROR, orsa::SECOND, and orsa::YEAR.

00046                                                             {
00047     switch(i) {
00048     case 1: tu = YEAR;   break;
00049     case 2: tu = DAY;    break;
00050     case 3: tu = HOUR;   break;
00051     case 4: tu = MINUTE; break;
00052     case 5: tu = SECOND; break;
00053       //
00054     default:
00055       ORSA_ERROR("conversion problem: i = %i",i);
00056       break;       
00057     }
00058   }

double cos const Angle &  alpha  )  [inline]
 

Definition at line 566 of file orsa_units.h.

Referenced by orsa::alpha_delta_meridian(), orsa::alpha_delta_meridian_moon(), orsa::apply_window(), Orbit::Compute(), orsa::Compute_Gauss(), orsa::Compute_TestMethod(), orsa::dQ(), OrbitWithCovarianceMatrixGSL::GenerateUsingCholeskyDecomposition(), OrbitWithCovarianceMatrixGSL::GenerateUsingPrincipalAxisTransformation(), Orbit::GetE(), LocationFile::ObsPos(), orsa::phi(), orsa::phi_Hanning(), Orbit::RelativePosVel(), Vector::rotate(), and orsa::sincos().

00566                                          {
00567     return std::cos(alpha.GetRad());
00568   }

double FromUnits const   double,
const   time_unit,
const   int = 1
 

Referenced by orsa::BuildObservationTriplets(), orsa::Compute(), orsa::Compute_Gauss(), orsa::Compute_TestMethod(), Evolution::Evolution(), GalacticPotentialAllen::GalacticPotentialAllen(), TimeStep::GetDouble(), JPLFile::GetEph(), JPLFile::GetMass(), Date::GetTime(), Evolution::Integrate(), TimeStep::operator *=(), orsa::poly_8_gsl_solve(), OptimizedOrbitPositions::PropagatedOrbit(), orsa::PropagatedSky_J2000(), orsa::radius(), Mercury5IntegrationFile::Read(), TLEFile::Read(), NEODYSCAT::Read(), JPLDastcomCometFile::Read(), JPLDastcomUnnumFile::Read(), JPLDastcomNumFile::Read(), RadauModIntegrationFile::Read(), LocationFile::Read(), MPCCometFile::Read(), MPCOrbFile::Read(), AstorbFile::Read(), UniverseTypeAwareTime::SetTime(), Date::SetTime(), orsa::StartFrame(), orsa::SWIFTRawReadBinaryFile(), Date::Time(), TimeStep::TimeStep(), and orsa::Weight().

double GetC  ) 
 

Definition at line 127 of file orsa_universe.cc.

Referenced by orsa::Compute_Gauss(), orsa::modified_mu(), Newton::Newton(), OptimizedOrbitPositions::PropagatedSky_J2000(), orsa::PropagatedSky_J2000(), and Relativistic::Relativistic().

00127 { return (orsa::units->GetC()); }

double GetG  ) 
 

Definition at line 124 of file orsa_universe.cc.

Referenced by BodyConstants::BodyConstants(), Orbit::Compute(), orsa::Compute_Gauss(), orsa::Compute_TestMethod(), GalacticPotentialAllen::GalacticPotentialAllen(), orsa::gauss_v_df(), orsa::gauss_v_diff_f(), orsa::gauss_v_f(), JPLFile::GetMass(), GravitationalTree::GravitationalTree(), JPLPlanetsNewton::JPLPlanetsNewton(), orsa::least_sq_df(), orsa::least_sq_f(), OptimizedOrbitPositions::PropagatedOrbit(), TLEFile::Read(), NEODYSCAT::Read(), JPLDastcomCometFile::Read(), JPLDastcomUnnumFile::Read(), JPLDastcomNumFile::Read(), AstDySMatrixFile::Read(), MPCCometFile::Read(), MPCOrbFile::Read(), AstorbFile::Read(), and Relativistic::Relativistic().

00124 { return (orsa::units->GetG()); }

double GetG_MKS  ) 
 

Definition at line 125 of file orsa_universe.cc.

Referenced by JPLFile::GetMEarth_MKS(), JPLFile::GetMJupiter_MKS(), JPLFile::GetMMoon_MKS(), and JPLFile::GetMSun_MKS().

00125 { return (orsa::units->GetG_MKS()); }

double GetMSun  ) 
 

Definition at line 126 of file orsa_universe.cc.

Referenced by orsa::Compute_Gauss(), orsa::Compute_TestMethod(), orsa::gauss_v_df(), orsa::gauss_v_diff_f(), orsa::gauss_v_f(), orsa::least_sq_df(), orsa::least_sq_f(), OptimizedOrbitPositions::PropagatedOrbit(), NEODYSCAT::Read(), JPLDastcomCometFile::Read(), JPLDastcomUnnumFile::Read(), JPLDastcomNumFile::Read(), AstDySMatrixFile::Read(), MPCCometFile::Read(), MPCOrbFile::Read(), and AstorbFile::Read().

00126 { return (orsa::units->GetMSun()); }

string LengthLabel  ) 
 

Definition at line 140 of file orsa_universe.cc.

Referenced by OrsaFile::Read().

00140 { return orsa::units->LengthLabel(); };

string MassLabel  ) 
 

Definition at line 141 of file orsa_universe.cc.

Referenced by OrsaFile::Read().

00141 { return orsa::units->MassLabel();   };

UniverseTypeAwareTimeStep operator * const UniverseTypeAwareTimeStep &  ,
const   int
 

UniverseTypeAwareTimeStep operator * const   int,
const UniverseTypeAwareTimeStep & 
 

double sin const Angle &  alpha  )  [inline]
 

Definition at line 562 of file orsa_units.h.

Referenced by orsa::alpha_delta_meridian(), orsa::alpha_delta_meridian_moon(), Orbit::Compute(), orsa::Compute_Gauss(), orsa::Compute_TestMethod(), orsa::dQ(), OrbitWithCovarianceMatrixGSL::GenerateUsingCholeskyDecomposition(), OrbitWithCovarianceMatrixGSL::GenerateUsingPrincipalAxisTransformation(), Orbit::GetE(), LocationFile::ObsPos(), orsa::phi(), orsa::phi_Hanning(), Units::Recompute(), Orbit::RelativePosVel(), Vector::rotate(), and orsa::sincos().

00562                                          {
00563     return std::sin(alpha.GetRad());
00564   }

void sincos const Angle &  alpha,
double &  s,
double &  c
[inline]
 

Definition at line 574 of file orsa_units.h.

References orsa::cos(), and orsa::sin().

Referenced by Newton::Acceleration(), Vector::rotate(), and orsa::unit_vector().

00574                                                                   {
00575 #ifdef HAVE_SINCOS
00576     ::sincos(alpha.GetRad(),&s,&c); 
00577 #else // HAVE_SINCOS
00578     s = std::sin(alpha.GetRad());
00579     c = std::cos(alpha.GetRad());
00580 #endif // ! HAVE_SINCOS
00581   }

Here is the call graph for this function:

double tan const Angle &  alpha  )  [inline]
 

Definition at line 570 of file orsa_units.h.

Referenced by Orbit::Compute(), OrbitWithCovarianceMatrixGSL::GenerateUsingCholeskyDecomposition(), and OrbitWithCovarianceMatrixGSL::GenerateUsingPrincipalAxisTransformation().

00570                                          {
00571     return std::tan(alpha.GetRad());
00572   }

string TimeLabel  ) 
 

Definition at line 139 of file orsa_universe.cc.

Referenced by OrsaFile::Read().

00139 { return orsa::units->TimeLabel();   };


Variable Documentation

Units * units = 0
 

Definition at line 39 of file orsa_universe.cc.

Referenced by OrsaFile::Write().


Generated on Tue Jan 11 15:27:46 2005 for liborsa by  doxygen 1.4.0