Search in sources :

Example 66 with TimeComponents

use of org.orekit.time.TimeComponents in project Orekit by CS-SI.

the class DSSTPropagatorTest method getLEOStatePropagatedBy30Minutes.

private SpacecraftState getLEOStatePropagatedBy30Minutes() throws IllegalArgumentException, OrekitException {
    final Vector3D position = new Vector3D(-6142438.668, 3492467.560, -25767.25680);
    final Vector3D velocity = new Vector3D(505.8479685, 942.7809215, 7435.922231);
    // Spring equinoxe 21st mars 2003 1h00m
    final AbsoluteDate initialDate = new AbsoluteDate(new DateComponents(2003, 03, 21), new TimeComponents(1, 0, 0.), TimeScalesFactory.getUTC());
    final CartesianOrbit osculatingOrbit = new CartesianOrbit(new PVCoordinates(position, velocity), FramesFactory.getTOD(IERSConventions.IERS_1996, false), initialDate, Constants.WGS84_EARTH_MU);
    // Adaptive step integrator
    // with a minimum step of 0.001 and a maximum step of 1000
    double minStep = 0.001;
    double maxstep = 1000.0;
    double positionTolerance = 10.0;
    OrbitType propagationType = OrbitType.EQUINOCTIAL;
    double[][] tolerances = NumericalPropagator.tolerances(positionTolerance, osculatingOrbit, propagationType);
    AdaptiveStepsizeIntegrator integrator = new DormandPrince853Integrator(minStep, maxstep, tolerances[0], tolerances[1]);
    NumericalPropagator propagator = new NumericalPropagator(integrator);
    propagator.setOrbitType(propagationType);
    NormalizedSphericalHarmonicsProvider provider = GravityFieldFactory.getNormalizedProvider(5, 5);
    ForceModel holmesFeatherstone = new HolmesFeatherstoneAttractionModel(FramesFactory.getITRF(IERSConventions.IERS_2010, true), provider);
    propagator.addForceModel(holmesFeatherstone);
    propagator.setInitialState(new SpacecraftState(osculatingOrbit));
    return propagator.propagate(new AbsoluteDate(initialDate, 1800.));
}
Also used : CartesianOrbit(org.orekit.orbits.CartesianOrbit) ForceModel(org.orekit.forces.ForceModel) DSSTForceModel(org.orekit.propagation.semianalytical.dsst.forces.DSSTForceModel) AdaptiveStepsizeIntegrator(org.hipparchus.ode.nonstiff.AdaptiveStepsizeIntegrator) TimeStampedPVCoordinates(org.orekit.utils.TimeStampedPVCoordinates) PVCoordinates(org.orekit.utils.PVCoordinates) DateComponents(org.orekit.time.DateComponents) TimeComponents(org.orekit.time.TimeComponents) AbsoluteDate(org.orekit.time.AbsoluteDate) SpacecraftState(org.orekit.propagation.SpacecraftState) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) NumericalPropagator(org.orekit.propagation.numerical.NumericalPropagator) OrbitType(org.orekit.orbits.OrbitType) DormandPrince853Integrator(org.hipparchus.ode.nonstiff.DormandPrince853Integrator) NormalizedSphericalHarmonicsProvider(org.orekit.forces.gravity.potential.NormalizedSphericalHarmonicsProvider) HolmesFeatherstoneAttractionModel(org.orekit.forces.gravity.HolmesFeatherstoneAttractionModel)

Example 67 with TimeComponents

use of org.orekit.time.TimeComponents in project Orekit by CS-SI.

the class TLETest method testBug77TooLargeSecondDerivative.

@Test
public void testBug77TooLargeSecondDerivative() throws OrekitException {
    try {
        TLE tle = new TLE(5555, 'U', 1971, 86, "J", 0, 908, new AbsoluteDate(new DateComponents(2012, 26), new TimeComponents(0.96078249 * Constants.JULIAN_DAY), TimeScalesFactory.getUTC()), taylorConvert(12.26882470, 1), taylorConvert(-0.00000004, 2), taylorConvert(0.99999e11, 3), 0.0075476, FastMath.toRadians(74.0161), FastMath.toRadians(328.9888), FastMath.toRadians(228.9750), FastMath.toRadians(30.6709), 80454, 0.01234e-9);
        tle.getLine1();
        Assert.fail("an exception should have been thrown");
    } catch (OrekitException oe) {
        Assert.assertEquals(OrekitMessages.TLE_INVALID_PARAMETER, oe.getSpecifier());
        Assert.assertEquals(5555, ((Integer) oe.getParts()[0]).intValue());
        Assert.assertEquals("meanMotionSecondDerivative", oe.getParts()[1]);
    }
}
Also used : DateComponents(org.orekit.time.DateComponents) OrekitException(org.orekit.errors.OrekitException) TimeComponents(org.orekit.time.TimeComponents) AbsoluteDate(org.orekit.time.AbsoluteDate) Test(org.junit.Test)

Example 68 with TimeComponents

use of org.orekit.time.TimeComponents in project Orekit by CS-SI.

the class TLETest method testBug77TooLargeBStar.

