use of org.orekit.time.DateComponents in project Orekit by CS-SI.
the class BodyCenterPointingTest method setUp.
@Before
public void setUp() {
try {
Utils.setDataRoot("regular-data");
// Computation date
date = new AbsoluteDate(new DateComponents(2008, 04, 07), TimeComponents.H00, TimeScalesFactory.getUTC());
// Satellite position as circular parameters
final double mu = 3.9860047e14;
final double raan = 270.;
circ = new CircularOrbit(7178000.0, 0.5e-4, -0.5e-4, FastMath.toRadians(50.), FastMath.toRadians(raan), FastMath.toRadians(5.300 - raan), PositionAngle.MEAN, FramesFactory.getEME2000(), date, mu);
// WGS84 Earth model
earth = new OneAxisEllipsoid(Constants.WGS84_EARTH_EQUATORIAL_RADIUS, Constants.WGS84_EARTH_FLATTENING, FramesFactory.getITRF(IERSConventions.IERS_2010, true));
// Transform from EME2000 to ITRF2008
eme2000ToItrf = FramesFactory.getEME2000().getTransformTo(earth.getBodyFrame(), date);
// Create earth center pointing attitude provider
earthCenterAttitudeLaw = new BodyCenterPointing(circ.getFrame(), earth);
} catch (OrekitException oe) {
Assert.fail(oe.getMessage());
}
}
use of org.orekit.time.DateComponents in project Orekit by CS-SI.
the class InertialAttitudeTest method testSpin.
@Test
public void testSpin() throws OrekitException {
AbsoluteDate date = new AbsoluteDate(new DateComponents(1970, 01, 01), new TimeComponents(3, 25, 45.6789), TimeScalesFactory.getUTC());
AttitudeProvider law = new InertialProvider(new Rotation(new Vector3D(-0.64, 0.6, 0.48), 0.2, RotationConvention.VECTOR_OPERATOR));
KeplerianOrbit orbit = new KeplerianOrbit(7178000.0, 1.e-4, FastMath.toRadians(50.), FastMath.toRadians(10.), FastMath.toRadians(20.), FastMath.toRadians(30.), PositionAngle.MEAN, FramesFactory.getEME2000(), date, 3.986004415e14);
Propagator propagator = new KeplerianPropagator(orbit, law);
double h = 100.0;
SpacecraftState sMinus = propagator.propagate(date.shiftedBy(-h));
SpacecraftState s0 = propagator.propagate(date);
SpacecraftState sPlus = propagator.propagate(date.shiftedBy(h));
// check spin is consistent with attitude evolution
double errorAngleMinus = Rotation.distance(sMinus.shiftedBy(h).getAttitude().getRotation(), s0.getAttitude().getRotation());
double evolutionAngleMinus = Rotation.distance(sMinus.getAttitude().getRotation(), s0.getAttitude().getRotation());
Assert.assertEquals(0.0, errorAngleMinus, 1.0e-6 * evolutionAngleMinus);
double errorAnglePlus = Rotation.distance(s0.getAttitude().getRotation(), sPlus.shiftedBy(-h).getAttitude().getRotation());
double evolutionAnglePlus = Rotation.distance(s0.getAttitude().getRotation(), sPlus.getAttitude().getRotation());
Assert.assertEquals(0.0, errorAnglePlus, 1.0e-6 * evolutionAnglePlus);
// compute spin axis using finite differences
Rotation rMinus = sMinus.getAttitude().getRotation();
Rotation rPlus = sPlus.getAttitude().getRotation();
Rotation dr = rPlus.compose(rMinus.revert(), RotationConvention.VECTOR_OPERATOR);
Assert.assertEquals(0, dr.getAngle(), 1.0e-10);
Vector3D spin0 = s0.getAttitude().getSpin();
Assert.assertEquals(0, spin0.getNorm(), 1.0e-10);
}
use of org.orekit.time.DateComponents in project Orekit by CS-SI.
the class InertialAttitudeTest method setUp.
@Before
public void setUp() {
try {
Utils.setDataRoot("regular-data");
t0 = new AbsoluteDate(new DateComponents(2008, 06, 03), TimeComponents.H12, TimeScalesFactory.getUTC());
orbit0 = new KeplerianOrbit(12345678.9, 0.001, 2.3, 0.1, 3.04, 2.4, PositionAngle.TRUE, FramesFactory.getEME2000(), t0, 3.986004415e14);
} catch (OrekitException oe) {
Assert.fail(oe.getMessage());
}
}
use of org.orekit.time.DateComponents in project Orekit by CS-SI.
the class LofOffsetTest method testRetrieveAngles.
@Test
public void testRetrieveAngles() throws OrekitException {
AbsoluteDate date = new AbsoluteDate(new DateComponents(1970, 01, 01), new TimeComponents(3, 25, 45.6789), TimeScalesFactory.getUTC());
KeplerianOrbit orbit = new KeplerianOrbit(7178000.0, 1.e-4, FastMath.toRadians(50.), FastMath.toRadians(10.), FastMath.toRadians(20.), FastMath.toRadians(30.), PositionAngle.MEAN, FramesFactory.getEME2000(), date, 3.986004415e14);
RotationOrder order = RotationOrder.ZXY;
double alpha1 = 0.123;
double alpha2 = 0.456;
double alpha3 = 0.789;
LofOffset law = new LofOffset(orbit.getFrame(), LOFType.VVLH, order, alpha1, alpha2, alpha3);
Rotation offsetAtt = law.getAttitude(orbit, date, orbit.getFrame()).getRotation();
Rotation alignedAtt = new LofOffset(orbit.getFrame(), LOFType.VVLH).getAttitude(orbit, date, orbit.getFrame()).getRotation();
Rotation offsetProper = offsetAtt.compose(alignedAtt.revert(), RotationConvention.VECTOR_OPERATOR);
double[] anglesV = offsetProper.revert().getAngles(order, RotationConvention.VECTOR_OPERATOR);
Assert.assertEquals(alpha1, anglesV[0], 1.0e-11);
Assert.assertEquals(alpha2, anglesV[1], 1.0e-11);
Assert.assertEquals(alpha3, anglesV[2], 1.0e-11);
double[] anglesF = offsetProper.getAngles(order, RotationConvention.FRAME_TRANSFORM);
Assert.assertEquals(alpha1, anglesF[0], 1.0e-11);
Assert.assertEquals(alpha2, anglesF[1], 1.0e-11);
Assert.assertEquals(alpha3, anglesF[2], 1.0e-11);
}
use of org.orekit.time.DateComponents in project Orekit by CS-SI.
the class LofOffsetTest method testTypesField.
@Test
public void testTypesField() throws OrekitException {
AbsoluteDate date = new AbsoluteDate(new DateComponents(1970, 01, 01), new TimeComponents(3, 25, 45.6789), TimeScalesFactory.getUTC());
KeplerianOrbit orbit = new KeplerianOrbit(7178000.0, 1.e-4, FastMath.toRadians(50.), FastMath.toRadians(10.), FastMath.toRadians(20.), FastMath.toRadians(30.), PositionAngle.MEAN, FramesFactory.getEME2000(), date, 3.986004415e14);
for (final LOFType type : LOFType.values()) {
RotationOrder order = RotationOrder.ZXY;
double alpha1 = 0.123;
double alpha2 = 0.456;
double alpha3 = 0.789;
LofOffset law = new LofOffset(orbit.getFrame(), type, order, alpha1, alpha2, alpha3);
checkField(Decimal64Field.getInstance(), law, orbit, date, orbit.getFrame());
}
}
Aggregations