Search in sources :

Example 11 with GRGSFormatReader

use of org.orekit.forces.gravity.potential.GRGSFormatReader in project Orekit by CS-SI.

the class DSSTPropagatorTest method testHighDegreesSetting.

@Test
public void testHighDegreesSetting() throws OrekitException {
    Utils.setDataRoot("regular-data:potential/grgs-format");
    GravityFieldFactory.addPotentialCoefficientsReader(new GRGSFormatReader("grim4s4_gr", true));
    int earthDegree = 36;
    int earthOrder = 36;
    int eccPower = 4;
    final UnnormalizedSphericalHarmonicsProvider provider = GravityFieldFactory.getUnnormalizedProvider(earthDegree, earthOrder);
    final org.orekit.frames.Frame earthFrame = // terrestrial frame
    FramesFactory.getITRF(IERSConventions.IERS_2010, true);
    final DSSTForceModel force = new DSSTTesseral(earthFrame, Constants.WGS84_EARTH_ANGULAR_VELOCITY, provider, earthDegree, earthOrder, eccPower, earthDegree + eccPower, earthDegree, earthOrder, eccPower);
    final Collection<DSSTForceModel> forces = new ArrayList<DSSTForceModel>();
    forces.add(force);
    TimeScale tai = TimeScalesFactory.getTAI();
    AbsoluteDate initialDate = new AbsoluteDate("2015-07-01", tai);
    Frame eci = FramesFactory.getGCRF();
    KeplerianOrbit orbit = new KeplerianOrbit(7120000.0, 1.0e-3, FastMath.toRadians(60.0), FastMath.toRadians(120.0), FastMath.toRadians(47.0), FastMath.toRadians(12.0), PositionAngle.TRUE, eci, initialDate, Constants.EIGEN5C_EARTH_MU);
    SpacecraftState oscuState = DSSTPropagator.computeOsculatingState(new SpacecraftState(orbit), null, forces);
    Assert.assertEquals(7119927.097122, oscuState.getA(), 0.001);
}
Also used : Frame(org.orekit.frames.Frame) Frame(org.orekit.frames.Frame) ArrayList(java.util.ArrayList) DSSTTesseral(org.orekit.propagation.semianalytical.dsst.forces.DSSTTesseral) DSSTForceModel(org.orekit.propagation.semianalytical.dsst.forces.DSSTForceModel) TimeScale(org.orekit.time.TimeScale) AbsoluteDate(org.orekit.time.AbsoluteDate) GRGSFormatReader(org.orekit.forces.gravity.potential.GRGSFormatReader) SpacecraftState(org.orekit.propagation.SpacecraftState) UnnormalizedSphericalHarmonicsProvider(org.orekit.forces.gravity.potential.UnnormalizedSphericalHarmonicsProvider) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) Test(org.junit.Test)

Example 12 with GRGSFormatReader

use of org.orekit.forces.gravity.potential.GRGSFormatReader in project Orekit by CS-SI.

the class FieldNumericalPropagatorTest method doTestShift.

private static <T extends RealFieldElement<T>> void doTestShift(final FieldCartesianOrbit<T> orbit, final OrbitType orbitType, final PositionAngle angleType, final boolean withDerivatives, final double error60s, final double error120s, final double error300s, final double error600s, final double error900s) throws OrekitException {
    T zero = orbit.getDate().getField().getZero();
    Utils.setDataRoot("regular-data:atmosphere:potential/grgs-format");
    GravityFieldFactory.addPotentialCoefficientsReader(new GRGSFormatReader("grim4s4_gr", true));
    final FieldNumericalPropagator<T> np = createPropagator(new FieldSpacecraftState<>(orbit), orbitType, angleType);
    // the reference date for shifts is set at 60s, so the propagator can provide derivatives if needed
    // (derivatives are not available in the initial orbit)
    final FieldAbsoluteDate<T> reference = orbit.getDate().shiftedBy(60.0);
    final ShiftChecker<T> checker = new ShiftChecker<>(withDerivatives, orbitType, angleType, error60s, error120s, error300s, error600s, error900s);
    @SuppressWarnings("unchecked") FieldTimeStamped<T>[] dates = (FieldTimeStamped<T>[]) Array.newInstance(FieldTimeStamped.class, 6);
    dates[0] = reference;
    dates[1] = reference.shiftedBy(60.0);
    dates[2] = reference.shiftedBy(120.0);
    dates[3] = reference.shiftedBy(300.0);
    dates[4] = reference.shiftedBy(600.0);
    dates[5] = reference.shiftedBy(900.0);
    np.addEventDetector(new FieldDateDetector<T>(zero.add(30.0), zero.add(1.0e-9), (FieldTimeStamped<T>[]) dates).withHandler(checker));
    np.propagate(reference.shiftedBy(1000.0));
}
Also used : FieldDateDetector(org.orekit.propagation.events.FieldDateDetector) FieldTimeStamped(org.orekit.time.FieldTimeStamped) GRGSFormatReader(org.orekit.forces.gravity.potential.GRGSFormatReader)

Aggregations

GRGSFormatReader (org.orekit.forces.gravity.potential.GRGSFormatReader)12 AbsoluteDate (org.orekit.time.AbsoluteDate)11 SpacecraftState (org.orekit.propagation.SpacecraftState)9 Test (org.junit.Test)8 KeplerianOrbit (org.orekit.orbits.KeplerianOrbit)8 FieldSpacecraftState (org.orekit.propagation.FieldSpacecraftState)8 FieldAbsoluteDate (org.orekit.time.FieldAbsoluteDate)8 CartesianOrbit (org.orekit.orbits.CartesianOrbit)7 AbstractLegacyForceModelTest (org.orekit.forces.AbstractLegacyForceModelTest)6 FieldVector3D (org.hipparchus.geometry.euclidean.threed.FieldVector3D)5 Vector3D (org.hipparchus.geometry.euclidean.threed.Vector3D)5 EquinoctialOrbit (org.orekit.orbits.EquinoctialOrbit)5 Orbit (org.orekit.orbits.Orbit)5 FieldKeplerianOrbit (org.orekit.orbits.FieldKeplerianOrbit)4 DateComponents (org.orekit.time.DateComponents)4 TimeComponents (org.orekit.time.TimeComponents)4 PVCoordinates (org.orekit.utils.PVCoordinates)4 DormandPrince853Integrator (org.hipparchus.ode.nonstiff.DormandPrince853Integrator)3 OneAxisEllipsoid (org.orekit.bodies.OneAxisEllipsoid)3 IsotropicDrag (org.orekit.forces.drag.IsotropicDrag)3