Search in sources :

Example 16 with CelestialBody

use of org.orekit.bodies.CelestialBody in project Orekit by CS-SI.

the class L2TransformProviderTest method testTransformationOrientationForEarthMoon.

@Test
public void testTransformationOrientationForEarthMoon() throws OrekitException {
    // Load Bodies
    final CelestialBody earth = CelestialBodyFactory.getEarth();
    final CelestialBody moon = CelestialBodyFactory.getMoon();
    // Set framesd
    final Frame eme2000 = FramesFactory.getEME2000();
    final Frame l2Frame = new L2Frame(earth, moon);
    // Time settings
    final AbsoluteDate date = new AbsoluteDate(2000, 01, 01, 0, 0, 00.000, TimeScalesFactory.getUTC());
    // Compute Moon position in EME2000
    PVCoordinates pvMoon = moon.getPVCoordinates(date, eme2000);
    Vector3D posMoon = pvMoon.getPosition();
    // Compute L2 position in EME2000
    // (it is important to use transformPosition(Vector3D.ZERO) and *not* getTranslation()
    // because the test should avoid doing wrong interpretation of the meaning and
    // particularly on the sign of the translation)
    Vector3D posL2 = l2Frame.getTransformTo(eme2000, date).transformPosition(Vector3D.ZERO);
    // check L2 and Moon are aligned as seen from Earth
    Assert.assertEquals(0.0, Vector3D.angle(posMoon, posL2), 1.0e-10);
    // check L2 if at least 60 000km farther than Moon
    Assert.assertTrue(posL2.getNorm() > posMoon.getNorm() + 6.0e7);
}
Also used : Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) CelestialBody(org.orekit.bodies.CelestialBody) PVCoordinates(org.orekit.utils.PVCoordinates) AbsoluteDate(org.orekit.time.AbsoluteDate) Test(org.junit.Test)

Example 17 with CelestialBody

use of org.orekit.bodies.CelestialBody in project Orekit by CS-SI.

the class L2TransformProviderTest method testL2Orientation.

@Test
public void testL2Orientation() throws OrekitException {
    final AbsoluteDate date0 = new AbsoluteDate(2000, 01, 1, 11, 58, 20.000, TimeScalesFactory.getUTC());
    final CelestialBody sun = CelestialBodyFactory.getSun();
    final CelestialBody earth = CelestialBodyFactory.getEarth();
    final Frame l2Frame = new L2Frame(sun, earth);
    for (double dt = -Constants.JULIAN_DAY; dt <= Constants.JULIAN_DAY; dt += 3600.0) {
        final AbsoluteDate date = date0.shiftedBy(dt);
        final Vector3D sunPositionInL2 = sun.getPVCoordinates(date, l2Frame).getPosition();
        final Vector3D earthPositionInL2 = earth.getPVCoordinates(date, l2Frame).getPosition();
        Assert.assertEquals(0.0, Vector3D.angle(sunPositionInL2, Vector3D.MINUS_I), 3.0e-14);
        Assert.assertEquals(0.0, Vector3D.angle(earthPositionInL2, Vector3D.MINUS_I), 3.0e-14);
    }
}
Also used : Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) CelestialBody(org.orekit.bodies.CelestialBody) AbsoluteDate(org.orekit.time.AbsoluteDate) Test(org.junit.Test)

Example 18 with CelestialBody

use of org.orekit.bodies.CelestialBody in project Orekit by CS-SI.

the class L2TransformProviderTest method testSunJupiter.

@Test
public void testSunJupiter() throws OrekitException {
    // Load Bodies
    final CelestialBody sun = CelestialBodyFactory.getSun();
    final CelestialBody jupiter = CelestialBodyFactory.getJupiter();
    // Set frames
    final Frame sunFrame = sun.getInertiallyOrientedFrame();
    final Frame l2Frame = new L2Frame(sun, jupiter);
    // Time settings
    final AbsoluteDate date = new AbsoluteDate(2000, 01, 01, 0, 0, 00.000, TimeScalesFactory.getUTC());
    // Compute Jupiter position in Sun centered frame
    PVCoordinates pvJupiter = jupiter.getPVCoordinates(date, sunFrame);
    Vector3D posJupiter = pvJupiter.getPosition();
    // Compute L2 position in Sun centered frame
    // (it is important to use transformPosition(Vector3D.ZERO) and *not* getTranslation()
    // because the test should avoid doing wrong interpretation of the meaning and
    // particularly on the sign of the translation)
    Vector3D posL2 = l2Frame.getTransformTo(sunFrame, date).transformPosition(Vector3D.ZERO);
    // check L2 and Jupiter are aligned as seen from Sun
    Assert.assertEquals(0.0, Vector3D.angle(posJupiter, posL2), 1.0e-10);
    // check L2 if at least 50 000 000km farther than Jupiter
    Assert.assertTrue(posL2.getNorm() > posJupiter.getNorm() + 5.0e10);
}
Also used : Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) CelestialBody(org.orekit.bodies.CelestialBody) PVCoordinates(org.orekit.utils.PVCoordinates) AbsoluteDate(org.orekit.time.AbsoluteDate) Test(org.junit.Test)

Example 19 with CelestialBody

