orsa_units.cc File Reference

#include "orsa_units.h"
#include "sdncal.h"
#include "orsa_common.h"
#include "orsa_universe.h"
#include "orsa_file.h"
#include <vector>
#include <string>
#include <iostream>
#include <time.h>
#include "support.h"

Include dependency graph for orsa_units.cc:

Go to the source code of this file.

Namespaces

namespace  orsa

Functions

bool operator== (const TAI_minus_UTC_element &x, const TAI_minus_UTC_element &y)
bool operator!= (const TAI_minus_UTC_element &x, const TAI_minus_UTC_element &y)
bool operator== (const ET_minus_UT_element &x, const ET_minus_UT_element &y)
bool operator!= (const ET_minus_UT_element &x, const ET_minus_UT_element &y)
string TimeScaleLabel (TimeScale ts)
UniverseTypeAwareTimeStep operator * (const double x, const UniverseTypeAwareTimeStep &ts)
UniverseTypeAwareTimeStep operator * (const UniverseTypeAwareTimeStep &ts, const double x)
UniverseTypeAwareTimeStep operator * (const int i, const UniverseTypeAwareTimeStep &ts)
UniverseTypeAwareTimeStep operator * (const UniverseTypeAwareTimeStep &ts, const int i)
Angle obleq (const Date &date)
Angle gmst (const Date &date)
Angle obleq_J2000 ()
void EclipticToEquatorial (Vector &v, const Date &date)
void EquatorialToEcliptic (Vector &v, const Date &date)
void EclipticToEquatorial_J2000 (Vector &v)
void EquatorialToEcliptic_J2000 (Vector &v)
static void alpha_delta_meridian_moon (const Date &date, Angle &alpha_zero, Angle &delta_zero, Angle &W)
void alpha_delta_meridian (const JPL_planets p, const Date &date, Angle &alpha_zero, Angle &delta_zero, Angle &W)

Variables

const double G_MKS = 6.67259e-11
const double MSUN_MKS = 1.9889e30
const double MJUPITER_MKS = 1.8989e27
const double MEARTH_MKS = 5.9742e24
const double MMOON_MKS = 7.3483e22
const double AU_MKS = 1.49597870660e11
const double c_MKS = 299792458.0
const double R_EARTH_MKS = 6378140.0
const double R_MOON_MKS = 1737400.0
TimeScale default_Date_timescale = TT
const TAI_minus_UTC_element TAI_minus_UTC_table_final_element = {0,0,0,0}
const TAI_minus_UTC_element TAI_minus_UTC_table []
const ET_minus_UT_element ET_minus_UT_table_final_element = {0,0,0,0}
const ET_minus_UT_element ET_minus_UT_table []


Function Documentation

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

Definition at line 2046 of file orsa_units.cc.

References orsa::alpha_delta_meridian_moon(), orsa::cos(), orsa::EARTH, Date::GetJulian(), orsa::JUPITER, orsa::MARS, orsa::MERCURY, orsa::MOON, orsa::NEPTUNE, orsa::PLUTO, orsa::SATURN, Angle::SetDPS(), Date::SetJ2000(), Angle::SetRad(), orsa::sin(), orsa::SUN, orsa::URANUS, and orsa::VENUS.

Referenced by Newton::Acceleration().

