JPLFile Class Reference

JPL ephem file. More...

#include <orsa_file_jpl.h>

Collaboration diagram for JPLFile:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 JPLFile (std::string)
 ~JPLFile ()
bool GoodFile () const
void GetEph (const UniverseTypeAwareTime &date, JPL_planets target, JPL_planets center, Vector &position, Vector &velocity)
void GetEph (const UniverseTypeAwareTime &date, JPL_planets target, Vector &position, Vector &velocity)
const UniverseTypeAwareTimeEphemStart ()
const UniverseTypeAwareTimeEphemEnd ()
double GetMass (JPL_planets planet)
double GetAU_MKS ()
double GetMSun_MKS ()
double GetMJupiter_MKS ()
double GetMEarth_MKS ()
double GetMMoon_MKS ()
double GetC_MKS ()
double GetREarth_MKS ()
double GetRMoon_MKS ()
double GetTag (std::string)

Detailed Description

JPL ephem file.

Definition at line 100 of file orsa_file_jpl.h.


Constructor & Destructor Documentation

JPLFile ( std::string   ) 
~JPLFile (  ) 

Definition at line 110 of file orsa_file_jpl.cc.

00110                     {
00111     if (jpl_database != 0) jpl_close_ephemeris((jpl_eph_data *)jpl_database);
00112     if (map_tag) delete map_tag;
00113   }


Member Function Documentation

const UniverseTypeAwareTime & EphemEnd (  ) 

Definition at line 120 of file orsa_file_jpl.cc.

Referenced by JPLFile::GetEph(), and orsa::SetupSolarSystem().

00120                                                   {
00121     if (!bool_ephem_end_computed) ComputeEphemEnd();
00122     return ephem_end;
00123   }

const UniverseTypeAwareTime & EphemStart (  ) 

Definition at line 115 of file orsa_file_jpl.cc.

Referenced by JPLFile::GetEph(), and orsa::SetupSolarSystem().

00115                                                     {
00116     if (!bool_ephem_start_computed) ComputeEphemStart();
00117     return ephem_start;
00118   }

double GetAU_MKS (  ) 

Definition at line 137 of file orsa_file_jpl.cc.

References JPLFile::GetTag().

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

00137                             {
00138     return (GetTag("AU")*1.0e3);
00139   }

Here is the call graph for this function:

double GetC_MKS (  ) 

Definition at line 177 of file orsa_file_jpl.cc.

References JPLFile::GetTag().

00177                            {
00178     return (GetTag("CLIGHT")*1.0e3);
00179   }

Here is the call graph for this function:

void GetEph ( const UniverseTypeAwareTime date,
JPL_planets  target,
Vector position,
Vector velocity 
) [inline]

Definition at line 113 of file orsa_file_jpl.h.

References JPLFile::GetEph().

00113                                                                                                                      {
00114       GetEph(date, target, default_ephem_center, position, velocity);       
00115     }

Here is the call graph for this function:

void GetEph ( const UniverseTypeAwareTime date,
JPL_planets  target,
JPL_planets  center,
Vector position,
Vector velocity 
)

Definition at line 255 of file orsa_file_jpl.cc.

References orsa::AU, orsa::DAY, orsa::ECLIPTIC, JPLFile::EphemEnd(), JPLFile::EphemStart(), orsa::ET, orsa::FromUnits(), UniverseTypeAwareTime::GetDate(), Date::GetJulian(), Angle::GetRad(), Universe::GetReferenceSystem(), orsa::LIBRATIONS, orsa::NUTATIONS, orsa::obleq_J2000(), ORSA_WARNING, Vector::rotate(), Vector::Set(), and orsa::universe.

Referenced by JPLFile::GetEph(), JPLBody::JPLBody(), and JPLBody::SetEpoch().