use of org.orekit.bodies.CelestialBody in project Orekit by CS-SI.

the class L1TransformProviderTest method testTransformationOrientationForEarthMoon.

@Test
public void testTransformationOrientationForEarthMoon() throws OrekitException {
    // Load Bodies
    final CelestialBody earth = CelestialBodyFactory.getEarth();
    final CelestialBody moon = CelestialBodyFactory.getMoon();
    // Set framesd
    final Frame eme2000 = FramesFactory.getEME2000();
    final Frame l1Frame = new L1Frame(earth, moon);
    // Time settings
    final AbsoluteDate date = new AbsoluteDate(2000, 01, 01, 0, 0, 00.000, TimeScalesFactory.getUTC());
    // Compute Moon position in EME2000
    PVCoordinates pvMoon = moon.getPVCoordinates(date, eme2000);
    Vector3D posMoon = pvMoon.getPosition();
    // Compute L1 position in EME2000
    // (it is important to use transformPosition(Vector3D.ZERO) and *not* getTranslation()
    // because the test should avoid doing wrong interpretation of the meaning and
    // particularly on the sign of the translation)
    Vector3D posL1 = l1Frame.getTransformTo(eme2000, date).transformPosition(Vector3D.ZERO);
    // check L1 and Moon are aligned as seen from Earth
    Assert.assertEquals(0.0, Vector3D.angle(posMoon, posL1), 1.0e-10);
    // check the Moon is at least 40 000km farther than L1
    Assert.assertTrue(posMoon.getNorm() > posL1.getNorm() + 4.0e7);
}
Also used : Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) CelestialBody(org.orekit.bodies.CelestialBody) PVCoordinates(org.orekit.utils.PVCoordinates) AbsoluteDate(org.orekit.time.AbsoluteDate) Test(org.junit.Test)

Example 20 with CelestialBody

use of org.orekit.bodies.CelestialBody in project Orekit by CS-SI.

the class L1TransformProviderTest method testSunJupiter.

@Test
public void testSunJupiter() throws OrekitException {
    // Load Bodies
    final CelestialBody sun = CelestialBodyFactory.getSun();
    final CelestialBody jupiter = CelestialBodyFactory.getJupiter();
    // Set frames
    final Frame sunFrame = sun.getInertiallyOrientedFrame();
    final Frame l1Frame = new L1Frame(sun, jupiter);
    // Time settings
    final AbsoluteDate date = new AbsoluteDate(2000, 01, 01, 0, 0, 00.000, TimeScalesFactory.getUTC());
    // Compute Jupiter position in Sun centered frame
    PVCoordinates pvJupiter = jupiter.getPVCoordinates(date, sunFrame);
    Vector3D posJupiter = pvJupiter.getPosition();
    // Compute L1 position in Sun centered frame
    // (it is important to use transformPosition(Vector3D.ZERO) and *not* getTranslation()
    // because the test should avoid doing wrong interpretation of the meaning and
    // particularly on the sign of the translation)
    Vector3D posL1 = l1Frame.getTransformTo(sunFrame, date).transformPosition(Vector3D.ZERO);
    // check L1 and Jupiter are aligned as seen from Sun
    Assert.assertEquals(0.0, Vector3D.angle(posJupiter, posL1), 1.0e-10);
    // check if Jupiter is at least 45 000 000km farther than L1
    Assert.assertTrue(posJupiter.getNorm() > posL1.getNorm() + 4.5e10);
}
Also used : Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) CelestialBody(org.orekit.bodies.CelestialBody) PVCoordinates(org.orekit.utils.PVCoordinates) AbsoluteDate(org.orekit.time.AbsoluteDate) Test(org.junit.Test)

Aggregations

CelestialBody (org.orekit.bodies.CelestialBody)51 Test (org.junit.Test)43 AbsoluteDate (org.orekit.time.AbsoluteDate)34 SpacecraftState (org.orekit.propagation.SpacecraftState)32 Vector3D (org.hipparchus.geometry.euclidean.threed.Vector3D)27 FieldAbsoluteDate (org.orekit.time.FieldAbsoluteDate)17 FieldVector3D (org.hipparchus.geometry.euclidean.threed.FieldVector3D)14 ArrayList (java.util.ArrayList)9 OneAxisEllipsoid (org.orekit.bodies.OneAxisEllipsoid)7 OrekitException (org.orekit.errors.OrekitException)7 Frame (org.orekit.frames.Frame)7 CartesianOrbit (org.orekit.orbits.CartesianOrbit)7 KeplerianOrbit (org.orekit.orbits.KeplerianOrbit)7 DerivativeStructure (org.hipparchus.analysis.differentiation.DerivativeStructure)6 Atmosphere (org.orekit.forces.drag.atmosphere.Atmosphere)6 Orbit (org.orekit.orbits.Orbit)6 DSSTSolarRadiationPressure (org.orekit.propagation.semianalytical.dsst.forces.DSSTSolarRadiationPressure)6 DormandPrince853Integrator (org.hipparchus.ode.nonstiff.DormandPrince853Integrator)5 IsotropicRadiationSingleCoefficient (org.orekit.forces.radiation.IsotropicRadiationSingleCoefficient)5 EquinoctialOrbit (org.orekit.orbits.EquinoctialOrbit)5