Hello fellow Orekit users!
I have been recently working on a small program, that will propagate asteroid orbit from MPCORB database data and then give telescope pointing.
At first, I wanted to compare heliocentric state vectors after propagation, if they are the same. X value is always matching MPC, then Y value deviates, and Z value is completely not matching those calculated by MPC.
I have prepared simple Junit test.
What I do is :
-
Take sun-centric inertial frame as frame for orbit.
-
Take orbital parameters from MPC site (minorplanetcenter.net/db_search/show_object?utf8=✓&object_id=Tanina)
-
create propagator, as in Orekit examples
I have included 3rd body influence. -
I am comparing outcome with MPC’s ephemeris service: minorplanetcenter.net/iau/MPEph/MPEph.html
For input settings: date 2018-04-01 at 00:00:00 hour, asteroid : Tanina, heliocentric position vector, I get:
VECTORS: Heliocentric vectors/AU
Obj JD_TT X Y Z
00825 2458209.5000000 0.234729353 2.135914513 0.881546394
From Orkeit code:
0.2344986504264944 2.310074947284788 -0.040804051106836874
Clearly X axis value is correct, and Z totally different.
I wonder, what other coordinate frames could be used by MPC ? Is it something wrong with my code?
This is my code:
public class TestEphem {
public static File orekitData = new File("src/test/resources/orekit-data");
@Test
public void computeVectorTest() throws OrekitException {
DirectoryCrawler crawler = new DirectoryCrawler(orekitData);
System.out.println(orekitData.getAbsolutePath());
DataProvidersManager.getInstance().addProvider(crawler);
// sun body and sun-centric inertial frame
CelestialBody sunBody = CelestialBodyFactory.getSun();
// epoch of keplerian coordinates
Double epoch = 2458600.5;
int julianDay = epoch.intValue();
double secondsSinceNoon = (epoch - julianDay) * 24 * 3600;
AbsoluteDate date = AbsoluteDate.createJDDate(julianDay, secondsSinceNoon, TimeScalesFactory.getUTC());
// semi-major axis [m]
double a = 2.225774 * Constants.IAU_2012_ASTRONOMICAL_UNIT;
// orbital eccentricity
double e = 0.0749275;
// inclination [rad]
double i = FastMath.toRadians(3.39960);
// Argument of perihelion [rad]
double peri = FastMath.toRadians(111.78637);
// Longitude of the ascending node [rad]
double node = FastMath.toRadians(101.40875);
// Mean anomaly [rad]
double m = FastMath.toRadians(353.95770);
Orbit orb = new KeplerianOrbit(a, e, i, peri, node, m, PositionAngle.MEAN, sunBody.getInertiallyOrientedFrame(),
date, sunBody.getGM());
NumericalPropagator prop = getPropagator(orb);
AbsoluteDate dat = new AbsoluteDate(2018, 04, 01, 0, 0, 0.0, TimeScalesFactory.getUTC());
TimeStampedPVCoordinates cord = prop.propagate(dat).getPVCoordinates();
Vector3D pos2 = cord.getPosition();
System.out.println(pos2.getX() / Constants.IAU_2012_ASTRONOMICAL_UNIT + " "
+ pos2.getY() / Constants.IAU_2012_ASTRONOMICAL_UNIT + " "
+ pos2.getZ() / Constants.IAU_2012_ASTRONOMICAL_UNIT);
}
public NumericalPropagator getPropagator(Orbit orb) throws OrekitException {
double[][] tolerances = NumericalPropagator.tolerances(1, orb, OrbitType.CARTESIAN);
AdaptiveStepsizeIntegrator integrator = new DormandPrince853Integrator(0.001, 3600, tolerances[0], tolerances[1]);
NumericalPropagator propagator = new NumericalPropagator(integrator);
propagator.setOrbitType(OrbitType.CARTESIAN);
propagator.addForceModel(new NewtonianAttraction(orb.getMu()));
propagator.addForceModel(new ThirdBodyAttraction(CelestialBodyFactory.getEarth()));
propagator.addForceModel(new ThirdBodyAttraction(CelestialBodyFactory.getMoon()));
propagator.addForceModel(new ThirdBodyAttraction(CelestialBodyFactory.getJupiter()));
propagator.addForceModel(new ThirdBodyAttraction(CelestialBodyFactory.getMars()));
propagator.setInitialState(new SpacecraftState(orb));
return propagator;
}
}
I have used newest EOP, planetary ephem and leap secodns files.
I would be very grateful for any hints provided! I would like to learn using Orekit. Propagation was looking as quite simple task, but here I am clearly getting something wrong.
Best regards,