Search in sources :

Example 51 with OneAxisEllipsoid

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

the class BodyCenterPointingTest method setUp.

@Before
public void setUp() {
    try {
        Utils.setDataRoot("regular-data");
        // Computation date
        date = new AbsoluteDate(new DateComponents(2008, 04, 07), TimeComponents.H00, TimeScalesFactory.getUTC());
        // Satellite position as circular parameters
        final double mu = 3.9860047e14;
        final double raan = 270.;
        circ = new CircularOrbit(7178000.0, 0.5e-4, -0.5e-4, FastMath.toRadians(50.), FastMath.toRadians(raan), FastMath.toRadians(5.300 - raan), PositionAngle.MEAN, FramesFactory.getEME2000(), date, mu);
        // WGS84 Earth model
        earth = new OneAxisEllipsoid(Constants.WGS84_EARTH_EQUATORIAL_RADIUS, Constants.WGS84_EARTH_FLATTENING, FramesFactory.getITRF(IERSConventions.IERS_2010, true));
        // Transform from EME2000 to ITRF2008
        eme2000ToItrf = FramesFactory.getEME2000().getTransformTo(earth.getBodyFrame(), date);
        // Create earth center pointing attitude provider
        earthCenterAttitudeLaw = new BodyCenterPointing(circ.getFrame(), earth);
    } catch (OrekitException oe) {
        Assert.fail(oe.getMessage());
    }
}
Also used : OneAxisEllipsoid(org.orekit.bodies.OneAxisEllipsoid) CircularOrbit(org.orekit.orbits.CircularOrbit) FieldCircularOrbit(org.orekit.orbits.FieldCircularOrbit) DateComponents(org.orekit.time.DateComponents) OrekitException(org.orekit.errors.OrekitException) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate) AbsoluteDate(org.orekit.time.AbsoluteDate) Before(org.junit.Before)

Example 52 with OneAxisEllipsoid

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

the class LofOffsetTest method testOffset.

/**
 * Test if the lof offset is the one expected
 */
@Test
public void testOffset() throws OrekitException {
    // Satellite position
    final CircularOrbit circ = new CircularOrbit(7178000.0, 0.5e-4, -0.5e-4, FastMath.toRadians(0.), FastMath.toRadians(270.), FastMath.toRadians(5.300), PositionAngle.MEAN, FramesFactory.getEME2000(), date, mu);
    // Create target pointing attitude provider
    // ************************************
    // Elliptic earth shape
    final OneAxisEllipsoid earthShape = new OneAxisEllipsoid(6378136.460, 1 / 298.257222101, itrf);
    final GeodeticPoint geoTargetITRF = new GeodeticPoint(FastMath.toRadians(43.36), FastMath.toRadians(1.26), 600.);
    // Attitude law definition from geodetic point target
    final TargetPointing targetLaw = new TargetPointing(circ.getFrame(), geoTargetITRF, earthShape);
    final Rotation targetRot = targetLaw.getAttitude(circ, date, circ.getFrame()).getRotation();
    // Create lof aligned attitude provider
    // *******************************
    final LofOffset lofAlignedLaw = new LofOffset(orbit.getFrame(), LOFType.VVLH);
    final Rotation lofAlignedRot = lofAlignedLaw.getAttitude(circ, date, circ.getFrame()).getRotation();
    // Get rotation from LOF to target pointing attitude
    Rotation rollPitchYaw = targetRot.compose(lofAlignedRot.revert(), RotationConvention.VECTOR_OPERATOR).revert();
    final double[] angles = rollPitchYaw.getAngles(RotationOrder.ZYX, RotationConvention.VECTOR_OPERATOR);
    final double yaw = angles[0];
    final double pitch = angles[1];
    final double roll = angles[2];
    // Create lof offset attitude provider with computed roll, pitch, yaw
    // **************************************************************
    final LofOffset lofOffsetLaw = new LofOffset(orbit.getFrame(), LOFType.VVLH, RotationOrder.ZYX, yaw, pitch, roll);
    final Rotation lofOffsetRot = lofOffsetLaw.getAttitude(circ, date, circ.getFrame()).getRotation();
    // Compose rotations : target pointing attitudes
    final double angleCompo = targetRot.composeInverse(lofOffsetRot, RotationConvention.VECTOR_OPERATOR).getAngle();
    Assert.assertEquals(0., angleCompo, Utils.epsilonAngle);
}
Also used : OneAxisEllipsoid(org.orekit.bodies.OneAxisEllipsoid) CircularOrbit(org.orekit.orbits.CircularOrbit) GeodeticPoint(org.orekit.bodies.GeodeticPoint) Rotation(org.hipparchus.geometry.euclidean.threed.Rotation) Test(org.junit.Test)

