use of org.orekit.attitudes.BodyCenterPointing in project Orekit by CS-SI.
the class PropagatorsParallelizerTest method setUp.
@Before
public void setUp() {
try {
Utils.setDataRoot("regular-data:potential/icgem-format");
unnormalizedGravityField = GravityFieldFactory.getUnnormalizedProvider(6, 0);
normalizedGravityField = GravityFieldFactory.getNormalizedProvider(6, 0);
mass = 2500;
double a = 7187990.1979844316;
double e = 0.5e-4;
double i = 1.7105407051081795;
double omega = 1.9674147913622104;
double OMEGA = FastMath.toRadians(261);
double lv = 0;
AbsoluteDate date = new AbsoluteDate(new DateComponents(2004, 01, 01), TimeComponents.H00, TimeScalesFactory.getUTC());
orbit = new KeplerianOrbit(a, e, i, omega, OMEGA, lv, PositionAngle.TRUE, FramesFactory.getEME2000(), date, normalizedGravityField.getMu());
OneAxisEllipsoid earth = new OneAxisEllipsoid(Constants.WGS84_EARTH_EQUATORIAL_RADIUS, Constants.WGS84_EARTH_FLATTENING, FramesFactory.getITRF(IERSConventions.IERS_2010, true));
attitudeLaw = new BodyCenterPointing(orbit.getFrame(), earth);
} catch (OrekitException oe) {
Assert.fail(oe.getLocalizedMessage());
}
}
use of org.orekit.attitudes.BodyCenterPointing in project Orekit by CS-SI.
the class CircularFieldOfViewDetectorTest method setUp.
@Before
public void setUp() {
try {
Utils.setDataRoot("regular-data");
// Computation date
// Satellite position as circular parameters
mu = 3.9860047e14;
initDate = new AbsoluteDate(new DateComponents(1969, 8, 28), TimeComponents.H00, TimeScalesFactory.getUTC());
Vector3D position = new Vector3D(7.0e6, 1.0e6, 4.0e6);
Vector3D velocity = new Vector3D(-500.0, 8000.0, 1000.0);
initialOrbit = new EquinoctialOrbit(new PVCoordinates(position, velocity), FramesFactory.getEME2000(), initDate, mu);
// WGS84 Earth model
earth = new OneAxisEllipsoid(Constants.WGS84_EARTH_EQUATORIAL_RADIUS, Constants.WGS84_EARTH_FLATTENING, FramesFactory.getITRF(IERSConventions.IERS_2010, true));
// Create earth center pointing attitude provider
earthCenterAttitudeLaw = new BodyCenterPointing(initialOrbit.getFrame(), earth);
} catch (OrekitException oe) {
Assert.fail(oe.getMessage());
}
}
use of org.orekit.attitudes.BodyCenterPointing in project Orekit by CS-SI.
the class TLEPropagatorTest method testBodyCenterInPointingDirection.
/**
* Test if body center belongs to the direction pointed by the satellite
*/
@Test
public void testBodyCenterInPointingDirection() throws OrekitException {
final Frame itrf = FramesFactory.getITRF(IERSConventions.IERS_2010, true);
final OneAxisEllipsoid earth = new OneAxisEllipsoid(Constants.WGS84_EARTH_EQUATORIAL_RADIUS, Constants.WGS84_EARTH_FLATTENING, itrf);
DistanceChecker checker = new DistanceChecker(itrf);
// with Earth pointing attitude, distance should be small
TLEPropagator propagator = TLEPropagator.selectExtrapolator(tle, new BodyCenterPointing(FramesFactory.getTEME(), earth), Propagator.DEFAULT_MASS);
propagator.setMasterMode(900.0, checker);
propagator.propagate(tle.getDate().shiftedBy(period));
Assert.assertEquals(0.0, checker.getMaxDistance(), 2.0e-7);
// with default attitude mode, distance should be large
propagator = TLEPropagator.selectExtrapolator(tle);
propagator.setMasterMode(900.0, checker);
propagator.propagate(tle.getDate().shiftedBy(period));
Assert.assertEquals(1.5219e7, checker.getMinDistance(), 1000.0);
Assert.assertEquals(2.6572e7, checker.getMaxDistance(), 1000.0);
}
use of org.orekit.attitudes.BodyCenterPointing in project Orekit by CS-SI.
the class FieldOfViewDetectorTest method setUp.
@Before
public void setUp() {
try {
Utils.setDataRoot("regular-data");
// Computation date
// Satellite position as circular parameters
mu = 3.9860047e14;
initDate = new AbsoluteDate(new DateComponents(1969, 8, 28), TimeComponents.H00, TimeScalesFactory.getUTC());
Vector3D position = new Vector3D(7.0e6, 1.0e6, 4.0e6);
Vector3D velocity = new Vector3D(-500.0, 8000.0, 1000.0);
initialOrbit = new EquinoctialOrbit(new PVCoordinates(position, velocity), FramesFactory.getEME2000(), initDate, mu);
// WGS84 Earth model
earth = new OneAxisEllipsoid(Constants.WGS84_EARTH_EQUATORIAL_RADIUS, Constants.WGS84_EARTH_FLATTENING, FramesFactory.getITRF(IERSConventions.IERS_2010, true));
// Create earth center pointing attitude provider
earthCenterAttitudeLaw = new BodyCenterPointing(initialOrbit.getFrame(), earth);
} catch (OrekitException oe) {
Assert.fail(oe.getMessage());
}
}
use of org.orekit.attitudes.BodyCenterPointing in project Orekit by CS-SI.
the class FieldSpacecraftStateTest method doTestDateConsistencyClose.
/**
* Check orbit and attitude dates can be off by a few ulps. I see this when using
* FixedRate attitude provider.
*/
private <T extends RealFieldElement<T>> void doTestDateConsistencyClose(final Field<T> field) throws OrekitException {
// setup
T zero = field.getZero();
T one = field.getOne();
T a = zero.add(rOrbit.getA());
T e = zero.add(rOrbit.getE());
T i = zero.add(rOrbit.getI());
T pa = zero.add(1.9674147913622104);
T raan = zero.add(FastMath.toRadians(261));
T lv = zero.add(0);
FieldAbsoluteDate<T> date = new FieldAbsoluteDate<>(field, new DateComponents(2004, 01, 01), TimeComponents.H00, TimeScalesFactory.getUTC());
FieldKeplerianOrbit<T> orbit = new FieldKeplerianOrbit<>(a, e, i, pa, raan, lv, PositionAngle.TRUE, FramesFactory.getEME2000(), date, mu);
FieldKeplerianOrbit<T> orbit10Shifts = orbit;
for (int ii = 0; ii < 10; ii++) {
orbit10Shifts = orbit10Shifts.shiftedBy(zero.add(0.1));
}
final FieldOrbit<T> orbit1Shift = orbit.shiftedBy(one);
BodyCenterPointing attitudeLaw = new BodyCenterPointing(orbit.getFrame(), earth);
FieldAttitude<T> shiftedAttitude = attitudeLaw.getAttitude(orbit1Shift, orbit1Shift.getDate(), orbit.getFrame());
// verify dates are very close, but not equal
Assert.assertNotEquals(shiftedAttitude.getDate(), orbit10Shifts.getDate());
Assert.assertEquals(shiftedAttitude.getDate().durationFrom(orbit10Shifts.getDate()).getReal(), 0, Precision.EPSILON);
// action + verify no exception is thrown
new FieldSpacecraftState<>(orbit10Shifts, shiftedAttitude);
}
Aggregations