02047                                                                                {
02048     
02049     Date tmp_date; 
02050     tmp_date.SetJ2000();
02051     const Date date_J2000(tmp_date);
02052     
02053     // CHECK TIMESCALES!!
02054     const double d = (date.GetJulian()-date_J2000.GetJulian());
02055     const double T = d / 36525.0;
02056     
02057     switch (p) {
02058     case SUN:   
02059       alpha_zero.SetDPS(286.13,0,0);
02060       delta_zero.SetDPS(63.87,0,0);
02061       W.SetDPS(84.10+14.1844000*d,0,0);
02062       break;
02063     case MERCURY: 
02064       alpha_zero.SetDPS(281.01-0.033*T,0,0);
02065       delta_zero.SetDPS(61.45-0.005*T,0,0);
02066       W.SetDPS(329.548+6.1385025*d,0,0);
02067       break;
02068     case VENUS:  
02069       alpha_zero.SetDPS(272.76,0,0);
02070       delta_zero.SetDPS(67.16,0,0);
02071       W.SetDPS(160.20-1.4813688*d,0,0);
02072       break;
02073     case EARTH:
02074       alpha_zero.SetDPS(0.0-0.641*T,0,0);
02075       delta_zero.SetDPS(90.0-0.557*T,0,0);
02076       W.SetDPS(190.147+360.9856235*d,0,0);
02077       break;
02078     case MOON:
02079       alpha_delta_meridian_moon(date,alpha_zero,delta_zero,W);
02080       break;
02081     case MARS:   
02082       alpha_zero.SetDPS(317.68143-0.1061*T,0,0);
02083       delta_zero.SetDPS(52.88650-0.0609*T,0,0);
02084       W.SetDPS(176.630+350.89198226*d,0,0);
02085       break;
02086     case JUPITER: 
02087       alpha_zero.SetDPS(268.05-0.009*T,0,0);
02088       delta_zero.SetDPS(64.49+0.003*T,0,0);
02089       W.SetDPS(284.95+870.5366420*d,0,0);
02090       break;
02091     case SATURN:  
02092       alpha_zero.SetDPS(40.589-0.036*T,0,0);
02093       delta_zero.SetDPS(83.537-0.004*T,0,0);
02094       W.SetDPS(38.90+810.7939024*d,0,0);
02095       break;
02096     case URANUS: 
02097       alpha_zero.SetDPS(257.311,0,0);
02098       delta_zero.SetDPS(-15.175,0,0);
02099       W.SetDPS(203.81-501.1600928*d,0,0);
02100       break;
02101     case NEPTUNE:
02102       {
02103         Angle N;
02104         N.SetDPS(357.85+52.316*T,0,0);
02105         //
02106         alpha_zero.SetDPS(299.36+0.70*sin(N),0,0);
02107         delta_zero.SetDPS(43.46-0.51*cos(N),0,0);
02108         W.SetDPS(253.18+536.3128492*d-0.48*sin(N),0,0);
02109       }
02110       break;
02111     case PLUTO: 
02112       alpha_zero.SetDPS(313.02,0,0);
02113       delta_zero.SetDPS(9.09,0,0);
02114       W.SetDPS(236.77-56.3623195*d,0,0);
02115       break;
02116       //
02117     default: 
02118       alpha_zero.SetRad(0.0);
02119       delta_zero.SetRad(0.0);
02120       W.SetRad(0.0);
02121       break;
02122     }
02123   }

Here is the call graph for this function:

static void alpha_delta_meridian_moon const Date &  date,
Angle &  alpha_zero,
Angle &  delta_zero,
Angle &  W
[static]
 

Definition at line 1982 of file orsa_units.cc.

References orsa::cos(), orsa::E1(), Date::GetJulian(), Angle::SetDPS(), Date::SetJ2000(), and orsa::sin().

Referenced by orsa::alpha_delta_meridian().

