#include <orsa_file_jpl.h>
Collaboration diagram for JPLFile:
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 UniverseTypeAwareTime & | EphemStart () |
const UniverseTypeAwareTime & | EphemEnd () |
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) |
Definition at line 100 of file orsa_file_jpl.h.
JPLFile | ( | std::string | ) |
~JPLFile | ( | ) |
Definition at line 109 of file orsa_file_jpl.cc.
00109 { 00110 if (jpl_database != 0) jpl_close_ephemeris((jpl_eph_data *)jpl_database); 00111 if (map_tag) delete map_tag; 00112 }
bool GoodFile | ( | ) | const [inline] |
void GetEph | ( | const UniverseTypeAwareTime & | date, | |
JPL_planets | target, | |||
JPL_planets | center, | |||
Vector & | position, | |||
Vector & | velocity | |||
) |
Definition at line 254 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(), 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().
00254 { 00255 double xv[6]; 00256 00257 jpl_eph_data * jpldb = (jpl_eph_data *) jpl_database; 00258 00259 if ( (date < EphemStart()) || 00260 (date > EphemEnd()) ) { 00261 ORSA_WARNING("requested time out of the jpl database range"); 00262 return; 00263 } 00264 00265 jpl_pleph(jpldb,date.GetDate().GetJulian(ET),target,center,xv,calc_velocity ? 1 : 0); 00266 00267 if ((target==NUTATIONS) || 00268 (target==LIBRATIONS)) { 00269 // no units correction needed, are radians 00270 position.Set(xv[0],xv[1],xv[2]); 00271 velocity.Set(xv[3],xv[4],xv[5]); 00272 return; 00273 } 00274 00275 // position (from AU) 00276 xv[0] = FromUnits(xv[0],AU); 00277 xv[1] = FromUnits(xv[1],AU); 00278 xv[2] = FromUnits(xv[2],AU); 00279 // 00280 position.Set(xv[0],xv[1],xv[2]); 00281 00282 if (calc_velocity) { 00283 // velocity (from AU/DAY) 00284 xv[3] = FromUnits(xv[3],AU); 00285 xv[4] = FromUnits(xv[4],AU); 00286 xv[5] = FromUnits(xv[5],AU); 00287 // 00288 xv[3] = FromUnits(xv[3],DAY,-1); 00289 xv[4] = FromUnits(xv[4],DAY,-1); 00290 xv[5] = FromUnits(xv[5],DAY,-1); 00291 // 00292 velocity.Set(xv[3],xv[4],xv[5]); 00293 } 00294 00295 // THIS IS THE ONLY CORRECT ROTATION: 00296 // from mean equatorial J2000 (ICRF) to mean ecliptic J2000 00297 if (universe->GetReferenceSystem() == ECLIPTIC) { 00298 Angle obl = obleq_J2000(); 00299 position.rotate(0.0,-obl.GetRad(),0.0); 00300 velocity.rotate(0.0,-obl.GetRad(),0.0); 00301 } 00302 }
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:
const UniverseTypeAwareTime & EphemStart | ( | ) |
Definition at line 114 of file orsa_file_jpl.cc.
Referenced by JPLFile::GetEph(), and orsa::SetupSolarSystem().
00114 { 00115 if (!bool_ephem_start_computed) ComputeEphemStart(); 00116 return ephem_start; 00117 }
const UniverseTypeAwareTime & EphemEnd | ( | ) |
Definition at line 119 of file orsa_file_jpl.cc.
Referenced by JPLFile::GetEph(), and orsa::SetupSolarSystem().
double GetMass | ( | JPL_planets | planet | ) |
Definition at line 188 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().
00188 { 00189 00190 // const double file_G = FromUnits( FromUnits( FromUnits(val[17],AU,3),MSUN,-1),DAY,-2); 00191 // cerr << "JPLFile::GetMass G=" << file_G << endl; 00192 00193 // const double EMRAT = val[7]; // Earth/Moon mass ratio 00194 const double EMRAT = GetTag("EMRAT"); 00195 00196 double GM=0; 00197 00198 switch(planet) { 00199 case MERCURY: 00200 GM = GetTag("GM1"); 00201 break; 00202 case VENUS: 00203 GM = GetTag("GM2"); 00204 break; 00205 case MARS: 00206 GM = GetTag("GM4"); 00207 break; 00208 case JUPITER: 00209 GM = GetTag("GM5"); 00210 break; 00211 case SATURN: 00212 GM = GetTag("GM6"); 00213 break; 00214 case URANUS: 00215 GM = GetTag("GM7"); 00216 break; 00217 case NEPTUNE: 00218 GM = GetTag("GM8"); 00219 break; 00220 case PLUTO: 00221 GM = GetTag("GM9"); 00222 break; 00223 case EARTH: 00224 GM = GetTag("GMB")*EMRAT/(1+EMRAT); 00225 break; 00226 case MOON: 00227 GM = GetTag("GMB")/(1+EMRAT); 00228 break; 00229 case EARTH_MOON_BARYCENTER: 00230 GM = GetTag("GMB"); 00231 break; 00232 case SUN: 00233 GM = GetTag("GMS"); 00234 break; 00235 default: 00236 GM = 0; 00237 break; 00238 } 00239 // 00240 // take the right units 00241 GM = FromUnits(FromUnits(GM,AU,3),DAY,-2); 00242 00243 // return (GM/file_G); 00244 return (GM/GetG()); 00245 }
Here is the call graph for this function:
double GetAU_MKS | ( | ) |
Definition at line 136 of file orsa_file_jpl.cc.
References JPLFile::GetTag().
Referenced by JPLFile::GetMEarth_MKS(), JPLFile::GetMJupiter_MKS(), JPLFile::GetMMoon_MKS(), and JPLFile::GetMSun_MKS().
00136 { 00137 return (GetTag("AU")*1.0e3); 00138 }
Here is the call graph for this function:
double GetMSun_MKS | ( | ) |
Definition at line 140 of file orsa_file_jpl.cc.
References JPLFile::GetAU_MKS(), orsa::GetG_MKS(), and JPLFile::GetTag().
00140 { 00141 //return (GetTag("GMS")*secure_pow(GetAU_MKS(),3.0)*secure_pow(24*3600.0,-2.0)/GetG_MKS()); 00142 const double au_mks = GetAU_MKS(); 00143 const double day_to_second = 24*3600.0; 00144 return (GetTag("GMS")*(au_mks*au_mks*au_mks)/(day_to_second*day_to_second)/GetG_MKS()); 00145 }
Here is the call graph for this function:
double GetMJupiter_MKS | ( | ) |
Definition at line 147 of file orsa_file_jpl.cc.
References JPLFile::GetAU_MKS(), orsa::GetG_MKS(), and JPLFile::GetTag().
00147 { 00148 // return (GetTag("GM5")*secure_pow(GetAU_MKS(),3.0)*secure_pow(24*3600.0,-2.0)/GetG_MKS()); 00149 const double au_mks = GetAU_MKS(); 00150 const double day_to_second = 24*3600.0; 00151 return (GetTag("GM5")*(au_mks*au_mks*au_mks)/(day_to_second*day_to_second)/GetG_MKS()); 00152 }
Here is the call graph for this function:
double GetMEarth_MKS | ( | ) |
Definition at line 154 of file orsa_file_jpl.cc.
References JPLFile::GetAU_MKS(), orsa::GetG_MKS(), and JPLFile::GetTag().
00154 { 00155 // const double EMRAT = val[7]; // Earth/Moon mass ratio 00156 const double EMRAT = GetTag("EMRAT"); 00157 // return ((val[10]*EMRAT/(1+EMRAT))*pow(AU_MKS,3)*pow(24*3600.0,-2)/G_MKS); 00158 // return ((GetTag("GMB")*EMRAT/(1+EMRAT))*pow(AU_MKS,3.0)*pow(24*3600.0,-2.0)/G_MKS); 00159 // return ((GetTag("GMB")*EMRAT/(1+EMRAT))*secure_pow(GetAU_MKS(),3.0)*secure_pow(24*3600.0,-2.0)/GetG_MKS()); 00160 const double au_mks = GetAU_MKS(); 00161 const double day_to_second = 24*3600.0; 00162 return ((GetTag("GMB")*EMRAT/(1+EMRAT))*(au_mks*au_mks*au_mks)/(day_to_second*day_to_second)/GetG_MKS()); 00163 }
Here is the call graph for this function:
double GetMMoon_MKS | ( | ) |
Definition at line 165 of file orsa_file_jpl.cc.
References JPLFile::GetAU_MKS(), orsa::GetG_MKS(), and JPLFile::GetTag().
00165 { 00166 // const double EMRAT = val[7]; // Earth/Moon mass ratio 00167 const double EMRAT = GetTag("EMRAT"); 00168 // return ((val[10]/(1+EMRAT))*pow(AU_MKS,3)*pow(24*3600.0,-2)/G_MKS); 00169 // return ((GetTag("GMB")/(1+EMRAT))*pow(AU_MKS,3.0)*pow(24*3600.0,-2.0)/G_MKS); 00170 // return ((GetTag("GMB")/(1+EMRAT))*secure_pow(GetAU_MKS(),3.0)*secure_pow(24*3600.0,-2.0)/GetG_MKS()); 00171 const double au_mks = GetAU_MKS(); 00172 const double day_to_second = 24*3600.0; 00173 return ((GetTag("GMB")/(1+EMRAT))*(au_mks*au_mks*au_mks)/(day_to_second*day_to_second)/GetG_MKS()); 00174 }
Here is the call graph for this function:
double GetC_MKS | ( | ) |
Definition at line 176 of file orsa_file_jpl.cc.
References JPLFile::GetTag().
00176 { 00177 return (GetTag("CLIGHT")*1.0e3); 00178 }
Here is the call graph for this function:
double GetREarth_MKS | ( | ) |
Definition at line 180 of file orsa_file_jpl.cc.
References JPLFile::GetTag().
00180 { 00181 return (GetTag("RE")*1.0e3); 00182 }
Here is the call graph for this function:
double GetRMoon_MKS | ( | ) |
Definition at line 184 of file orsa_file_jpl.cc.
References JPLFile::GetTag().
00184 { 00185 return (GetTag("AM")*1.0e3); 00186 }
Here is the call graph for this function:
double GetTag | ( | std::string | ) |
Referenced by JPLFile::GetAU_MKS(), JPLFile::GetC_MKS(), JPLFile::GetMass(), JPLFile::GetMEarth_MKS(), JPLFile::GetMJupiter_MKS(), JPLFile::GetMMoon_MKS(), JPLFile::GetMSun_MKS(), JPLFile::GetREarth_MKS(), JPLFile::GetRMoon_MKS(), orsa::local_C22(), orsa::local_C31(), orsa::local_C32(), orsa::local_C33(), orsa::local_C41(), orsa::local_C42(), orsa::local_C43(), orsa::local_C44(), orsa::local_J2(), orsa::local_J3(), orsa::local_J4(), orsa::local_S31(), orsa::local_S32(), orsa::local_S33(), orsa::local_S41(), orsa::local_S42(), orsa::local_S43(), and orsa::local_S44().