Search in sources :

Example 21 with EquinoctialOrbit

use of org.orekit.orbits.EquinoctialOrbit in project Orekit by CS-SI.

the class CircularFieldOfViewDetectorTest method setUp.

@Before
public void setUp() {
    try {
        Utils.setDataRoot("regular-data");
        // Computation date
        // Satellite position as circular parameters
        mu = 3.9860047e14;
        initDate = new AbsoluteDate(new DateComponents(1969, 8, 28), TimeComponents.H00, TimeScalesFactory.getUTC());
        Vector3D position = new Vector3D(7.0e6, 1.0e6, 4.0e6);
        Vector3D velocity = new Vector3D(-500.0, 8000.0, 1000.0);
        initialOrbit = new EquinoctialOrbit(new PVCoordinates(position, velocity), FramesFactory.getEME2000(), initDate, mu);
        // WGS84 Earth model
        earth = new OneAxisEllipsoid(Constants.WGS84_EARTH_EQUATORIAL_RADIUS, Constants.WGS84_EARTH_FLATTENING, FramesFactory.getITRF(IERSConventions.IERS_2010, true));
        // Create earth center pointing attitude provider
        earthCenterAttitudeLaw = new BodyCenterPointing(initialOrbit.getFrame(), earth);
    } catch (OrekitException oe) {
        Assert.fail(oe.getMessage());
    }
}
Also used : OneAxisEllipsoid(org.orekit.bodies.OneAxisEllipsoid) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) BodyCenterPointing(org.orekit.attitudes.BodyCenterPointing) EquinoctialOrbit(org.orekit.orbits.EquinoctialOrbit) PVCoordinates(org.orekit.utils.PVCoordinates) DateComponents(org.orekit.time.DateComponents) OrekitException(org.orekit.errors.OrekitException) AbsoluteDate(org.orekit.time.AbsoluteDate) Before(org.junit.Before)

Example 22 with EquinoctialOrbit

use of org.orekit.orbits.EquinoctialOrbit in project Orekit by CS-SI.

the class EclipseDetectorTest method setUp.

@Before
public void setUp() {
    try {
        Utils.setDataRoot("regular-data");
        mu = 3.9860047e14;
        final Vector3D position = new Vector3D(-6142438.668, 3492467.560, -25767.25680);
        final Vector3D velocity = new Vector3D(505.8479685, 942.7809215, 7435.922231);
        iniDate = new AbsoluteDate(1969, 7, 28, 4, 0, 0.0, TimeScalesFactory.getTT());
        final Orbit orbit = new EquinoctialOrbit(new PVCoordinates(position, velocity), FramesFactory.getGCRF(), iniDate, mu);
        initialState = new SpacecraftState(orbit);
        double[] absTolerance = { 0.001, 1.0e-9, 1.0e-9, 1.0e-6, 1.0e-6, 1.0e-6, 0.001 };
        double[] relTolerance = { 1.0e-7, 1.0e-4, 1.0e-4, 1.0e-7, 1.0e-7, 1.0e-7, 1.0e-7 };
        AdaptiveStepsizeIntegrator integrator = new DormandPrince853Integrator(0.001, 1000, absTolerance, relTolerance);
        integrator.setInitialStepSize(60);
        propagator = new NumericalPropagator(integrator);
        propagator.setInitialState(initialState);
        sun = CelestialBodyFactory.getSun();
        earth = CelestialBodyFactory.getEarth();
        sunRadius = 696000000.;
        earthRadius = 6400000.;
    } catch (OrekitException oe) {
        Assert.fail(oe.getLocalizedMessage());
    }
}
Also used : SpacecraftState(org.orekit.propagation.SpacecraftState) CartesianOrbit(org.orekit.orbits.CartesianOrbit) Orbit(org.orekit.orbits.Orbit) EquinoctialOrbit(org.orekit.orbits.EquinoctialOrbit) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) NumericalPropagator(org.orekit.propagation.numerical.NumericalPropagator) EquinoctialOrbit(org.orekit.orbits.EquinoctialOrbit) AdaptiveStepsizeIntegrator(org.hipparchus.ode.nonstiff.AdaptiveStepsizeIntegrator) TimeStampedPVCoordinates(org.orekit.utils.TimeStampedPVCoordinates) PVCoordinates(org.orekit.utils.PVCoordinates) OrekitException(org.orekit.errors.OrekitException) DormandPrince853Integrator(org.hipparchus.ode.nonstiff.DormandPrince853Integrator) AbsoluteDate(org.orekit.time.AbsoluteDate) Before(org.junit.Before)

