#include <orsa_file_jpl.h>
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 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 }
bool GoodFile | ( | ) | const [inline] |
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 }
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 }
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 }
const UniverseTypeAwareTime & EphemEnd | ( | ) |
Definition at line 120 of file orsa_file_jpl.cc.
Referenced by JPLFile::GetEph(), and orsa::SetupSolarSystem().
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 }
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 }
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 }
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 }
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 }
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 }
double GetC_MKS | ( | ) |
Definition at line 177 of file orsa_file_jpl.cc.
References JPLFile::GetTag().
00177 { 00178 return (GetTag("CLIGHT")*1.0e3); 00179 }
double GetREarth_MKS | ( | ) |
Definition at line 181 of file orsa_file_jpl.cc.
References JPLFile::GetTag().
00181 { 00182 return (GetTag("RE")*1.0e3); 00183 }
double GetRMoon_MKS | ( | ) |
Definition at line 185 of file orsa_file_jpl.cc.
References JPLFile::GetTag().
00185 { 00186 return (GetTag("AM")*1.0e3); 00187 }
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().