Search in sources :

Example 41 with EquinoctialOrbit

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

the class KeplerianPropagatorTest method sameDateCartesian.

@Test
public void sameDateCartesian() throws OrekitException {
    // Definition of initial conditions with position and velocity
    // ------------------------------------------------------------
    Vector3D position = new Vector3D(7.0e6, 1.0e6, 4.0e6);
    Vector3D velocity = new Vector3D(-500.0, 8000.0, 1000.0);
    AbsoluteDate initDate = AbsoluteDate.J2000_EPOCH.shiftedBy(584.);
    Orbit initialOrbit = new EquinoctialOrbit(new PVCoordinates(position, velocity), FramesFactory.getEME2000(), initDate, mu);
    // Extrapolator definition
    // -----------------------
    KeplerianPropagator extrapolator = new KeplerianPropagator(initialOrbit);
    // Extrapolation at the initial date
    // ---------------------------------
    // extrapolation duration in seconds
    double delta_t = 0.0;
    AbsoluteDate extrapDate = initDate.shiftedBy(delta_t);
    SpacecraftState finalOrbit = extrapolator.propagate(extrapDate);
    double a = finalOrbit.getA();
    // another way to compute n
    double n = FastMath.sqrt(finalOrbit.getMu() / FastMath.pow(a, 3));
    Assert.assertEquals(n * delta_t, finalOrbit.getLM() - initialOrbit.getLM(), Utils.epsilonTest * FastMath.abs(n * delta_t));
    Assert.assertEquals(MathUtils.normalizeAngle(finalOrbit.getLM(), initialOrbit.getLM()), initialOrbit.getLM(), Utils.epsilonAngle * FastMath.abs(initialOrbit.getLM()));
    Assert.assertEquals(finalOrbit.getA(), initialOrbit.getA(), Utils.epsilonTest * initialOrbit.getA());
    Assert.assertEquals(finalOrbit.getE(), initialOrbit.getE(), Utils.epsilonE * initialOrbit.getE());
    Assert.assertEquals(MathUtils.normalizeAngle(finalOrbit.getI(), initialOrbit.getI()), initialOrbit.getI(), Utils.epsilonAngle * FastMath.abs(initialOrbit.getI()));
}
Also used : SpacecraftState(org.orekit.propagation.SpacecraftState) EquinoctialOrbit(org.orekit.orbits.EquinoctialOrbit) CartesianOrbit(org.orekit.orbits.CartesianOrbit) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) Orbit(org.orekit.orbits.Orbit) CircularOrbit(org.orekit.orbits.CircularOrbit) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) EquinoctialOrbit(org.orekit.orbits.EquinoctialOrbit) TimeStampedPVCoordinates(org.orekit.utils.TimeStampedPVCoordinates) PVCoordinates(org.orekit.utils.PVCoordinates) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate) AbsoluteDate(org.orekit.time.AbsoluteDate) Test(org.junit.Test)

Example 42 with EquinoctialOrbit

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

the class KeplerianConverterTest method setUp.

@Before
public void setUp() throws OrekitException {
    Utils.setDataRoot("regular-data");
    AbsoluteDate initDate = AbsoluteDate.J2000_EPOCH.shiftedBy(584.);
    orbit = new EquinoctialOrbit(new PVCoordinates(position, velocity), FramesFactory.getEME2000(), initDate, mu);
}
Also used : EquinoctialOrbit(org.orekit.orbits.EquinoctialOrbit) PVCoordinates(org.orekit.utils.PVCoordinates) AbsoluteDate(org.orekit.time.AbsoluteDate) Before(org.junit.Before)

Example 43 with EquinoctialOrbit

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

the class FieldOfViewDetectorTest 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 44 with EquinoctialOrbit

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

the class FootprintOverlapDetectorTest method setUp.

@Before
public void setUp() {
    try {
        Utils.setDataRoot("regular-data");
        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);
        initialOrbit = new EquinoctialOrbit(new PVCoordinates(position, velocity), FramesFactory.getEME2000(), date, Constants.EIGEN5C_EARTH_MU);
        propagator = new EcksteinHechlerPropagator(initialOrbit, 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);
        earth = new OneAxisEllipsoid(Constants.WGS84_EARTH_EQUATORIAL_RADIUS, Constants.WGS84_EARTH_FLATTENING, FramesFactory.getITRF(IERSConventions.IERS_2010, true));
    } catch (OrekitException oe) {
        Assert.fail(oe.getMessage());
    }
}
Also used : EcksteinHechlerPropagator(org.orekit.propagation.analytical.EcksteinHechlerPropagator) OneAxisEllipsoid(org.orekit.bodies.OneAxisEllipsoid) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) EquinoctialOrbit(org.orekit.orbits.EquinoctialOrbit) PVCoordinates(org.orekit.utils.PVCoordinates) OrekitException(org.orekit.errors.OrekitException) TimeScale(org.orekit.time.TimeScale) AbsoluteDate(org.orekit.time.AbsoluteDate) Before(org.junit.Before)

Example 45 with EquinoctialOrbit

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

the class GeographicZoneDetectorTest method testFrance.

@Test
public void testFrance() throws OrekitException {
    final BodyShape earth = new OneAxisEllipsoid(Constants.WGS84_EARTH_EQUATORIAL_RADIUS, Constants.WGS84_EARTH_FLATTENING, FramesFactory.getITRF(IERSConventions.IERS_2010, true));
    GeographicZoneDetector d = new GeographicZoneDetector(20.0, 1.e-3, earth, buildFrance(), FastMath.toRadians(0.5)).withHandler(new ContinueOnEvent<GeographicZoneDetector>());
    Assert.assertEquals(20.0, d.getMaxCheckInterval(), 1.0e-15);
    Assert.assertEquals(1.0e-3, d.getThreshold(), 1.0e-15);
    Assert.assertEquals(0.5, FastMath.toDegrees(d.getMargin()), 1.0e-15);
    Assert.assertEquals(AbstractDetector.DEFAULT_MAX_ITER, d.getMaxIterationCount());
    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(10 * Constants.JULIAN_DAY));
    Assert.assertEquals(26, logger.getLoggedEvents().size());
}
Also used : OneAxisEllipsoid(org.orekit.bodies.OneAxisEllipsoid) Orbit(org.orekit.orbits.Orbit) EquinoctialOrbit(org.orekit.orbits.EquinoctialOrbit) PVCoordinates(org.orekit.utils.PVCoordinates) BodyShape(org.orekit.bodies.BodyShape) TimeScale(org.orekit.time.TimeScale) AbsoluteDate(org.orekit.time.AbsoluteDate) EcksteinHechlerPropagator(org.orekit.propagation.analytical.EcksteinHechlerPropagator) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) EquinoctialOrbit(org.orekit.orbits.EquinoctialOrbit) EcksteinHechlerPropagator(org.orekit.propagation.analytical.EcksteinHechlerPropagator) Propagator(org.orekit.propagation.Propagator) 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