Example 23 with EquinoctialOrbit

use of org.orekit.orbits.EquinoctialOrbit in project Orekit by CS-SI.

the class EventSlopeFilterTest method setUp.

@Before
public void setUp() {
    try {
        Utils.setDataRoot("regular-data");
        double mu = 3.9860047e14;
        final Vector3D position = new Vector3D(-6142438.668, 3492467.560, -25767.25680);
        final Vector3D velocity = new Vector3D(505.8479685, 942.7809215, 7435.922231);
        iniDate = new AbsoluteDate(1969, 7, 28, 4, 0, 0.0, TimeScalesFactory.getTT());
        final Orbit orbit = new EquinoctialOrbit(new PVCoordinates(position, velocity), FramesFactory.getGCRF(), iniDate, mu);
        propagator = new KeplerianPropagator(orbit, AbstractPropagator.DEFAULT_LAW, mu);
        earth = new OneAxisEllipsoid(Constants.WGS84_EARTH_EQUATORIAL_RADIUS, Constants.WGS84_EARTH_FLATTENING, FramesFactory.getITRF(IERSConventions.IERS_2010, true));
    } catch (OrekitException oe) {
        Assert.fail(oe.getLocalizedMessage());
    }
}
Also used : KeplerianPropagator(org.orekit.propagation.analytical.KeplerianPropagator) OneAxisEllipsoid(org.orekit.bodies.OneAxisEllipsoid) Orbit(org.orekit.orbits.Orbit) EquinoctialOrbit(org.orekit.orbits.EquinoctialOrbit) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) EquinoctialOrbit(org.orekit.orbits.EquinoctialOrbit) PVCoordinates(org.orekit.utils.PVCoordinates) OrekitException(org.orekit.errors.OrekitException) AbsoluteDate(org.orekit.time.AbsoluteDate) Before(org.junit.Before)

Example 24 with EquinoctialOrbit

use of org.orekit.orbits.EquinoctialOrbit in project Orekit by CS-SI.

the class LatitudeExtremumDetectorTest method testLEO.