Example 53 with OneAxisEllipsoid

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

the class TargetPointingTest method testSlewedTarget.

/**
 * Test the difference between pointing over two longitudes separated by 5°
 */
@Test
public void testSlewedTarget() throws OrekitException {
    // Spheric earth shape
    OneAxisEllipsoid earthShape = new OneAxisEllipsoid(6378136.460, 0., itrf);
    // Satellite position
    // ********************
    // Create satellite position as circular parameters
    CircularOrbit circ = new CircularOrbit(42164000.0, 0.5e-8, -0.5e-8, 0., 0., FastMath.toRadians(5.300), PositionAngle.MEAN, FramesFactory.getEME2000(), date, mu);
    // Create nadir pointing attitude provider
    // **********************************
    NadirPointing nadirAttitudeLaw = new NadirPointing(circ.getFrame(), earthShape);
    // Get observed ground point from nadir pointing law
    Vector3D pNadirObservedEME2000 = nadirAttitudeLaw.getTargetPV(circ, date, FramesFactory.getEME2000()).getPosition();
    Vector3D pNadirObservedITRF = eme2000ToItrf.transformPosition(pNadirObservedEME2000);
    GeodeticPoint geoNadirObserved = earthShape.transform(pNadirObservedITRF, itrf, date);
    // Create target pointing attitude provider with target equal to nadir target
    // *********************************************************************
    TargetPointing targetLawRef = new TargetPointing(circ.getFrame(), itrf, pNadirObservedITRF);
    // Get attitude rotation in EME2000
    Rotation rotSatRefEME2000 = targetLawRef.getAttitude(circ, date, circ.getFrame()).getRotation();
    // Create target pointing attitude provider with target 5° from nadir target
    // ********************************************************************
    GeodeticPoint geoTarget = new GeodeticPoint(geoNadirObserved.getLatitude(), geoNadirObserved.getLongitude() - FastMath.toRadians(5), geoNadirObserved.getAltitude());
    Vector3D pTargetITRF = earthShape.transform(geoTarget);
    TargetPointing targetLaw = new TargetPointing(circ.getFrame(), itrf, pTargetITRF);
    // Get attitude rotation
    Rotation rotSatEME2000 = targetLaw.getAttitude(circ, date, circ.getFrame()).getRotation();
    checkField(Decimal64Field.getInstance(), targetLaw, circ, circ.getDate(), circ.getFrame());
    // Compute difference between both attitude providers
    // *********************************************
    // Difference between attitudes
    // expected
    double tanDeltaExpected = (6378136.460 / (42164000.0 - 6378136.460)) * FastMath.tan(FastMath.toRadians(5));
    double deltaExpected = FastMath.atan(tanDeltaExpected);
    // real
    double deltaReal = Rotation.distance(rotSatEME2000, rotSatRefEME2000);
    Assert.assertEquals(deltaReal, deltaExpected, 1.e-4);
}
Also used : OneAxisEllipsoid(org.orekit.bodies.OneAxisEllipsoid) CircularOrbit(org.orekit.orbits.CircularOrbit) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) GeodeticPoint(org.orekit.bodies.GeodeticPoint) Rotation(org.hipparchus.geometry.euclidean.threed.Rotation) Test(org.junit.Test)

Example 54 with OneAxisEllipsoid

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

the class TargetPointingTest method testSpin.

