Search in sources :

Example 11 with CircularOrbit

use of org.orekit.orbits.CircularOrbit in project Orekit by CS-SI.

the class TopocentricFrameTest method testDoppler.

@Test
public void testDoppler() throws OrekitException {
    // Surface point at latitude 45, longitude 5
    final GeodeticPoint point = new GeodeticPoint(FastMath.toRadians(45.), FastMath.toRadians(5.), 0.);
    final TopocentricFrame topoFrame = new TopocentricFrame(earthSpheric, point, "lon 5 lat 45");
    // Point at 30 deg longitude
    // ***************************
    final CircularOrbit orbit = new CircularOrbit(7178000.0, 0.5e-8, -0.5e-8, FastMath.toRadians(50.), FastMath.toRadians(120.), FastMath.toRadians(90.), PositionAngle.MEAN, FramesFactory.getEME2000(), date, mu);
    // Transform satellite position to position/velocity parameters in body frame
    final Transform eme2000ToItrf = FramesFactory.getEME2000().getTransformTo(earthSpheric.getBodyFrame(), date);
    final PVCoordinates pvSatItrf = eme2000ToItrf.transformPVCoordinates(orbit.getPVCoordinates());
    // Compute range rate directly
    // ********************************************
    final double dop = topoFrame.getRangeRate(pvSatItrf, earthSpheric.getBodyFrame(), date);
    // Compare to finite difference computation (2 points)
    // *****************************************************
    final double dt = 0.1;
    KeplerianPropagator extrapolator = new KeplerianPropagator(orbit);
    // Extrapolate satellite position a short while after reference date
    AbsoluteDate dateP = date.shiftedBy(dt);
    Transform j2000ToItrfP = FramesFactory.getEME2000().getTransformTo(earthSpheric.getBodyFrame(), dateP);
    SpacecraftState orbitP = extrapolator.propagate(dateP);
    Vector3D satPointGeoP = j2000ToItrfP.transformPVCoordinates(orbitP.getPVCoordinates()).getPosition();
    // Retropolate satellite position a short while before reference date
    AbsoluteDate dateM = date.shiftedBy(-dt);
    Transform j2000ToItrfM = FramesFactory.getEME2000().getTransformTo(earthSpheric.getBodyFrame(), dateM);
    SpacecraftState orbitM = extrapolator.propagate(dateM);
    Vector3D satPointGeoM = j2000ToItrfM.transformPVCoordinates(orbitM.getPVCoordinates()).getPosition();
    // Compute ranges at both instants
    double rangeP = topoFrame.getRange(satPointGeoP, earthSpheric.getBodyFrame(), dateP);
    double rangeM = topoFrame.getRange(satPointGeoM, earthSpheric.getBodyFrame(), dateM);
    final double dopRef2 = (rangeP - rangeM) / (2. * dt);
    Assert.assertEquals(dopRef2, dop, 1.e-3);
}
Also used : KeplerianPropagator(org.orekit.propagation.analytical.KeplerianPropagator) SpacecraftState(org.orekit.propagation.SpacecraftState) CircularOrbit(org.orekit.orbits.CircularOrbit) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) PVCoordinates(org.orekit.utils.PVCoordinates) GeodeticPoint(org.orekit.bodies.GeodeticPoint) AbsoluteDate(org.orekit.time.AbsoluteDate) Test(org.junit.Test)

Example 12 with CircularOrbit

use of org.orekit.orbits.CircularOrbit in project Orekit by CS-SI.

the class AlongTrackAimingTest method setUp.

