orsa_file_jpl.cc File Reference

#include "orsa_file.h"
#include "orsa_error.h"
#include "orsa_secure_math.h"
#include <cstdio>
#include "sdncal.h"
#include "jpleph.h"
#include "jpl_int.h"
#include <iostream>

Include dependency graph for orsa_file_jpl.cc:

Go to the source code of this file.

Namespaces

namespace  orsa

Functions

void SetupSolarSystem (Frame &frame, const list< JPL_planets > &l, const UniverseTypeAwareTime &t)
 The Sun is automatically included.
string JPL_planet_name (const JPL_planets p)
double radius (const JPL_planets p)


Function Documentation

std::string JPL_planet_name const JPL_planets  p  ) 
 

Definition at line 480 of file orsa_file_jpl.cc.

References orsa::EARTH, orsa::EARTH_MOON_BARYCENTER, orsa::JUPITER, orsa::MARS, orsa::MERCURY, orsa::MOON, orsa::NEPTUNE, orsa::PLUTO, orsa::SATURN, orsa::SUN, orsa::URANUS, and orsa::VENUS.

Referenced by JPLBody::JPLBody().

00480                                               {
00481     
00482     string name;
00483     
00484     switch(p) {
00485     case SUN:      name = "Sun";      break;
00486     case MERCURY:  name = "Mercury";  break;
00487     case VENUS:    name = "Venus";    break;
00488     case EARTH:    name = "Earth";    break;
00489     case MARS:     name = "Mars";     break;
00490     case JUPITER:  name = "Jupiter";  break;
00491     case SATURN:   name = "Saturn";   break;
00492     case URANUS:   name = "Uranus";   break;
00493     case NEPTUNE:  name = "Neptune";  break;
00494     case PLUTO:    name = "Pluto";    break;
00495       //
00496     case MOON:                   name = "Moon";                   break;
00497     case EARTH_MOON_BARYCENTER:  name = "Earth-Moon barycenter";  break;
00498       //
00499     default: break;
00500     }
00501     
00502     return (name);
00503   }

double radius const JPL_planets  p  ) 
 

Definition at line 507 of file orsa_file_jpl.cc.

References orsa::EARTH, orsa::FromUnits(), orsa::JUPITER, orsa::KM, orsa::MARS, orsa::MERCURY, orsa::MOON, orsa::NEPTUNE, orsa::PLUTO, orsa::SATURN, orsa::SUN, orsa::URANUS, and orsa::VENUS.

Referenced by Body::Body(), BodyConstants::BodyConstants(), BodyWithEpoch::BodyWithEpoch(), and JPLBody::JPLBody().

00507                                      { 
00508     double r=0;
00509     switch(p) {
00510     case SUN:     r = FromUnits(695000.  ,KM); break;
00511     case MERCURY: r = FromUnits(  2440.  ,KM); break;
00512     case VENUS:   r = FromUnits(  6051.84,KM); break;
00513     case EARTH:   r = FromUnits(  6371.01,KM); break;
00514     case MARS:    r = FromUnits(  3389.92,KM); break;
00515     case JUPITER: r = FromUnits( 69911.  ,KM); break;
00516     case SATURN:  r = FromUnits( 58232.  ,KM); break;
00517     case URANUS:  r = FromUnits( 25362.  ,KM); break;
00518     case NEPTUNE: r = FromUnits( 24624.  ,KM); break;
00519     case PLUTO:   r = FromUnits(  1151.  ,KM); break;
00520       //
00521     case MOON:    r = FromUnits(  1738.  ,KM); break;
00522       //
00523     default: break;
00524     }
00525     return (r);
00526   }

Here is the call graph for this function:

void SetupSolarSystem Frame &  frame,
const list< JPL_planets > &  l,
const UniverseTypeAwareTime &  t
 

The Sun is automatically included.

Definition at line 413 of file orsa_file_jpl.cc.

References orsa::EARTH, orsa::EARTH_AND_MOON, JPLFile::EphemEnd(), JPLFile::EphemStart(), JPLCache::GetJPLBody(), UniverseTypeAwareTime::GetTime(), orsa::jpl_cache, orsa::jpl_file, orsa::MOON, ORSA_WARNING, and orsa::SUN.

Referenced by JPLPlanetsNewton::Acceleration(), JPLPlanetsNewton::PotentialEnergy(), OptimizedOrbitPositions::PropagatedOrbit(), and orsa::PropagatedSky_J2000().

00413                                                                                                      {
00414     
00415     frame.clear();
00416     frame.SetTime(t);
00417     
00418     /* 
00419        string name;
00420        double mass;
00421        Vector r,v;
00422     */
00423     
00424     // date checks
00425     if (t < jpl_file->EphemStart()) { 
00426       ORSA_WARNING("epoch requested is before ephem file start time! (%g < %g)",t.GetTime(),jpl_file->EphemStart().GetTime());
00427       return; 
00428     }
00429     //
00430     if (t > jpl_file->EphemEnd()) {
00431       ORSA_WARNING("epoch requested is after ephem file end time! (%g > %g)",t.GetTime(),jpl_file->EphemStart().GetTime());
00432       return;
00433     }
00434     
00435     // auto include the Sun
00436     // name="Sun"; SetMRV(mass,r,v,jpl_file,t,SUN); frame.push_back(Body(name,mass,r,v));
00437     frame.push_back(jpl_cache->GetJPLBody(SUN,t));
00438     
00439     JPL_planets pl;
00440     list<JPL_planets>::const_iterator it = l.begin();
00441     while (it != l.end()) {
00442       pl = *it;
00443       if (pl==SUN) {
00444         ++it;
00445         continue; // sun already included
00446       } else if (pl==EARTH_AND_MOON) {
00447         // pl = EARTH; name = JPL_planet_name(pl); SetMRV(mass,r,v,jpl_file,t,pl);  frame.push_back(Body(name,mass,r,v));
00448         frame.push_back(jpl_cache->GetJPLBody(EARTH,t));
00449         // pl = MOON;  name = JPL_planet_name(pl); SetMRV(mass,r,v,jpl_file,t,pl);  frame.push_back(Body(name,mass,r,v));
00450         frame.push_back(jpl_cache->GetJPLBody(MOON,t));
00451       } else {
00452         // name = JPL_planet_name(pl); SetMRV(mass,r,v,jpl_file,t,pl); frame.push_back(Body(name,mass,r,v));
00453         frame.push_back(jpl_cache->GetJPLBody(pl,t));
00454       }
00455       ++it;
00456     }    
00457   }

Here is the call graph for this function:


Generated on Tue Jan 11 15:26:53 2005 for liborsa by  doxygen 1.4.0