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);
}
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));
}
Aggregations