@Test public void testGroundToGroundIssue181() throws OrekitException { Frame itrf = FramesFactory.getITRF(IERSConventions.IERS_2010, true); Frame eme2000 = FramesFactory.getEME2000(); OneAxisEllipsoid model = new OneAxisEllipsoid( Constants.WGS84_EARTH_EQUATORIAL_RADIUS, Constants.WGS84_EARTH_FLATTENING, itrf); TimeStampedPVCoordinates initPV = new TimeStampedPVCoordinates( AbsoluteDate.J2000_EPOCH.shiftedBy(584.), new Vector3D(3220103., 69623., 6449822.), new Vector3D(6414.7, -2006., -3180.), Vector3D.ZERO); TimeStampedPVCoordinates body = itrf.getTransformTo(eme2000, initPV.getDate()).transformPVCoordinates(initPV); TimeStampedPVCoordinates ground1 = model.projectToGround(body, itrf); TimeStampedPVCoordinates ground2 = model.projectToGround(ground1, itrf); Assert.assertEquals( 0.0, Vector3D.distance(ground1.getPosition(), ground2.getPosition()), 1.0e-12); Assert.assertEquals( 0.0, Vector3D.distance(ground1.getVelocity(), ground2.getVelocity()), 1.0e-12); Assert.assertEquals( 0.0, Vector3D.distance(ground1.getAcceleration(), ground2.getAcceleration()), 1.0e-12); }
@Test public void testGroundProjectionDerivatives() throws OrekitException { Frame itrf = FramesFactory.getITRF(IERSConventions.IERS_2010, true); Frame eme2000 = FramesFactory.getEME2000(); OneAxisEllipsoid model = new OneAxisEllipsoid( Constants.WGS84_EARTH_EQUATORIAL_RADIUS, Constants.WGS84_EARTH_FLATTENING, itrf); TimeStampedPVCoordinates initPV = new TimeStampedPVCoordinates( AbsoluteDate.J2000_EPOCH.shiftedBy(584.), new Vector3D(3220103., 69623., 6449822.), new Vector3D(6414.7, -2006., -3180.), Vector3D.ZERO); Orbit orbit = new EquinoctialOrbit(initPV, eme2000, Constants.EIGEN5C_EARTH_MU); double[] errors = derivativesErrors(orbit, orbit.getDate(), eme2000, model); Assert.assertEquals(0, errors[0], 1.0e-16); Assert.assertEquals(0, errors[1], 1.0e-12); Assert.assertEquals(0, errors[2], 2.0e-4); }
@Test public void testGroundProjectionTaylor() throws OrekitException { Frame itrf = FramesFactory.getITRF(IERSConventions.IERS_2010, true); Frame eme2000 = FramesFactory.getEME2000(); OneAxisEllipsoid model = new OneAxisEllipsoid( Constants.WGS84_EARTH_EQUATORIAL_RADIUS, Constants.WGS84_EARTH_FLATTENING, itrf); TimeStampedPVCoordinates initPV = new TimeStampedPVCoordinates( AbsoluteDate.J2000_EPOCH.shiftedBy(584.), new Vector3D(3220103., 69623., 6449822.), new Vector3D(6414.7, -2006., -3180.), Vector3D.ZERO); Orbit orbit = new EquinoctialOrbit(initPV, eme2000, Constants.EIGEN5C_EARTH_MU); TimeStampedPVCoordinates pv0 = orbit.getPVCoordinates(orbit.getDate(), model.getBodyFrame()); PVCoordinatesProvider groundTaylor = model.projectToGround(pv0, model.getBodyFrame()).toTaylorProvider(model.getBodyFrame()); TimeStampedPVCoordinates g0 = groundTaylor.getPVCoordinates(orbit.getDate(), model.getBodyFrame()); Vector3D zenith = pv0.getPosition().subtract(g0.getPosition()).normalize(); Vector3D acrossTrack = Vector3D.crossProduct(zenith, g0.getVelocity()).normalize(); Vector3D alongTrack = Vector3D.crossProduct(acrossTrack, zenith).normalize(); for (double dt = -1; dt < 1; dt += 0.01) { AbsoluteDate date = orbit.getDate().shiftedBy(dt); Vector3D taylorP = groundTaylor.getPVCoordinates(date, model.getBodyFrame()).getPosition(); Vector3D refP = model.projectToGround( orbit.getPVCoordinates(date, model.getBodyFrame()).getPosition(), date, model.getBodyFrame()); Vector3D delta = taylorP.subtract(refP); Assert.assertEquals(0.0, Vector3D.dotProduct(delta, alongTrack), 0.0015); Assert.assertEquals(0.0, Vector3D.dotProduct(delta, acrossTrack), 0.0007); Assert.assertEquals(0.0, Vector3D.dotProduct(delta, zenith), 0.00002); } }
@Test public void testGroundProjectionPosition() throws OrekitException { OneAxisEllipsoid model = new OneAxisEllipsoid( Constants.WGS84_EARTH_EQUATORIAL_RADIUS, Constants.WGS84_EARTH_FLATTENING, FramesFactory.getITRF(IERSConventions.IERS_2010, true)); TimeStampedPVCoordinates initPV = new TimeStampedPVCoordinates( AbsoluteDate.J2000_EPOCH.shiftedBy(584.), new Vector3D(3220103., 69623., 6449822.), new Vector3D(6414.7, -2006., -3180.), Vector3D.ZERO); Frame eme2000 = FramesFactory.getEME2000(); Orbit orbit = new EquinoctialOrbit(initPV, eme2000, Constants.EIGEN5C_EARTH_MU); for (double dt = 0; dt < 3600.0; dt += 60.0) { TimeStampedPVCoordinates pv = orbit.getPVCoordinates(orbit.getDate().shiftedBy(dt), eme2000); TimeStampedPVCoordinates groundPV = model.projectToGround(pv, eme2000); Vector3D groundP = model.projectToGround(pv.getPosition(), pv.getDate(), eme2000); // check methods projectToGround and transform are consistent with each other Assert.assertEquals( model.transform(pv.getPosition(), eme2000, pv.getDate()).getLatitude(), model.transform(groundPV.getPosition(), eme2000, pv.getDate()).getLatitude(), 1.0e-10); Assert.assertEquals( model.transform(pv.getPosition(), eme2000, pv.getDate()).getLongitude(), model.transform(groundPV.getPosition(), eme2000, pv.getDate()).getLongitude(), 1.0e-10); Assert.assertEquals( 0.0, Vector3D.distance(groundP, groundPV.getPosition()), 1.0e-15 * groundP.getNorm()); } }
@Test(expected = OrekitException.class) public void testNotInitialised2() throws OrekitException { final AbstractIntegratedPropagator notInitialised = new NumericalPropagator(new ClassicalRungeKuttaIntegrator(10.0)); notInitialised.propagate(AbsoluteDate.J2000_EPOCH, AbsoluteDate.J2000_EPOCH.shiftedBy(3600)); }