Search in sources :

Example 6 with BodyCenterPointing

use of org.orekit.attitudes.BodyCenterPointing in project Orekit by CS-SI.

the class PropagatorsParallelizerTest method setUp.

@Before
public void setUp() {
    try {
        Utils.setDataRoot("regular-data:potential/icgem-format");
        unnormalizedGravityField = GravityFieldFactory.getUnnormalizedProvider(6, 0);
        normalizedGravityField = GravityFieldFactory.getNormalizedProvider(6, 0);
        mass = 2500;
        double a = 7187990.1979844316;
        double e = 0.5e-4;
        double i = 1.7105407051081795;
        double omega = 1.9674147913622104;
        double OMEGA = FastMath.toRadians(261);
        double lv = 0;
        AbsoluteDate date = new AbsoluteDate(new DateComponents(2004, 01, 01), TimeComponents.H00, TimeScalesFactory.getUTC());
        orbit = new KeplerianOrbit(a, e, i, omega, OMEGA, lv, PositionAngle.TRUE, FramesFactory.getEME2000(), date, normalizedGravityField.getMu());
        OneAxisEllipsoid earth = new OneAxisEllipsoid(Constants.WGS84_EARTH_EQUATORIAL_RADIUS, Constants.WGS84_EARTH_FLATTENING, FramesFactory.getITRF(IERSConventions.IERS_2010, true));
        attitudeLaw = new BodyCenterPointing(orbit.getFrame(), earth);
    } catch (OrekitException oe) {
        Assert.fail(oe.getLocalizedMessage());
    }
}
Also used : OneAxisEllipsoid(org.orekit.bodies.OneAxisEllipsoid) BodyCenterPointing(org.orekit.attitudes.BodyCenterPointing) DateComponents(org.orekit.time.DateComponents) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) OrekitException(org.orekit.errors.OrekitException) AbsoluteDate(org.orekit.time.AbsoluteDate) Before(org.junit.Before)

Example 7 with BodyCenterPointing

use of org.orekit.attitudes.BodyCenterPointing 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 8 with BodyCenterPointing

use of org.orekit.attitudes.BodyCenterPointing in project Orekit by CS-SI.

the class TLEPropagatorTest method testBodyCenterInPointingDirection.

/**
 * Test if body center belongs to the direction pointed by the satellite
 */
@Test
public void testBodyCenterInPointingDirection() throws OrekitException {
    final Frame itrf = FramesFactory.getITRF(IERSConventions.IERS_2010, true);
    final OneAxisEllipsoid earth = new OneAxisEllipsoid(Constants.WGS84_EARTH_EQUATORIAL_RADIUS, Constants.WGS84_EARTH_FLATTENING, itrf);
    DistanceChecker checker = new DistanceChecker(itrf);
    // with Earth pointing attitude, distance should be small
    TLEPropagator propagator = TLEPropagator.selectExtrapolator(tle, new BodyCenterPointing(FramesFactory.getTEME(), earth), Propagator.DEFAULT_MASS);
    propagator.setMasterMode(900.0, checker);
    propagator.propagate(tle.getDate().shiftedBy(period));
    Assert.assertEquals(0.0, checker.getMaxDistance(), 2.0e-7);
    // with default attitude mode, distance should be large
    propagator = TLEPropagator.selectExtrapolator(tle);
    propagator.setMasterMode(900.0, checker);
    propagator.propagate(tle.getDate().shiftedBy(period));
    Assert.assertEquals(1.5219e7, checker.getMinDistance(), 1000.0);
    Assert.assertEquals(2.6572e7, checker.getMaxDistance(), 1000.0);
}
Also used : Frame(org.orekit.frames.Frame) OneAxisEllipsoid(org.orekit.bodies.OneAxisEllipsoid) BodyCenterPointing(org.orekit.attitudes.BodyCenterPointing) Test(org.junit.Test)

Example 9 with BodyCenterPointing

use of org.orekit.attitudes.BodyCenterPointing 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 10 with BodyCenterPointing