@Test
public void testLEO() throws OrekitException {
    final OneAxisEllipsoid earth = new OneAxisEllipsoid(Constants.WGS84_EARTH_EQUATORIAL_RADIUS, Constants.WGS84_EARTH_FLATTENING, FramesFactory.getITRF(IERSConventions.IERS_2010, true));
    LatitudeExtremumDetector d = new LatitudeExtremumDetector(earth).withMaxCheck(60).withThreshold(1.e-6).withHandler(new ContinueOnEvent<LatitudeExtremumDetector>());
    Assert.assertEquals(60.0, d.getMaxCheckInterval(), 1.0e-15);
    Assert.assertEquals(1.0e-6, d.getThreshold(), 1.0e-15);
    Assert.assertEquals(AbstractDetector.DEFAULT_MAX_ITER, d.getMaxIterationCount());
    Assert.assertSame(earth, d.getBody());
    final TimeScale utc = TimeScalesFactory.getUTC();
    final Vector3D position = new Vector3D(-6142438.668, 3492467.56, -25767.257);
    final Vector3D velocity = new Vector3D(505.848, 942.781, 7435.922);
    final AbsoluteDate date = new AbsoluteDate(2003, 9, 16, utc);
    final Orbit orbit = new EquinoctialOrbit(new PVCoordinates(position, velocity), FramesFactory.getEME2000(), date, Constants.EIGEN5C_EARTH_MU);
    Propagator propagator = new EcksteinHechlerPropagator(orbit, Constants.EIGEN5C_EARTH_EQUATORIAL_RADIUS, Constants.EIGEN5C_EARTH_MU, Constants.EIGEN5C_EARTH_C20, Constants.EIGEN5C_EARTH_C30, Constants.EIGEN5C_EARTH_C40, Constants.EIGEN5C_EARTH_C50, Constants.EIGEN5C_EARTH_C60);
    EventsLogger logger = new EventsLogger();
    propagator.addEventDetector(logger.monitorDetector(d));
    propagator.propagate(date.shiftedBy(Constants.JULIAN_DAY));
    for (LoggedEvent e : logger.getLoggedEvents()) {
        SpacecraftState state = e.getState();
        double latitude = earth.transform(state.getPVCoordinates(earth.getBodyFrame()).getPosition(), earth.getBodyFrame(), null).getLatitude();
        if (e.isIncreasing()) {
            Assert.assertEquals(-81.863, FastMath.toDegrees(latitude), 0.001);
        } else {
            Assert.assertEquals(+81.863, FastMath.toDegrees(latitude), 0.001);
        }
    }
    Assert.assertEquals(29, logger.getLoggedEvents().size());
}
Also used : OneAxisEllipsoid(org.orekit.bodies.OneAxisEllipsoid) Orbit(org.orekit.orbits.Orbit) EquinoctialOrbit(org.orekit.orbits.EquinoctialOrbit) LoggedEvent(org.orekit.propagation.events.EventsLogger.LoggedEvent) PVCoordinates(org.orekit.utils.PVCoordinates) TimeScale(org.orekit.time.TimeScale) AbsoluteDate(org.orekit.time.AbsoluteDate) EcksteinHechlerPropagator(org.orekit.propagation.analytical.EcksteinHechlerPropagator) SpacecraftState(org.orekit.propagation.SpacecraftState) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) EquinoctialOrbit(org.orekit.orbits.EquinoctialOrbit) Propagator(org.orekit.propagation.Propagator) EcksteinHechlerPropagator(org.orekit.propagation.analytical.EcksteinHechlerPropagator) Test(org.junit.Test)

Example 25 with EquinoctialOrbit

use of org.orekit.orbits.EquinoctialOrbit in project Orekit by CS-SI.

the class LongitudeCrossingDetectorTest method testRegularCrossing.