00255                                                                                                                                        {
00256     double  xv[6];   
00257     
00258     jpl_eph_data * jpldb = (jpl_eph_data *) jpl_database;
00259     
00260     if ( (date < EphemStart()) ||
00261          (date > EphemEnd()) ) {
00262       ORSA_WARNING("requested time out of the jpl database range");
00263       return;
00264     }
00265     
00266     jpl_pleph(jpldb,date.GetDate().GetJulian(ET),target,center,xv,calc_velocity ? 1 : 0);
00267     
00268     if ((target==NUTATIONS) || 
00269         (target==LIBRATIONS)) {
00270       // no units correction needed, are radians
00271       position.Set(xv[0],xv[1],xv[2]);
00272       velocity.Set(xv[3],xv[4],xv[5]);
00273       return;
00274     }
00275     
00276     // position (from AU)
00277     xv[0] = FromUnits(xv[0],AU);
00278     xv[1] = FromUnits(xv[1],AU);
00279     xv[2] = FromUnits(xv[2],AU);
00280     //
00281     position.Set(xv[0],xv[1],xv[2]);
00282     
00283     if (calc_velocity) {
00284       // velocity (from AU/DAY)
00285       xv[3] = FromUnits(xv[3],AU);
00286       xv[4] = FromUnits(xv[4],AU);
00287       xv[5] = FromUnits(xv[5],AU);
00288       //
00289       xv[3] = FromUnits(xv[3],DAY,-1);
00290       xv[4] = FromUnits(xv[4],DAY,-1);
00291       xv[5] = FromUnits(xv[5],DAY,-1);
00292       //
00293       velocity.Set(xv[3],xv[4],xv[5]);
00294     }
00295     
00296     // THIS IS THE ONLY CORRECT ROTATION:
00297     // from mean equatorial J2000 (ICRF) to mean ecliptic J2000
00298     if (universe->GetReferenceSystem() == ECLIPTIC) {
00299       Angle obl = obleq_J2000();
00300       position.rotate(0.0,-obl.GetRad(),0.0);
00301       velocity.rotate(0.0,-obl.GetRad(),0.0);
00302     }
00303   }

Here is the call graph for this function:

double GetMass ( JPL_planets  planet  ) 

Definition at line 189 of file orsa_file_jpl.cc.

References orsa::AU, orsa::DAY, orsa::EARTH, orsa::EARTH_MOON_BARYCENTER, orsa::FromUnits(), orsa::GetG(), JPLFile::GetTag(), orsa::JUPITER, orsa::MARS, orsa::MERCURY, orsa::MOON, orsa::NEPTUNE, orsa::PLUTO, orsa::SATURN, orsa::SUN, orsa::URANUS, and orsa::VENUS.

Referenced by orsa::local_mass().

00189                                                   {
00190     
00191     // const double file_G = FromUnits( FromUnits( FromUnits(val[17],AU,3),MSUN,-1),DAY,-2);
00192     // cerr << "JPLFile::GetMass G=" << file_G << endl;
00193     
00194     // const double EMRAT = val[7]; // Earth/Moon mass ratio
00195     const double EMRAT = GetTag("EMRAT");
00196     
00197     double GM=0;
00198     
00199     switch(planet) {
00200     case MERCURY:
00201       GM = GetTag("GM1");
00202       break;
00203     case VENUS:
00204       GM = GetTag("GM2");
00205       break;
00206     case MARS:
00207       GM = GetTag("GM4");
00208       break;
00209     case JUPITER:
00210       GM = GetTag("GM5");
00211       break;
00212     case SATURN:
00213       GM = GetTag("GM6");
00214       break;
00215     case URANUS:
00216       GM = GetTag("GM7");
00217       break;
00218     case NEPTUNE: 
00219       GM = GetTag("GM8");
00220       break;
00221     case PLUTO:   
00222       GM = GetTag("GM9");
00223       break;
00224     case EARTH:
00225       GM = GetTag("GMB")*EMRAT/(1+EMRAT);
00226       break;
00227     case MOON:
00228       GM = GetTag("GMB")/(1+EMRAT);
00229       break;
00230     case EARTH_MOON_BARYCENTER:
00231       GM = GetTag("GMB");
00232       break;
00233     case SUN:
00234       GM = GetTag("GMS");
00235       break;
00236     default:
00237       GM = 0;
00238       break;
00239     }
00240     //
00241     // take the right units
00242     GM = FromUnits(FromUnits(GM,AU,3),DAY,-2);
00243     
00244     // return (GM/file_G);
00245     return (GM/GetG());
00246   }

Here is the call graph for this function:

double GetMEarth_MKS (  ) 

Definition at line 155 of file orsa_file_jpl.cc.

References JPLFile::GetAU_MKS(), orsa::GetG_MKS(), and JPLFile::GetTag().