use of org.orekit.attitudes.BodyCenterPointing in project Orekit by CS-SI.

the class FieldSpacecraftStateTest method doTestDateConsistencyClose.

/**
 * Check orbit and attitude dates can be off by a few ulps. I see this when using
 * FixedRate attitude provider.
 */
private <T extends RealFieldElement<T>> void doTestDateConsistencyClose(final Field<T> field) throws OrekitException {
    // setup
    T zero = field.getZero();
    T one = field.getOne();
    T a = zero.add(rOrbit.getA());
    T e = zero.add(rOrbit.getE());
    T i = zero.add(rOrbit.getI());
    T pa = zero.add(1.9674147913622104);
    T raan = zero.add(FastMath.toRadians(261));
    T lv = zero.add(0);
    FieldAbsoluteDate<T> date = new FieldAbsoluteDate<>(field, new DateComponents(2004, 01, 01), TimeComponents.H00, TimeScalesFactory.getUTC());
    FieldKeplerianOrbit<T> orbit = new FieldKeplerianOrbit<>(a, e, i, pa, raan, lv, PositionAngle.TRUE, FramesFactory.getEME2000(), date, mu);
    FieldKeplerianOrbit<T> orbit10Shifts = orbit;
    for (int ii = 0; ii < 10; ii++) {
        orbit10Shifts = orbit10Shifts.shiftedBy(zero.add(0.1));
    }
    final FieldOrbit<T> orbit1Shift = orbit.shiftedBy(one);
    BodyCenterPointing attitudeLaw = new BodyCenterPointing(orbit.getFrame(), earth);
    FieldAttitude<T> shiftedAttitude = attitudeLaw.getAttitude(orbit1Shift, orbit1Shift.getDate(), orbit.getFrame());
    // verify dates are very close, but not equal
    Assert.assertNotEquals(shiftedAttitude.getDate(), orbit10Shifts.getDate());
    Assert.assertEquals(shiftedAttitude.getDate().durationFrom(orbit10Shifts.getDate()).getReal(), 0, Precision.EPSILON);
    // action + verify no exception is thrown
    new FieldSpacecraftState<>(orbit10Shifts, shiftedAttitude);
}
Also used : BodyCenterPointing(org.orekit.attitudes.BodyCenterPointing) DateComponents(org.orekit.time.DateComponents) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate) FieldKeplerianOrbit(org.orekit.orbits.FieldKeplerianOrbit)

Aggregations

BodyCenterPointing (org.orekit.attitudes.BodyCenterPointing)10 DateComponents (org.orekit.time.DateComponents)9 OneAxisEllipsoid (org.orekit.bodies.OneAxisEllipsoid)5 OrekitException (org.orekit.errors.OrekitException)5 FieldKeplerianOrbit (org.orekit.orbits.FieldKeplerianOrbit)5 FieldAbsoluteDate (org.orekit.time.FieldAbsoluteDate)5 Before (org.junit.Before)4 AbsoluteDate (org.orekit.time.AbsoluteDate)4 Vector3D (org.hipparchus.geometry.euclidean.threed.Vector3D)3 PVCoordinates (org.orekit.utils.PVCoordinates)3 EquinoctialOrbit (org.orekit.orbits.EquinoctialOrbit)2 KeplerianOrbit (org.orekit.orbits.KeplerianOrbit)2 FieldKeplerianPropagator (org.orekit.propagation.analytical.FieldKeplerianPropagator)2 FieldPVCoordinates (org.orekit.utils.FieldPVCoordinates)2 HashMap (java.util.HashMap)1 PolynomialFunction (org.hipparchus.analysis.polynomials.PolynomialFunction)1 MathIllegalStateException (org.hipparchus.exception.MathIllegalStateException)1 FieldVector3D (org.hipparchus.geometry.euclidean.threed.FieldVector3D)1 Test (org.junit.Test)1 Frame (org.orekit.frames.Frame)1