@Before
public void setUp() throws OrekitException {
    Utils.setDataRoot("regular-data");
    orbit = new CircularOrbit(7178000.0, 0.5e-4, -0.5e-4, FastMath.toRadians(50.), FastMath.toRadians(270.), FastMath.toRadians(5.300), PositionAngle.MEAN, FramesFactory.getEME2000(), new AbsoluteDate(2008, 4, 7, 0, 0, 0, TimeScalesFactory.getUTC()), Constants.EIGEN5C_EARTH_MU);
    ellipsoid = new OneAxisEllipsoid(Constants.WGS84_EARTH_EQUATORIAL_RADIUS, Constants.WGS84_EARTH_FLATTENING, FramesFactory.getITRF(IERSConventions.IERS_2010, true));
}
Also used : OneAxisEllipsoid(org.orekit.bodies.OneAxisEllipsoid) CircularOrbit(org.orekit.orbits.CircularOrbit) AbsoluteDate(org.orekit.time.AbsoluteDate) Before(org.junit.Before)

Example 13 with CircularOrbit

use of org.orekit.orbits.CircularOrbit in project Orekit by CS-SI.

the class EcksteinHechlerPropagatorTest method testInitializationCorrectness.

@Test
public void testInitializationCorrectness() throws OrekitException, IOException {
    // Definition of initial conditions
    AbsoluteDate date = AbsoluteDate.J2000_EPOCH.shiftedBy(154.);
    Frame itrf = FramesFactory.getITRF(IERSConventions.IERS_2010, true);
    Frame eme2000 = FramesFactory.getEME2000();
    Vector3D pole = itrf.getTransformTo(eme2000, date).transformVector(Vector3D.PLUS_K);
    Frame poleAligned = new Frame(FramesFactory.getEME2000(), new Transform(date, new Rotation(pole, Vector3D.PLUS_K)), "pole aligned", true);
    CircularOrbit initial = new CircularOrbit(7208669.8179538045, 1.3740461966386876E-4, -3.2364250248363356E-5, FastMath.toRadians(97.40236024565775), FastMath.toRadians(166.15873160992115), FastMath.toRadians(90.1282370098961), PositionAngle.MEAN, poleAligned, date, provider.getMu());
    // find the default Eckstein-Hechler propagator initialized from the initial orbit
    EcksteinHechlerPropagator defaultEH = new EcksteinHechlerPropagator(initial, provider);
    // the osculating parameters recomputed by the default Eckstein-Hechler propagator are quite different
    // from initial orbit
    CircularOrbit defaultOrbit = (CircularOrbit) OrbitType.CIRCULAR.convertType(defaultEH.propagateOrbit(initial.getDate()));
    Assert.assertEquals(267.4, defaultOrbit.getA() - initial.getA(), 0.1);
    // the position on the other hand match perfectly
    Assert.assertEquals(0.0, Vector3D.distance(defaultOrbit.getPVCoordinates().getPosition(), initial.getPVCoordinates().getPosition()), 1.0e-8);
    // set up a reference numerical propagator starting for the specified start orbit
    // using the same force models (i.e. the first few zonal terms)
    double[][] tol = NumericalPropagator.tolerances(0.1, initial, OrbitType.CIRCULAR);
    AdaptiveStepsizeIntegrator integrator = new DormandPrince853Integrator(0.001, 1000, tol[0], tol[1]);
    integrator.setInitialStepSize(60);
    NumericalPropagator num = new NumericalPropagator(integrator);
    num.addForceModel(new HolmesFeatherstoneAttractionModel(itrf, GravityFieldFactory.getNormalizedProvider(provider)));
    num.setInitialState(new SpacecraftState(initial));
    num.setOrbitType(OrbitType.CIRCULAR);
    // find the best Eckstein-Hechler propagator that match the orbit evolution
    PropagatorConverter converter = new FiniteDifferencePropagatorConverter(new EcksteinHechlerPropagatorBuilder(initial, provider, PositionAngle.TRUE, 1.0), 1.0e-6, 100);
    EcksteinHechlerPropagator fittedEH = (EcksteinHechlerPropagator) converter.convert(num, 3 * initial.getKeplerianPeriod(), 300);
    // the default Eckstein-Hechler propagator did however quite a good job, as it found
    // an orbit close to the best fitting
    CircularOrbit fittedOrbit = (CircularOrbit) OrbitType.CIRCULAR.convertType(fittedEH.propagateOrbit(initial.getDate()));
    Assert.assertEquals(0.623, defaultOrbit.getA() - fittedOrbit.getA(), 0.1);
    // the position on the other hand are slightly different
    // because the fitted orbit minimizes the residuals over a complete time span,
    // not on a single point
    Assert.assertEquals(58.0, Vector3D.distance(defaultOrbit.getPVCoordinates().getPosition(), fittedOrbit.getPVCoordinates().getPosition()), 0.1);
}
Also used : Frame(org.orekit.frames.Frame) TopocentricFrame(org.orekit.frames.TopocentricFrame) AdaptiveStepsizeIntegrator(org.hipparchus.ode.nonstiff.AdaptiveStepsizeIntegrator) FiniteDifferencePropagatorConverter(org.orekit.propagation.conversion.FiniteDifferencePropagatorConverter) PropagatorConverter(org.orekit.propagation.conversion.PropagatorConverter) Rotation(org.hipparchus.geometry.euclidean.threed.Rotation) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate) AbsoluteDate(org.orekit.time.AbsoluteDate) EcksteinHechlerPropagatorBuilder(org.orekit.propagation.conversion.EcksteinHechlerPropagatorBuilder) SpacecraftState(org.orekit.propagation.SpacecraftState) CircularOrbit(org.orekit.orbits.CircularOrbit) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) NumericalPropagator(org.orekit.propagation.numerical.NumericalPropagator) FiniteDifferencePropagatorConverter(org.orekit.propagation.conversion.FiniteDifferencePropagatorConverter) Transform(org.orekit.frames.Transform) DormandPrince853Integrator(org.hipparchus.ode.nonstiff.DormandPrince853Integrator) HolmesFeatherstoneAttractionModel(org.orekit.forces.gravity.HolmesFeatherstoneAttractionModel) Test(org.junit.Test)