01983                                                                                            {
01984     Date tmp_date; 
01985     tmp_date.SetJ2000();
01986     const Date date_J2000(tmp_date);
01987     
01988     const double d = (date.GetJulian()-date_J2000.GetJulian());
01989     const double T = d / 36525.0;
01990     
01991     Angle E1, E2, E3, E4, E5, E6, E7, E8, E9, E10, E11, E12, E13;
01992     
01993     E1.SetDPS( 125.045 -  0.0529921*d,0,0);
01994     E2.SetDPS( 250.089 -  0.1059842*d,0,0);
01995     E3.SetDPS( 260.008 + 13.0120009*d,0,0);
01996     E4.SetDPS( 176.625 + 13.3407154*d,0,0);
01997     E5.SetDPS( 357.529 +  0.9856003*d,0,0);
01998     E6.SetDPS( 311.589 + 26.4057084*d,0,0);
01999     E7.SetDPS( 134.963 + 13.0649930*d,0,0);
02000     E8.SetDPS( 276.617 +  0.3287146*d,0,0);
02001     E9.SetDPS(  34.226 +  1.7484877*d,0,0);
02002     E10.SetDPS( 15.134 -  0.1589763*d,0,0);
02003     E11.SetDPS(119.743 +  0.0036096*d,0,0);
02004     E12.SetDPS(239.961 +  0.1643573*d,0,0);
02005     E13.SetDPS( 25.053 + 12.9590088*d,0,0);
02006     
02007     alpha_zero.SetDPS(269.9949 
02008                       + 0.0031*T
02009                       - 3.8787*sin(E1)
02010                       - 0.1204*sin(E2)
02011                       + 0.0700*sin(E3)
02012                       - 0.0172*sin(E4)
02013                       + 0.0072*sin(E6)
02014                       - 0.0052*sin(E10)
02015                       + 0.0043*sin(E13),0,0);
02016     
02017     delta_zero.SetDPS(66.5392
02018                       + 0.0130*T
02019                       + 1.5419*cos(E1)
02020                       + 0.0239*cos(E2)
02021                       - 0.0278*cos(E3)
02022                       + 0.0068*cos(E4)
02023                       - 0.0029*cos(E6)
02024                       + 0.0009*cos(E7)
02025                       + 0.0008*cos(E10)
02026                       - 0.0009*cos(E13),0,0);
02027     
02028     W.SetDPS(38.3213
02029              + 13.17635815*d
02030              -  1.4e-12*d*d
02031              +  3.5610*sin(E1)
02032              +  0.1208*sin(E2)
02033              -  0.0642*sin(E3)
02034              +  0.0158*sin(E4)
02035              +  0.0252*sin(E5)
02036              -  0.0066*sin(E6)
02037              -  0.0047*sin(E7)
02038              -  0.0046*sin(E8)
02039              +  0.0028*sin(E9)
02040              +  0.0052*sin(E10)
02041              +  0.0040*sin(E11)
02042              +  0.0019*sin(E12)
02043              -  0.0044*sin(E13),0,0);
02044   }

Here is the call graph for this function:

void EclipticToEquatorial Vector &  v,
const Date &  date
 

Definition at line 1965 of file orsa_units.cc.

References orsa::obleq().

01965                                                          {
01966     v.rotate(0,obleq(date).GetRad(),0);  
01967   }

Here is the call graph for this function:

void EclipticToEquatorial_J2000 Vector &  v  ) 
 

Definition at line 1973 of file orsa_units.cc.

References orsa::obleq_J2000().

Referenced by Sky::Compute_J2000(), NEODYSCAT::Read(), JPLDastcomCometFile::Read(), JPLDastcomUnnumFile::Read(), JPLDastcomNumFile::Read(), AstDySMatrixFile::Read(), MPCCometFile::Read(), MPCOrbFile::Read(), and AstorbFile::Read().

01973                                              {
01974     v.rotate(0,obleq_J2000().GetRad(),0);  
01975   }

Here is the call graph for this function:

void EquatorialToEcliptic Vector &  v,
const Date &  date
 

Definition at line 1969 of file orsa_units.cc.

References orsa::obleq().

01969                                                          {
01970     v.rotate(0,-obleq(date).GetRad(),0);  
01971   }

Here is the call graph for this function:

void EquatorialToEcliptic_J2000 Vector &  v  ) 
 

Definition at line 1977 of file orsa_units.cc.

References orsa::obleq_J2000().

Referenced by LocationFile::ObsPos().

01977                                              {
01978     v.rotate(0,-obleq_J2000().GetRad(),0);  
01979   }

Here is the call graph for this function:

Angle gmst const Date &  date  ) 
 

Definition at line 1896 of file orsa_units.cc.

References Date::GetDayFraction(), Date::GetJulian(), Angle::SetHMS(), and orsa::UT.

Referenced by LocationFile::ObsPos().

