use of org.orekit.orbits.CircularOrbit in project Orekit by CS-SI.
the class NadirPointingTest method testSphericEarth.
/**
* Test in the case of a spheric earth : nadir pointing shall be
* the same as earth center pointing
*/
@Test
public void testSphericEarth() throws OrekitException {
// Spheric earth shape
OneAxisEllipsoid earthShape = new OneAxisEllipsoid(6378136.460, 0., itrf);
// Create nadir pointing attitude provider
NadirPointing nadirAttitudeLaw = new NadirPointing(FramesFactory.getEME2000(), earthShape);
// Create earth center pointing attitude provider
BodyCenterPointing earthCenterAttitudeLaw = new BodyCenterPointing(FramesFactory.getEME2000(), earthShape);
// Create satellite position as circular parameters
CircularOrbit circ = new CircularOrbit(7178000.0, 0.5e-4, -0.5e-4, FastMath.toRadians(50.), FastMath.toRadians(270.), FastMath.toRadians(5.300), PositionAngle.MEAN, FramesFactory.getEME2000(), date, mu);
// Get nadir attitude
Rotation rotNadir = nadirAttitudeLaw.getAttitude(circ, date, circ.getFrame()).getRotation();
// Get earth center attitude
Rotation rotCenter = earthCenterAttitudeLaw.getAttitude(circ, date, circ.getFrame()).getRotation();
// For a spheric earth, earth center pointing attitude and nadir pointing attitude
// shall be the same, i.e the composition of inverse earth pointing rotation
// with nadir pointing rotation shall be identity.
Rotation rotCompo = rotCenter.composeInverse(rotNadir, RotationConvention.VECTOR_OPERATOR);
double angle = rotCompo.getAngle();
Assert.assertEquals(angle, 0.0, Utils.epsilonAngle);
}
use of org.orekit.orbits.CircularOrbit in project Orekit by CS-SI.
the class NadirPointingTest method testNonSphericEarth.
/**
* Test in the case of an elliptic earth : nadir pointing shall be :
* - the same as earth center pointing in case of equatorial or polar position
* - different from earth center pointing in any other case
*/
@Test
public void testNonSphericEarth() throws OrekitException {
// Elliptic earth shape
OneAxisEllipsoid earthShape = new OneAxisEllipsoid(6378136.460, 1 / 298.257222101, itrf);
// Create nadir pointing attitude provider
NadirPointing nadirAttitudeLaw = new NadirPointing(FramesFactory.getEME2000(), earthShape);
// Create earth center pointing attitude provider
BodyCenterPointing earthCenterAttitudeLaw = new BodyCenterPointing(FramesFactory.getEME2000(), earthShape);
// Satellite on equatorial position
// **********************************
KeplerianOrbit kep = new KeplerianOrbit(7178000.0, 1.e-8, FastMath.toRadians(50.), 0., 0., 0., PositionAngle.TRUE, FramesFactory.getEME2000(), date, mu);
// Get nadir attitude
Rotation rotNadir = nadirAttitudeLaw.getAttitude(kep, date, kep.getFrame()).getRotation();
checkField(Decimal64Field.getInstance(), nadirAttitudeLaw, kep, kep.getDate(), kep.getFrame());
// Get earth center attitude
Rotation rotCenter = earthCenterAttitudeLaw.getAttitude(kep, date, kep.getFrame()).getRotation();
// For a satellite at equatorial position, earth center pointing attitude and nadir pointing
// attitude shall be the same, i.e the composition of inverse earth pointing rotation
// with nadir pointing rotation shall be identity.
Rotation rotCompo = rotCenter.composeInverse(rotNadir, RotationConvention.VECTOR_OPERATOR);
double angle = rotCompo.getAngle();
Assert.assertEquals(0.0, angle, 5.e-6);
// Satellite on polar position
// *****************************
CircularOrbit circ = new CircularOrbit(7178000.0, 1.e-5, 0., FastMath.toRadians(90.), 0., FastMath.toRadians(90.), PositionAngle.TRUE, FramesFactory.getEME2000(), date, mu);
// Get nadir attitude
rotNadir = nadirAttitudeLaw.getAttitude(circ, date, circ.getFrame()).getRotation();
// Get earth center attitude
rotCenter = earthCenterAttitudeLaw.getAttitude(circ, date, circ.getFrame()).getRotation();
// For a satellite at polar position, earth center pointing attitude and nadir pointing
// attitude shall be the same, i.e the composition of inverse earth pointing rotation
// with nadir pointing rotation shall be identity.
rotCompo = rotCenter.composeInverse(rotNadir, RotationConvention.VECTOR_OPERATOR);
angle = rotCompo.getAngle();
Assert.assertEquals(angle, 0.0, 5.e-6);
// Satellite on any position
// ***************************
circ = new CircularOrbit(7178000.0, 1.e-5, 0., FastMath.toRadians(50.), 0., FastMath.toRadians(90.), PositionAngle.TRUE, FramesFactory.getEME2000(), date, mu);
// Get nadir attitude
rotNadir = nadirAttitudeLaw.getAttitude(circ, date, circ.getFrame()).getRotation();
// Get earth center attitude
rotCenter = earthCenterAttitudeLaw.getAttitude(circ, date, circ.getFrame()).getRotation();
// For a satellite at any position, earth center pointing attitude and nadir pointing
// and nadir pointing attitude shall not be the same, i.e the composition of inverse earth
// pointing rotation with nadir pointing rotation shall be different from identity.
rotCompo = rotCenter.composeInverse(rotNadir, RotationConvention.VECTOR_OPERATOR);
angle = rotCompo.getAngle();
Assert.assertEquals(angle, FastMath.toRadians(0.16797386586252272), Utils.epsilonAngle);
}
use of org.orekit.orbits.CircularOrbit in project Orekit by CS-SI.
the class NadirPointingTest method testVertical.
/**
* Vertical test : check that Z satellite axis is collinear to local vertical axis,
* which direction is : (cos(lon)*cos(lat), sin(lon)*cos(lat), sin(lat)),
* where lon et lat stand for observed point coordinates
* (i.e satellite ones, since they are the same by construction,
* but that's what is to test.
*/
@Test
public void testVertical() throws OrekitException {
// Elliptic earth shape
OneAxisEllipsoid earthShape = new OneAxisEllipsoid(6378136.460, 1 / 298.257222101, itrf);
// Create earth center pointing attitude provider
NadirPointing nadirAttitudeLaw = new NadirPointing(FramesFactory.getEME2000(), earthShape);
// Satellite on any position
CircularOrbit circ = new CircularOrbit(7178000.0, 1.e-5, 0., FastMath.toRadians(50.), 0., FastMath.toRadians(90.), PositionAngle.TRUE, FramesFactory.getEME2000(), date, mu);
// Vertical test
// ***************
// Get observed ground point position/velocity
TimeStampedPVCoordinates pvTargetItrf = nadirAttitudeLaw.getTargetPV(circ, date, itrf);
// Convert to geodetic coordinates
GeodeticPoint geoTarget = earthShape.transform(pvTargetItrf.getPosition(), itrf, date);
// Compute local vertical axis
double xVert = FastMath.cos(geoTarget.getLongitude()) * FastMath.cos(geoTarget.getLatitude());
double yVert = FastMath.sin(geoTarget.getLongitude()) * FastMath.cos(geoTarget.getLatitude());
double zVert = FastMath.sin(geoTarget.getLatitude());
Vector3D targetVertical = new Vector3D(xVert, yVert, zVert);
// Get attitude rotation state
Rotation rotSatEME2000 = nadirAttitudeLaw.getAttitude(circ, date, circ.getFrame()).getRotation();
// Get satellite Z axis in EME2000 frame
Vector3D zSatEME2000 = rotSatEME2000.applyInverseTo(Vector3D.PLUS_K);
Vector3D zSatItrf = FramesFactory.getEME2000().getTransformTo(itrf, date).transformVector(zSatEME2000);
// Check that satellite Z axis is collinear to local vertical axis
double angle = Vector3D.angle(zSatItrf, targetVertical);
Assert.assertEquals(0.0, FastMath.sin(angle), Utils.epsilonTest);
}
use of org.orekit.orbits.CircularOrbit in project Orekit by CS-SI.
the class NadirPointingTest method testSlidingDerivatives.
/**
* Test the derivatives of the sliding target
*/
@Test
public void testSlidingDerivatives() throws OrekitException {
// Elliptic earth shape
OneAxisEllipsoid earthShape = new OneAxisEllipsoid(6378136.460, 1 / 298.257222101, itrf);
// Create earth center pointing attitude provider
NadirPointing nadirAttitudeLaw = new NadirPointing(FramesFactory.getEME2000(), earthShape);
// Satellite on any position
CircularOrbit circ = new CircularOrbit(7178000.0, 1.e-5, 0., FastMath.toRadians(50.), 0., FastMath.toRadians(90.), PositionAngle.TRUE, FramesFactory.getEME2000(), date, mu);
List<TimeStampedPVCoordinates> sample = new ArrayList<TimeStampedPVCoordinates>();
for (double dt = -0.1; dt < 0.1; dt += 0.05) {
Orbit o = circ.shiftedBy(dt);
sample.add(nadirAttitudeLaw.getTargetPV(o, o.getDate(), o.getFrame()));
}
TimeStampedPVCoordinates reference = TimeStampedPVCoordinates.interpolate(circ.getDate(), CartesianDerivativesFilter.USE_P, sample);
TimeStampedPVCoordinates target = nadirAttitudeLaw.getTargetPV(circ, circ.getDate(), circ.getFrame());
Assert.assertEquals(0.0, Vector3D.distance(reference.getPosition(), target.getPosition()), 1.0e-15 * reference.getPosition().getNorm());
Assert.assertEquals(0.0, Vector3D.distance(reference.getVelocity(), target.getVelocity()), 3.0e-11 * reference.getVelocity().getNorm());
Assert.assertEquals(0.0, Vector3D.distance(reference.getAcceleration(), target.getAcceleration()), 1.3e-5 * reference.getAcceleration().getNorm());
}
use of org.orekit.orbits.CircularOrbit 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());
}
}
Aggregations