@Test
public void testSpin() throws OrekitException {
    Frame itrf = FramesFactory.getITRF(IERSConventions.IERS_2010, true);
    // Elliptic earth shape
    OneAxisEllipsoid earthShape = new OneAxisEllipsoid(6378136.460, 1 / 298.257222101, itrf);
    // Create target pointing attitude provider
    GeodeticPoint geoTarget = new GeodeticPoint(FastMath.toRadians(43.36), FastMath.toRadians(1.26), 600.);
    AttitudeProvider law = new TargetPointing(FramesFactory.getEME2000(), geoTarget, earthShape);
    KeplerianOrbit orbit = new KeplerianOrbit(7178000.0, 1.e-4, FastMath.toRadians(50.), FastMath.toRadians(10.), FastMath.toRadians(20.), FastMath.toRadians(30.), PositionAngle.MEAN, FramesFactory.getEME2000(), date, 3.986004415e14);
    Propagator propagator = new KeplerianPropagator(orbit, law);
    double h = 0.01;
    SpacecraftState sMinus = propagator.propagate(date.shiftedBy(-h));
    SpacecraftState s0 = propagator.propagate(date);
    SpacecraftState sPlus = propagator.propagate(date.shiftedBy(h));
    // check spin is consistent with attitude evolution
    double errorAngleMinus = Rotation.distance(sMinus.shiftedBy(h).getAttitude().getRotation(), s0.getAttitude().getRotation());
    double evolutionAngleMinus = Rotation.distance(sMinus.getAttitude().getRotation(), s0.getAttitude().getRotation());
    Assert.assertEquals(0.0, errorAngleMinus, 1.0e-5 * evolutionAngleMinus);
    double errorAnglePlus = Rotation.distance(s0.getAttitude().getRotation(), sPlus.shiftedBy(-h).getAttitude().getRotation());
    double evolutionAnglePlus = Rotation.distance(s0.getAttitude().getRotation(), sPlus.getAttitude().getRotation());
    Assert.assertEquals(0.0, errorAnglePlus, 1.0e-5 * evolutionAnglePlus);
    Vector3D spin0 = s0.getAttitude().getSpin();
    Vector3D reference = AngularCoordinates.estimateRate(sMinus.getAttitude().getRotation(), sPlus.getAttitude().getRotation(), 2 * h);
    Assert.assertEquals(0.0, spin0.subtract(reference).getNorm(), 1.1e-10);
}
Also used : KeplerianPropagator(org.orekit.propagation.analytical.KeplerianPropagator) FieldSpacecraftState(org.orekit.propagation.FieldSpacecraftState) SpacecraftState(org.orekit.propagation.SpacecraftState) Frame(org.orekit.frames.Frame) OneAxisEllipsoid(org.orekit.bodies.OneAxisEllipsoid) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) Propagator(org.orekit.propagation.Propagator) KeplerianPropagator(org.orekit.propagation.analytical.KeplerianPropagator) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) GeodeticPoint(org.orekit.bodies.GeodeticPoint) Test(org.junit.Test)

Example 55 with OneAxisEllipsoid

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

the class TabulatedProviderTest method setUp.

@Before
public void setUp() {
    try {
        Utils.setDataRoot("regular-data");
        // Computation date
        date = new AbsoluteDate(new DateComponents(2008, 04, 07), TimeComponents.H00, TimeScalesFactory.getUTC());
        // Body mu
        final double mu = 3.9860047e14;
        // Reference frame = ITRF
        itrf = FramesFactory.getITRF(IERSConventions.IERS_2010, true);
        // Satellite position
        circOrbit = new CircularOrbit(7178000.0, 0.5e-4, -0.5e-4, FastMath.toRadians(50.), FastMath.toRadians(270.), FastMath.toRadians(5.300), PositionAngle.MEAN, FramesFactory.getEME2000(), date, mu);
        // Elliptic earth shape
        earthShape = new OneAxisEllipsoid(6378136.460, 1 / 298.257222101, itrf);
    } catch (OrekitException oe) {
        Assert.fail(oe.getMessage());
    }
}
Also used : OneAxisEllipsoid(org.orekit.bodies.OneAxisEllipsoid) CircularOrbit(org.orekit.orbits.CircularOrbit) DateComponents(org.orekit.time.DateComponents) OrekitException(org.orekit.errors.OrekitException) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate) AbsoluteDate(org.orekit.time.AbsoluteDate) Before(org.junit.Before)

Aggregations

OneAxisEllipsoid (org.orekit.bodies.OneAxisEllipsoid)146 Test (org.junit.Test)89 AbsoluteDate (org.orekit.time.AbsoluteDate)83 GeodeticPoint (org.orekit.bodies.GeodeticPoint)65 KeplerianOrbit (org.orekit.orbits.KeplerianOrbit)59 Vector3D (org.hipparchus.geometry.euclidean.threed.Vector3D)57 SpacecraftState (org.orekit.propagation.SpacecraftState)48 Frame (org.orekit.frames.Frame)47 FieldAbsoluteDate (org.orekit.time.FieldAbsoluteDate)45 Orbit (org.orekit.orbits.Orbit)42 PVCoordinates (org.orekit.utils.PVCoordinates)42 TopocentricFrame (org.orekit.frames.TopocentricFrame)34 EquinoctialOrbit (org.orekit.orbits.EquinoctialOrbit)31 OrekitException (org.orekit.errors.OrekitException)29 CircularOrbit (org.orekit.orbits.CircularOrbit)29 KeplerianPropagator (org.orekit.propagation.analytical.KeplerianPropagator)29 DateComponents (org.orekit.time.DateComponents)29 Propagator (org.orekit.propagation.Propagator)28 Before (org.junit.Before)26 FieldKeplerianOrbit (org.orekit.orbits.FieldKeplerianOrbit)23