01896                                {
01897     // tested using xephem, very good agreement!
01898     // T in centuries from JD 2451545.0 UT1=UT
01899     Date d = date;
01900     // d.ConvertToTimeScale(UT); // UT or UTC ??
01901     // const double T = (d.GetJulian() - 2451545.0)/36525.0;
01902     const double T = (d.GetJulian(UT) - 2451545.0)/36525.0;
01903     Angle a;
01904     a.SetHMS(d.GetDayFraction()*24+6,41,50.54841+((-0.0000062*T+0.093104)*T+8640184.812866)*T);
01905     return a;
01906   }

Here is the call graph for this function:

Angle obleq const Date &  date  ) 
 

Definition at line 1851 of file orsa_units.cc.

References Date::GetJulian(), Angle::SetDPS(), and orsa::UT.

Referenced by orsa::EclipticToEquatorial(), orsa::EquatorialToEcliptic(), and orsa::obleq_J2000().

01851                                 {
01852     // T in centuries from J2000 
01853     Date d = date;
01854     // d.ConvertToTimeScale(UT); // UT or UTC ??
01855     // const double T = (d.GetJulian() - 2451545.0)/36525.0;
01856     // DOUBLE-CHECK this "UT"!!!
01857     const double T = (d.GetJulian(UT) - 2451545.0)/36525.0;
01858     Angle a;
01859     // updated Feb 2004
01860     a.SetDPS(23,26,21.448+((0.001813*T-0.00059)*T-46.8150)*T);
01861     return a;
01862   }

Here is the call graph for this function:

Angle obleq_J2000  ) 
 

Definition at line 1909 of file orsa_units.cc.

References orsa::obleq(), and Date::SetJ2000().

Referenced by Newton::Acceleration(), orsa::Compute_Gauss(), orsa::Compute_TestMethod(), orsa::EclipticToEquatorial_J2000(), orsa::EquatorialToEcliptic_J2000(), JPLFile::GetEph(), and TLEFile::Read().

01909                       {
01910     Date d; d.SetJ2000();
01911     return obleq(d);
01912   }

Here is the call graph for this function:

UniverseTypeAwareTimeStep operator * const UniverseTypeAwareTimeStep &  ts,
const int  i
 

Definition at line 1572 of file orsa_units.cc.

01572                                                                                            {
01573     UniverseTypeAwareTimeStep _ts(ts);
01574     _ts *= i;
01575     return _ts; 
01576   }

UniverseTypeAwareTimeStep operator * const int  i,
const UniverseTypeAwareTimeStep &  ts
 

Definition at line 1566 of file orsa_units.cc.

01566                                                                                            {
01567     UniverseTypeAwareTimeStep _ts(ts);
01568     _ts *= i;
01569     return _ts; 
01570   }

UniverseTypeAwareTimeStep operator * const UniverseTypeAwareTimeStep &  ts,
const double  x
 

Definition at line 1560 of file orsa_units.cc.

01560                                                                                               {
01561     UniverseTypeAwareTimeStep _ts(ts);
01562     _ts *= x;
01563     return _ts; 
01564   }

UniverseTypeAwareTimeStep operator * const double  x,
const UniverseTypeAwareTimeStep &  ts
 

Definition at line 1554 of file orsa_units.cc.

01554                                                                                               {
01555     UniverseTypeAwareTimeStep _ts(ts);
01556     _ts *= x;
01557     return _ts;
01558   }

bool operator!= const ET_minus_UT_element &  x,
const ET_minus_UT_element &  y
[inline]
 

Definition at line 288 of file orsa_units.cc.

00288                                                                                        {
00289     return (!(x==y));
00290   }

bool operator!= const TAI_minus_UTC_element &  x,
const TAI_minus_UTC_element &  y
[inline]
 

Definition at line 233 of file orsa_units.cc.

00233                                                                                            {
00234     return (!(x==y));
00235   }

bool operator== const ET_minus_UT_element &  x,
const ET_minus_UT_element &  y
[inline]
 