@Test
public void testBug77TooLargeBStar() throws OrekitException {
    try {
        TLE tle = new TLE(5555, 'U', 1971, 86, "J", 0, 908, new AbsoluteDate(new DateComponents(2012, 26), new TimeComponents(0.96078249 * Constants.JULIAN_DAY), TimeScalesFactory.getUTC()), taylorConvert(12.26882470, 1), taylorConvert(-0.00000004, 2), taylorConvert(0.00001e-9, 3), 0.0075476, FastMath.toRadians(74.0161), FastMath.toRadians(328.9888), FastMath.toRadians(228.9750), FastMath.toRadians(30.6709), 80454, 0.99999e11);
        tle.getLine1();
        Assert.fail("an exception should have been thrown");
    } catch (OrekitException oe) {
        Assert.assertEquals(OrekitMessages.TLE_INVALID_PARAMETER, oe.getSpecifier());
        Assert.assertEquals(5555, ((Integer) oe.getParts()[0]).intValue());
        Assert.assertEquals("B*", oe.getParts()[1]);
    }
}
Also used : DateComponents(org.orekit.time.DateComponents) OrekitException(org.orekit.errors.OrekitException) TimeComponents(org.orekit.time.TimeComponents) AbsoluteDate(org.orekit.time.AbsoluteDate) Test(org.junit.Test)

Example 69 with TimeComponents

use of org.orekit.time.TimeComponents in project Orekit by CS-SI.

the class TLETest method testBug77TooLargeSatelliteNumber2.

@Test
public void testBug77TooLargeSatelliteNumber2() throws OrekitException {
    try {
        TLE tle = new TLE(1000000, 'U', 1971, 86, "J", 0, 908, new AbsoluteDate(new DateComponents(2012, 26), new TimeComponents(0.96078249 * Constants.JULIAN_DAY), TimeScalesFactory.getUTC()), taylorConvert(12.26882470, 1), taylorConvert(-0.00000004, 2), taylorConvert(0.00001e-9, 3), 0.0075476, FastMath.toRadians(74.0161), FastMath.toRadians(328.9888), FastMath.toRadians(228.9750), FastMath.toRadians(30.6709), 80454, 0.01234e-9);
        tle.getLine2();
        Assert.fail("an exception should have been thrown");
    } catch (OrekitException oe) {
        Assert.assertEquals(OrekitMessages.TLE_INVALID_PARAMETER, oe.getSpecifier());
        Assert.assertEquals(1000000, ((Integer) oe.getParts()[0]).intValue());
        Assert.assertEquals("satelliteNumber-2", oe.getParts()[1]);
    }
}
Also used : DateComponents(org.orekit.time.DateComponents) OrekitException(org.orekit.errors.OrekitException) TimeComponents(org.orekit.time.TimeComponents) AbsoluteDate(org.orekit.time.AbsoluteDate) Test(org.junit.Test)

Example 70 with TimeComponents

use of org.orekit.time.TimeComponents in project Orekit by CS-SI.

the class TLETest method testBug77TooLargeEccentricity.

@Test
public void testBug77TooLargeEccentricity() throws OrekitException {
    try {
        TLE tle = new TLE(5555, 'U', 1971, 86, "J", 0, 908, new AbsoluteDate(new DateComponents(2012, 26), new TimeComponents(0.96078249 * Constants.JULIAN_DAY), TimeScalesFactory.getUTC()), taylorConvert(12.26882470, 1), taylorConvert(-0.00000004, 2), taylorConvert(0.00001e-9, 3), 1.0075476, FastMath.toRadians(74.0161), FastMath.toRadians(328.9888), FastMath.toRadians(228.9750), FastMath.toRadians(30.6709), 80454, 0.01234e-9);
        tle.getLine2();
        Assert.fail("an exception should have been thrown");
    } catch (OrekitException oe) {
        Assert.assertEquals(OrekitMessages.TLE_INVALID_PARAMETER, oe.getSpecifier());
        Assert.assertEquals(5555, ((Integer) oe.getParts()[0]).intValue());
        Assert.assertEquals("eccentricity", oe.getParts()[1]);
    }
}
Also used : DateComponents(org.orekit.time.DateComponents) OrekitException(org.orekit.errors.OrekitException) TimeComponents(org.orekit.time.TimeComponents) AbsoluteDate(org.orekit.time.AbsoluteDate) Test(org.junit.Test)

Aggregations

TimeComponents (org.orekit.time.TimeComponents)88 DateComponents (org.orekit.time.DateComponents)87 AbsoluteDate (org.orekit.time.AbsoluteDate)84 Test (org.junit.Test)72 KeplerianOrbit (org.orekit.orbits.KeplerianOrbit)55 FieldAbsoluteDate (org.orekit.time.FieldAbsoluteDate)55 Vector3D (org.hipparchus.geometry.euclidean.threed.Vector3D)47 Orbit (org.orekit.orbits.Orbit)44 SpacecraftState (org.orekit.propagation.SpacecraftState)42 CartesianOrbit (org.orekit.orbits.CartesianOrbit)35 FieldKeplerianOrbit (org.orekit.orbits.FieldKeplerianOrbit)35 FieldSpacecraftState (org.orekit.propagation.FieldSpacecraftState)32 AbstractLegacyForceModelTest (org.orekit.forces.AbstractLegacyForceModelTest)28 PVCoordinates (org.orekit.utils.PVCoordinates)24 EquinoctialOrbit (org.orekit.orbits.EquinoctialOrbit)22 FieldVector3D (org.hipparchus.geometry.euclidean.threed.FieldVector3D)17 Rotation (org.hipparchus.geometry.euclidean.threed.Rotation)17 NumericalPropagator (org.orekit.propagation.numerical.NumericalPropagator)17 CircularOrbit (org.orekit.orbits.CircularOrbit)16 FieldNumericalPropagator (org.orekit.propagation.numerical.FieldNumericalPropagator)16