Example 14 with CircularOrbit

use of org.orekit.orbits.CircularOrbit in project Orekit by CS-SI.

the class EcksteinHechlerPropagatorTest method equatorialOrbit.

@Test(expected = OrekitException.class)
public void equatorialOrbit() throws OrekitException {
    AbsoluteDate initDate = AbsoluteDate.J2000_EPOCH;
    Orbit initialOrbit = new CircularOrbit(7000000, 1.0e-4, -1.5e-4, 0.0, 1.2, 2.3, PositionAngle.MEAN, FramesFactory.getEME2000(), initDate, provider.getMu());
    // Extrapolator definition
    // -----------------------
    EcksteinHechlerPropagator extrapolator = new EcksteinHechlerPropagator(initialOrbit, provider);
    // Extrapolation at the initial date
    // ---------------------------------
    double delta_t = 0.0;
    AbsoluteDate extrapDate = initDate.shiftedBy(delta_t);
    extrapolator.propagate(extrapDate);
}
Also used : EquinoctialOrbit(org.orekit.orbits.EquinoctialOrbit) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) Orbit(org.orekit.orbits.Orbit) CircularOrbit(org.orekit.orbits.CircularOrbit) CircularOrbit(org.orekit.orbits.CircularOrbit) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate) AbsoluteDate(org.orekit.time.AbsoluteDate) Test(org.junit.Test)

Example 15 with CircularOrbit

use of org.orekit.orbits.CircularOrbit in project Orekit by CS-SI.

the class EcksteinHechlerPropagatorTest method testIssue223.