Definition at line 280 of file orsa_units.cc.

00280                                                                                        {
00281     if (x.day   != y.day)   return false;
00282     if (x.month != y.month) return false;
00283     if (x.year  != y.year)  return false;
00284     if (x.ET_minus_UT != y.ET_minus_UT) return false;
00285     return true;
00286   }

bool operator== const TAI_minus_UTC_element &  x,
const TAI_minus_UTC_element &  y
[inline]
 

Definition at line 225 of file orsa_units.cc.

00225                                                                                            {
00226     if (x.day   != y.day)   return false;
00227     if (x.month != y.month) return false;
00228     if (x.year  != y.year)  return false;
00229     if (x.TAI_minus_UTC != y.TAI_minus_UTC) return false;
00230     return true;
00231   }

std::string TimeScaleLabel TimeScale  ts  ) 
 

Definition at line 896 of file orsa_units.cc.

References orsa::ET, orsa::GPS, orsa::TAI, orsa::TDT, orsa::UT, orsa::UT1, and orsa::UTC.

00896                                       {
00897     if (ts==UTC) return "UTC";
00898     if (ts==UT)  return "UT";
00899     if (ts==UT1) return "UT1";
00900     if (ts==TAI) return "TAI";
00901     if (ts==TDT) return "TDT";
00902     if (ts==ET)  return "ET";
00903     if (ts==GPS) return "GPS";     
00904     return "";
00905   }


Variable Documentation

const double AU_MKS = 1.49597870660e11
 

Definition at line 50 of file orsa_units.cc.

const double c_MKS = 299792458.0
 

Definition at line 51 of file orsa_units.cc.

TimeScale default_Date_timescale = TT
 

Definition at line 218 of file orsa_units.cc.

const ET_minus_UT_element ET_minus_UT_table[]
 

Definition at line 298 of file orsa_units.cc.

Referenced by Date::delta_seconds().

const ET_minus_UT_element ET_minus_UT_table_final_element = {0,0,0,0}
 

Definition at line 297 of file orsa_units.cc.

Referenced by Date::delta_seconds().

const double G_MKS = 6.67259e-11
 

Definition at line 45 of file orsa_units.cc.

Referenced by Units::GetG_MKS().

const double MEARTH_MKS = 5.9742e24
 

Definition at line 48 of file orsa_units.cc.

const double MJUPITER_MKS = 1.8989e27
 

Definition at line 47 of file orsa_units.cc.

const double MMOON_MKS = 7.3483e22
 

Definition at line 49 of file orsa_units.cc.

const double MSUN_MKS = 1.9889e30
 

Definition at line 46 of file orsa_units.cc.

const double R_EARTH_MKS = 6378140.0
 

Definition at line 52 of file orsa_units.cc.

const double R_MOON_MKS = 1737400.0
 

Definition at line 53 of file orsa_units.cc.

const TAI_minus_UTC_element TAI_minus_UTC_table[]
 

Initial value:

 {
    {1,1,1972,10},
    {1,7,1972,11},
    {1,1,1973,12},
    {1,1,1974,13},
    {1,1,1975,14},
    {1,1,1976,15},
    {1,1,1977,16},
    {1,1,1978,17},
    {1,1,1979,18},
    {1,1,1980,19},
    {1,7,1981,20},
    {1,7,1982,21},
    {1,7,1983,22},
    {1,7,1985,23},
    {1,1,1988,24},
    {1,1,1990,25},
    {1,1,1991,26},
    {1,7,1992,27},
    {1,7,1993,28},
    {1,7,1994,29},
    {1,1,1996,30},
    {1,7,1997,31},
    {1,1,1999,32}, 
    {0,0,0,0} 
  }

Definition at line 248 of file orsa_units.cc.

Referenced by Date::delta_seconds().

const TAI_minus_UTC_element TAI_minus_UTC_table_final_element = {0,0,0,0}
 

Definition at line 247 of file orsa_units.cc.

Referenced by Date::delta_seconds().


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