Search in sources :

Example 6 with NodeDetector

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());
}
Also used : SpacecraftState(org.orekit.propagation.SpacecraftState) EventDetector(org.orekit.propagation.events.EventDetector) NodeDetector(org.orekit.propagation.events.NodeDetector) TimeStampedPVCoordinates(org.orekit.utils.TimeStampedPVCoordinates) PVCoordinates(org.orekit.utils.PVCoordinates) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate) AbsoluteDate(org.orekit.time.AbsoluteDate) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)6 KeplerianOrbit (org.orekit.orbits.KeplerianOrbit)6 SpacecraftState (org.orekit.propagation.SpacecraftState)6 NodeDetector (org.orekit.propagation.events.NodeDetector)6 AbsoluteDate (org.orekit.time.AbsoluteDate)6 FieldAbsoluteDate (org.orekit.time.FieldAbsoluteDate)4 Vector3D (org.hipparchus.geometry.euclidean.threed.Vector3D)2 LofOffset (org.orekit.attitudes.LofOffset)2 Frame (org.orekit.frames.Frame)2 TopocentricFrame (org.orekit.frames.TopocentricFrame)2 CartesianOrbit (org.orekit.orbits.CartesianOrbit)2 Orbit (org.orekit.orbits.Orbit)2 ContinueOnEvent (org.orekit.propagation.events.handlers.ContinueOnEvent)2 DateComponents (org.orekit.time.DateComponents)2 TimeComponents (org.orekit.time.TimeComponents)2 PVCoordinates (org.orekit.utils.PVCoordinates)2 TimeStampedPVCoordinates (org.orekit.utils.TimeStampedPVCoordinates)2 CircularOrbit (org.orekit.orbits.CircularOrbit)1 EquinoctialOrbit (org.orekit.orbits.EquinoctialOrbit)1 KeplerianPropagator (org.orekit.propagation.analytical.KeplerianPropagator)1