00155                                 {
00156     // const double EMRAT = val[7]; // Earth/Moon mass ratio
00157     const double EMRAT = GetTag("EMRAT");
00158     // return ((val[10]*EMRAT/(1+EMRAT))*pow(AU_MKS,3)*pow(24*3600.0,-2)/G_MKS);
00159     // return ((GetTag("GMB")*EMRAT/(1+EMRAT))*pow(AU_MKS,3.0)*pow(24*3600.0,-2.0)/G_MKS);
00160     // return ((GetTag("GMB")*EMRAT/(1+EMRAT))*secure_pow(GetAU_MKS(),3.0)*secure_pow(24*3600.0,-2.0)/GetG_MKS());
00161     const double au_mks = GetAU_MKS();
00162     const double day_to_second = 24*3600.0;
00163     return ((GetTag("GMB")*EMRAT/(1+EMRAT))*(au_mks*au_mks*au_mks)/(day_to_second*day_to_second)/GetG_MKS());
00164   }

Here is the call graph for this function:

double GetMJupiter_MKS (  ) 

Definition at line 148 of file orsa_file_jpl.cc.

References JPLFile::GetAU_MKS(), orsa::GetG_MKS(), and JPLFile::GetTag().

00148                                   {
00149     // return (GetTag("GM5")*secure_pow(GetAU_MKS(),3.0)*secure_pow(24*3600.0,-2.0)/GetG_MKS());
00150     const double au_mks = GetAU_MKS();
00151     const double day_to_second = 24*3600.0;
00152     return (GetTag("GM5")*(au_mks*au_mks*au_mks)/(day_to_second*day_to_second)/GetG_MKS());
00153   }

Here is the call graph for this function:

double GetMMoon_MKS (  ) 

Definition at line 166 of file orsa_file_jpl.cc.

References JPLFile::GetAU_MKS(), orsa::GetG_MKS(), and JPLFile::GetTag().

00166                                {
00167     // const double EMRAT = val[7]; // Earth/Moon mass ratio
00168     const double EMRAT = GetTag("EMRAT");
00169     // return ((val[10]/(1+EMRAT))*pow(AU_MKS,3)*pow(24*3600.0,-2)/G_MKS);
00170     // return ((GetTag("GMB")/(1+EMRAT))*pow(AU_MKS,3.0)*pow(24*3600.0,-2.0)/G_MKS);
00171     // return ((GetTag("GMB")/(1+EMRAT))*secure_pow(GetAU_MKS(),3.0)*secure_pow(24*3600.0,-2.0)/GetG_MKS());
00172     const double au_mks = GetAU_MKS();
00173     const double day_to_second = 24*3600.0;
00174     return ((GetTag("GMB")/(1+EMRAT))*(au_mks*au_mks*au_mks)/(day_to_second*day_to_second)/GetG_MKS());
00175   }

Here is the call graph for this function:

double GetMSun_MKS (  ) 

Definition at line 141 of file orsa_file_jpl.cc.

References JPLFile::GetAU_MKS(), orsa::GetG_MKS(), and JPLFile::GetTag().

00141                               {
00142     //return (GetTag("GMS")*secure_pow(GetAU_MKS(),3.0)*secure_pow(24*3600.0,-2.0)/GetG_MKS());
00143     const double au_mks = GetAU_MKS();
00144     const double day_to_second = 24*3600.0;
00145     return (GetTag("GMS")*(au_mks*au_mks*au_mks)/(day_to_second*day_to_second)/GetG_MKS());
00146   }

Here is the call graph for this function:

double GetREarth_MKS (  ) 

Definition at line 181 of file orsa_file_jpl.cc.

References JPLFile::GetTag().

00181                                 {
00182     return (GetTag("RE")*1.0e3);
00183   }

Here is the call graph for this function:

double GetRMoon_MKS (  ) 

Definition at line 185 of file orsa_file_jpl.cc.

References JPLFile::GetTag().

00185                                {
00186     return (GetTag("AM")*1.0e3);
00187   }

Here is the call graph for this function:

double GetTag ( std::string   ) 
bool GoodFile (  )  const [inline]

Definition at line 107 of file orsa_file_jpl.h.

00107                           {
00108       return (jpl_database != 0);
00109     }


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

Generated on Fri Nov 6 11:19:56 2009 for liborsa by  doxygen 1.6.1