@Test
public void testRegularCrossing() throws OrekitException {
    final OneAxisEllipsoid earth = new OneAxisEllipsoid(Constants.WGS84_EARTH_EQUATORIAL_RADIUS, Constants.WGS84_EARTH_FLATTENING, FramesFactory.getITRF(IERSConventions.IERS_2010, true));
    LongitudeCrossingDetector d = new LongitudeCrossingDetector(earth, FastMath.toRadians(10.0)).withMaxCheck(60).withThreshold(1.e-6).withHandler(new ContinueOnEvent<LongitudeCrossingDetector>());
    Assert.assertEquals(60.0, d.getMaxCheckInterval(), 1.0e-15);
    Assert.assertEquals(1.0e-6, d.getThreshold(), 1.0e-15);
    Assert.assertEquals(10.0, FastMath.toDegrees(d.getLongitude()), 1.0e-14);
    Assert.assertEquals(AbstractDetector.DEFAULT_MAX_ITER, d.getMaxIterationCount());
    Assert.assertSame(earth, d.getBody());
    final TimeScale utc = TimeScalesFactory.getUTC();
    final Vector3D position = new Vector3D(-6142438.668, 3492467.56, -25767.257);
    final Vector3D velocity = new Vector3D(505.848, 942.781, 7435.922);
    final AbsoluteDate date = new AbsoluteDate(2003, 9, 16, utc);
    final Orbit orbit = new EquinoctialOrbit(new PVCoordinates(position, velocity), FramesFactory.getEME2000(), date, Constants.EIGEN5C_EARTH_MU);
    Propagator propagator = new EcksteinHechlerPropagator(orbit, Constants.EIGEN5C_EARTH_EQUATORIAL_RADIUS, Constants.EIGEN5C_EARTH_MU, Constants.EIGEN5C_EARTH_C20, Constants.EIGEN5C_EARTH_C30, Constants.EIGEN5C_EARTH_C40, Constants.EIGEN5C_EARTH_C50, Constants.EIGEN5C_EARTH_C60);
    EventsLogger logger = new EventsLogger();
    propagator.addEventDetector(logger.monitorDetector(d));
    propagator.propagate(date.shiftedBy(Constants.JULIAN_DAY));
    AbsoluteDate previous = null;
    for (LoggedEvent e : logger.getLoggedEvents()) {
        SpacecraftState state = e.getState();
        double longitude = earth.transform(state.getPVCoordinates(earth.getBodyFrame()).getPosition(), earth.getBodyFrame(), null).getLongitude();
        Assert.assertEquals(10.0, FastMath.toDegrees(longitude), 1.6e-7);
        if (previous != null) {
            // same time interval regardless of increasing/decreasing,
            // as increasing/decreasing flag is irrelevant for this detector
            Assert.assertEquals(4954.70, state.getDate().durationFrom(previous), 1e10);
        }
        previous = state.getDate();
    }
    Assert.assertEquals(16, logger.getLoggedEvents().size());
}
Also used : OneAxisEllipsoid(org.orekit.bodies.OneAxisEllipsoid) Orbit(org.orekit.orbits.Orbit) EquinoctialOrbit(org.orekit.orbits.EquinoctialOrbit) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) LoggedEvent(org.orekit.propagation.events.EventsLogger.LoggedEvent) PVCoordinates(org.orekit.utils.PVCoordinates) TimeScale(org.orekit.time.TimeScale) AbsoluteDate(org.orekit.time.AbsoluteDate) EcksteinHechlerPropagator(org.orekit.propagation.analytical.EcksteinHechlerPropagator) SpacecraftState(org.orekit.propagation.SpacecraftState) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) EquinoctialOrbit(org.orekit.orbits.EquinoctialOrbit) EcksteinHechlerPropagator(org.orekit.propagation.analytical.EcksteinHechlerPropagator) Propagator(org.orekit.propagation.Propagator) KeplerianPropagator(org.orekit.propagation.analytical.KeplerianPropagator) Test(org.junit.Test)

Aggregations

EquinoctialOrbit (org.orekit.orbits.EquinoctialOrbit)58 AbsoluteDate (org.orekit.time.AbsoluteDate)49 Vector3D (org.hipparchus.geometry.euclidean.threed.Vector3D)48 PVCoordinates (org.orekit.utils.PVCoordinates)46 Orbit (org.orekit.orbits.Orbit)37 SpacecraftState (org.orekit.propagation.SpacecraftState)34 Test (org.junit.Test)29 KeplerianOrbit (org.orekit.orbits.KeplerianOrbit)25 OneAxisEllipsoid (org.orekit.bodies.OneAxisEllipsoid)20 Before (org.junit.Before)18 TimeStampedPVCoordinates (org.orekit.utils.TimeStampedPVCoordinates)18 TimeScale (org.orekit.time.TimeScale)16 Frame (org.orekit.frames.Frame)15 CartesianOrbit (org.orekit.orbits.CartesianOrbit)15 CircularOrbit (org.orekit.orbits.CircularOrbit)15 EcksteinHechlerPropagator (org.orekit.propagation.analytical.EcksteinHechlerPropagator)13 FieldAbsoluteDate (org.orekit.time.FieldAbsoluteDate)13 OrekitException (org.orekit.errors.OrekitException)12 Propagator (org.orekit.propagation.Propagator)11 KeplerianPropagator (org.orekit.propagation.analytical.KeplerianPropagator)10