Search in sources :

Example 6 with FieldPVCoordinatesProvider

use of org.orekit.utils.FieldPVCoordinatesProvider in project Orekit by CS-SI.

the class FieldKeplerianPropagatorTest method doTestWrongAttitude.

private <T extends RealFieldElement<T>> void doTestWrongAttitude(Field<T> field) throws OrekitException {
    T zero = field.getZero();
    FieldKeplerianOrbit<T> orbit = new FieldKeplerianOrbit<>(zero.add(1.0e10), zero.add(1.0e-4), zero.add(1.0e-2), zero, zero, zero, PositionAngle.TRUE, FramesFactory.getEME2000(), new FieldAbsoluteDate<>(field), 3.986004415e14);
    AttitudeProvider wrongLaw = new AttitudeProvider() {

        private static final long serialVersionUID = 1L;

        @Override
        public Attitude getAttitude(PVCoordinatesProvider pvProv, AbsoluteDate date, Frame frame) throws OrekitException {
            throw new OrekitException(new DummyLocalizable("gasp"), new RuntimeException());
        }

        @Override
        public <Q extends RealFieldElement<Q>> FieldAttitude<Q> getAttitude(FieldPVCoordinatesProvider<Q> pvProv, FieldAbsoluteDate<Q> date, Frame frame) throws OrekitException {
            throw new OrekitException(new DummyLocalizable("gasp"), new RuntimeException());
        }
    };
    FieldKeplerianPropagator<T> propagator = new FieldKeplerianPropagator<>(orbit, wrongLaw);
    propagator.propagate(new FieldAbsoluteDate<>(field).shiftedBy(10.0));
}
Also used : DummyLocalizable(org.hipparchus.exception.DummyLocalizable) Frame(org.orekit.frames.Frame) TopocentricFrame(org.orekit.frames.TopocentricFrame) RealFieldElement(org.hipparchus.RealFieldElement) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate) AbsoluteDate(org.orekit.time.AbsoluteDate) FieldKeplerianOrbit(org.orekit.orbits.FieldKeplerianOrbit) FieldPVCoordinatesProvider(org.orekit.utils.FieldPVCoordinatesProvider) PVCoordinatesProvider(org.orekit.utils.PVCoordinatesProvider) FieldPVCoordinatesProvider(org.orekit.utils.FieldPVCoordinatesProvider) OrekitException(org.orekit.errors.OrekitException) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate) AttitudeProvider(org.orekit.attitudes.AttitudeProvider)

Aggregations

DummyLocalizable (org.hipparchus.exception.DummyLocalizable)6 AttitudeProvider (org.orekit.attitudes.AttitudeProvider)6 OrekitException (org.orekit.errors.OrekitException)6 Frame (org.orekit.frames.Frame)6 TopocentricFrame (org.orekit.frames.TopocentricFrame)6 AbsoluteDate (org.orekit.time.AbsoluteDate)6 FieldAbsoluteDate (org.orekit.time.FieldAbsoluteDate)6 FieldPVCoordinatesProvider (org.orekit.utils.FieldPVCoordinatesProvider)6 PVCoordinatesProvider (org.orekit.utils.PVCoordinatesProvider)6 RealFieldElement (org.hipparchus.RealFieldElement)4 Test (org.junit.Test)3 FieldKeplerianOrbit (org.orekit.orbits.FieldKeplerianOrbit)3 KeplerianOrbit (org.orekit.orbits.KeplerianOrbit)3 Attitude (org.orekit.attitudes.Attitude)2 FieldAttitude (org.orekit.attitudes.FieldAttitude)2