@Test
public void testIssue223() throws OrekitException, IOException, ClassNotFoundException {
    // Definition of initial conditions
    AbsoluteDate date = AbsoluteDate.J2000_EPOCH.shiftedBy(154.);
    Frame itrf = FramesFactory.getITRF(IERSConventions.IERS_2010, true);
    Frame eme2000 = FramesFactory.getEME2000();
    Vector3D pole = itrf.getTransformTo(eme2000, date).transformVector(Vector3D.PLUS_K);
    Frame poleAligned = new Frame(FramesFactory.getEME2000(), new Transform(date, new Rotation(pole, Vector3D.PLUS_K)), "pole aligned", true);
    CircularOrbit initial = new CircularOrbit(7208669.8179538045, 1.3740461966386876E-4, -3.2364250248363356E-5, FastMath.toRadians(97.40236024565775), FastMath.toRadians(166.15873160992115), FastMath.toRadians(90.1282370098961), PositionAngle.MEAN, poleAligned, date, provider.getMu());
    EcksteinHechlerPropagator propagator = new EcksteinHechlerPropagator(initial, provider);
    propagator.addAdditionalStateProvider(new SevenProvider());
    propagator.setEphemerisMode();
    propagator.propagate(initial.getDate().shiftedBy(40000));
    BoundedPropagator ephemeris = propagator.getGeneratedEphemeris();
    Assert.assertSame(poleAligned, ephemeris.getFrame());
    ByteArrayOutputStream bos = new ByteArrayOutputStream();
    ObjectOutputStream oos = new ObjectOutputStream(bos);
    oos.writeObject(ephemeris);
    Assert.assertTrue(bos.size() > 2450);
    Assert.assertTrue(bos.size() < 2550);
    ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray());
    ObjectInputStream ois = new ObjectInputStream(bis);
    BoundedPropagator deserialized = (BoundedPropagator) ois.readObject();
    Assert.assertEquals(initial.getA(), deserialized.getInitialState().getA(), 1.0e-10);
    Assert.assertEquals(initial.getEquinoctialEx(), deserialized.getInitialState().getEquinoctialEx(), 1.0e-10);
    SpacecraftState s = deserialized.propagate(initial.getDate().shiftedBy(20000));
    Map<String, double[]> additional = s.getAdditionalStates();
    Assert.assertEquals(1, additional.size());
    Assert.assertEquals(1, additional.get("seven").length);
    Assert.assertEquals(7, additional.get("seven")[0], 1.0e-15);
}
Also used : Frame(org.orekit.frames.Frame) TopocentricFrame(org.orekit.frames.TopocentricFrame) ByteArrayOutputStream(java.io.ByteArrayOutputStream) ObjectOutputStream(java.io.ObjectOutputStream) Rotation(org.hipparchus.geometry.euclidean.threed.Rotation) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate) AbsoluteDate(org.orekit.time.AbsoluteDate) SpacecraftState(org.orekit.propagation.SpacecraftState) CircularOrbit(org.orekit.orbits.CircularOrbit) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) ByteArrayInputStream(java.io.ByteArrayInputStream) Transform(org.orekit.frames.Transform) BoundedPropagator(org.orekit.propagation.BoundedPropagator) ObjectInputStream(java.io.ObjectInputStream) Test(org.junit.Test)

Aggregations

CircularOrbit (org.orekit.orbits.CircularOrbit)63 AbsoluteDate (org.orekit.time.AbsoluteDate)47 Test (org.junit.Test)41 Vector3D (org.hipparchus.geometry.euclidean.threed.Vector3D)34 SpacecraftState (org.orekit.propagation.SpacecraftState)26 FieldAbsoluteDate (org.orekit.time.FieldAbsoluteDate)22 OneAxisEllipsoid (org.orekit.bodies.OneAxisEllipsoid)21 PVCoordinates (org.orekit.utils.PVCoordinates)21 KeplerianOrbit (org.orekit.orbits.KeplerianOrbit)20 Orbit (org.orekit.orbits.Orbit)20 Rotation (org.hipparchus.geometry.euclidean.threed.Rotation)15 Frame (org.orekit.frames.Frame)15 DateComponents (org.orekit.time.DateComponents)15 GeodeticPoint (org.orekit.bodies.GeodeticPoint)12 TimeStampedPVCoordinates (org.orekit.utils.TimeStampedPVCoordinates)12 OrekitException (org.orekit.errors.OrekitException)11 EquinoctialOrbit (org.orekit.orbits.EquinoctialOrbit)11 ArrayList (java.util.ArrayList)9 Before (org.junit.Before)9 BoundedPropagator (org.orekit.propagation.BoundedPropagator)9