use of org.orekit.time.TimeComponents in project Orekit by CS-SI.
the class TLETest method testDirectConstruction.
@Test
public void testDirectConstruction() throws OrekitException {
TLE tleA = new TLE(5555, 'U', 1971, 86, "J", 0, 908, new AbsoluteDate(new DateComponents(2012, 26), new TimeComponents(0.96078249 * Constants.JULIAN_DAY), TimeScalesFactory.getUTC()), taylorConvert(12.26882470, 1), taylorConvert(-0.00000004, 2), taylorConvert(0.00001e-9, 3), 0.0075476, FastMath.toRadians(74.0161), FastMath.toRadians(328.9888), FastMath.toRadians(228.9750), FastMath.toRadians(30.6709), 80454, 0.01234e-9);
TLE tleB = new TLE("1 05555U 71086J 12026.96078249 -.00000004 00001-9 01234-9 0 9082", "2 05555 74.0161 228.9750 0075476 328.9888 30.6709 12.26882470804545");
Assert.assertEquals(tleA.getSatelliteNumber(), tleB.getSatelliteNumber(), 0);
Assert.assertEquals(tleA.getLaunchYear(), tleB.getLaunchYear());
Assert.assertEquals(tleA.getLaunchNumber(), tleB.getLaunchNumber());
Assert.assertEquals(tleA.getLaunchPiece(), tleB.getLaunchPiece());
Assert.assertEquals(tleA.getBStar(), tleB.getBStar(), 0);
Assert.assertEquals(tleA.getEphemerisType(), tleB.getEphemerisType());
Assert.assertEquals(tleA.getI(), tleB.getI(), 1e-10);
Assert.assertEquals(tleA.getRaan(), tleB.getRaan(), 1e-10);
Assert.assertEquals(tleA.getE(), tleB.getE(), 1e-10);
Assert.assertEquals(tleA.getPerigeeArgument(), tleB.getPerigeeArgument(), 1e-10);
Assert.assertEquals(tleA.getMeanAnomaly(), tleB.getMeanAnomaly(), 1e-10);
Assert.assertEquals(tleA.getMeanMotion(), tleB.getMeanMotion(), 0);
Assert.assertEquals(tleA.getRevolutionNumberAtEpoch(), tleB.getRevolutionNumberAtEpoch(), 0);
Assert.assertEquals(tleA.getElementNumber(), tleB.getElementNumber(), 0);
}
use of org.orekit.time.TimeComponents in project Orekit by CS-SI.
the class LofOffsetPointingTest 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);
final Vector3D dir;
switch(type) {
case TNW:
dir = Vector3D.PLUS_J;
break;
case QSW:
case LVLH:
dir = Vector3D.MINUS_I;
break;
case VVLH:
dir = Vector3D.PLUS_K;
break;
default:
// VNC
dir = Vector3D.MINUS_K;
}
LofOffsetPointing lop = new LofOffsetPointing(orbit.getFrame(), earthSpheric, law, dir);
checkField(Decimal64Field.getInstance(), lop, orbit, date, orbit.getFrame());
}
}
use of org.orekit.time.TimeComponents 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.TimeComponents 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.TimeComponents 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