use of org.orekit.time.AbsoluteDate in project Orekit by CS-SI.
the class MarshallSolarActivityFutureEstimationTest method testWithPropagator.
/**
* Check integration error is small when integrating the same equations over the same
* interval.
*
* @throws OrekitException on error.
*/
@Test
public void testWithPropagator() throws OrekitException {
CelestialBody sun = CelestialBodyFactory.getSun();
final Frame eci = FramesFactory.getGCRF();
final Frame ecef = FramesFactory.getITRF(IERSConventions.IERS_2010, true);
AbsoluteDate date = new AbsoluteDate(2004, 1, 1, utc);
OneAxisEllipsoid earth = new OneAxisEllipsoid(Constants.WGS84_EARTH_EQUATORIAL_RADIUS, Constants.WGS84_EARTH_FLATTENING, ecef);
Orbit orbit = new KeplerianOrbit(6378137 + 400e3, 1e-3, FastMath.toRadians(50), 0, 0, 0, PositionAngle.TRUE, eci, date, Constants.EIGEN5C_EARTH_MU);
final SpacecraftState ic = new SpacecraftState(orbit);
final AbsoluteDate end = date.shiftedBy(5 * Constants.JULIAN_DAY);
final AbsoluteDate resetDate = date.shiftedBy(0.8 * Constants.JULIAN_DAY + 0.1);
final SpacecraftState[] lastState = new SpacecraftState[1];
final OrekitStepHandler stepSaver = (interpolator, isLast) -> {
final AbsoluteDate start = interpolator.getPreviousState().getDate();
if (start.compareTo(resetDate) < 0) {
lastState[0] = interpolator.getPreviousState();
}
};
// propagate with state rest to take slightly different path
NumericalPropagator propagator = getNumericalPropagator(sun, earth, ic);
propagator.setMasterMode(stepSaver);
propagator.propagate(resetDate);
propagator.resetInitialState(lastState[0]);
propagator.setSlaveMode();
final SpacecraftState actual = propagator.propagate(end);
// propagate straight through
propagator = getNumericalPropagator(sun, earth, ic);
propagator.resetInitialState(ic);
propagator.setSlaveMode();
final SpacecraftState expected = propagator.propagate(end);
assertThat(actual.getPVCoordinates(), pvCloseTo(expected.getPVCoordinates(), 1.0));
}
use of org.orekit.time.AbsoluteDate in project Orekit by CS-SI.
the class MarshallSolarActivityFutureEstimationTest method testMinDate.
@Test
public void testMinDate() throws OrekitException {
MarshallSolarActivityFutureEstimation msafe = loadMsafe(MarshallSolarActivityFutureEstimation.StrengthLevel.WEAK);
Assert.assertEquals(new AbsoluteDate("2010-05-01", utc), msafe.getMinDate());
Assert.assertEquals(78.1, msafe.getMeanFlux(msafe.getMinDate()), 1.0e-14);
}
use of org.orekit.time.AbsoluteDate in project Orekit by CS-SI.
the class MarshallSolarActivityFutureEstimationTest method testFluxStrong.
@Test
public void testFluxStrong() throws OrekitException {
MarshallSolarActivityFutureEstimation msafe = loadMsafe(MarshallSolarActivityFutureEstimation.StrengthLevel.STRONG);
Assert.assertEquals(94.2, msafe.getMeanFlux(new AbsoluteDate("2010-10-01", utc)), 1.0e-10);
Assert.assertEquals(96.6, msafe.getMeanFlux(new AbsoluteDate("2010-10-16T12:00:00", utc)), 1.0e-10);
Assert.assertEquals(99.0, msafe.getMeanFlux(new AbsoluteDate("2010-11-01", utc)), 1.0e-10);
Assert.assertEquals(msafe.getInstantFlux(new AbsoluteDate("2010-11-01", utc)), msafe.getMeanFlux(new AbsoluteDate("2010-11-01", utc)), 1.0e-10);
Assert.assertEquals(MarshallSolarActivityFutureEstimation.StrengthLevel.STRONG, msafe.getStrengthLevel());
}
use of org.orekit.time.AbsoluteDate in project Orekit by CS-SI.
the class MarshallSolarActivityFutureEstimationTest method testKpStrong.
@Test
public void testKpStrong() throws OrekitException {
MarshallSolarActivityFutureEstimation msafe = loadMsafe(MarshallSolarActivityFutureEstimation.StrengthLevel.STRONG);
Assert.assertEquals(2 + 1.0 / 3.0, msafe.get24HoursKp(new AbsoluteDate("2010-10-01", utc)), 0.2);
Assert.assertEquals(3.0, msafe.get24HoursKp(new AbsoluteDate("2011-05-01", utc)), 0.1);
// this one should get exactly to an element of the AP_ARRAY: ap = 7.0
Assert.assertEquals(2.0, msafe.get24HoursKp(new AbsoluteDate("2010-08-01", utc)), 0.3);
Assert.assertEquals(msafe.getThreeHourlyKP(new AbsoluteDate("2010-08-01", utc)), msafe.get24HoursKp(new AbsoluteDate("2010-08-01", utc)), 1.0e-14);
}
use of org.orekit.time.AbsoluteDate in project Orekit by CS-SI.
the class MarshallSolarActivityFutureEstimationTest method testFutureOutOfRange.
@Test(expected = OrekitException.class)
public void testFutureOutOfRange() throws OrekitException {
MarshallSolarActivityFutureEstimation msafe = loadMsafe(MarshallSolarActivityFutureEstimation.StrengthLevel.WEAK);
msafe.get24HoursKp(new AbsoluteDate("2060-10-01", utc));
}
Aggregations