use of org.orekit.propagation.events.NodeDetector in project Orekit by CS-SI.
the class EcksteinHechlerPropagatorTest method ascendingNode.
@Test
public void ascendingNode() throws OrekitException {
final KeplerianOrbit orbit = new KeplerianOrbit(7.8e6, 0.032, 0.4, 0.1, 0.2, 0.3, PositionAngle.TRUE, FramesFactory.getEME2000(), AbsoluteDate.J2000_EPOCH, provider.getMu());
EcksteinHechlerPropagator propagator = new EcksteinHechlerPropagator(orbit, provider);
NodeDetector detector = new NodeDetector(orbit, FramesFactory.getITRF(IERSConventions.IERS_2010, true));
Assert.assertTrue(FramesFactory.getITRF(IERSConventions.IERS_2010, true) == detector.getFrame());
propagator.addEventDetector(detector);
AbsoluteDate farTarget = AbsoluteDate.J2000_EPOCH.shiftedBy(10000.0);
SpacecraftState propagated = propagator.propagate(farTarget);
PVCoordinates pv = propagated.getPVCoordinates(FramesFactory.getITRF(IERSConventions.IERS_2010, true));
Assert.assertTrue(farTarget.durationFrom(propagated.getDate()) > 3500.0);
Assert.assertTrue(farTarget.durationFrom(propagated.getDate()) < 4000.0);
Assert.assertEquals(0, pv.getPosition().getZ(), 1.0e-6);
Assert.assertTrue(pv.getVelocity().getZ() > 0);
Collection<EventDetector> detectors = propagator.getEventsDetectors();
Assert.assertEquals(1, detectors.size());
propagator.clearEventsDetectors();
Assert.assertEquals(0, propagator.getEventsDetectors().size());
}
Aggregations