Search in sources :

Example 16 with KeplerianOrbit

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

the class EstimationTestUtils method eccentricContext.

public static Context eccentricContext(final String dataRoot) throws OrekitException {
    Utils.setDataRoot(dataRoot);
    Context context = new Context();
    context.conventions = IERSConventions.IERS_2010;
    context.earth = new OneAxisEllipsoid(Constants.WGS84_EARTH_EQUATORIAL_RADIUS, Constants.WGS84_EARTH_FLATTENING, FramesFactory.getITRF(context.conventions, true));
    context.sun = CelestialBodyFactory.getSun();
    context.moon = CelestialBodyFactory.getMoon();
    context.radiationSensitive = new IsotropicRadiationClassicalConvention(2.0, 0.2, 0.8);
    context.dragSensitive = new IsotropicDrag(2.0, 1.2);
    final EOPHistory eopHistory = FramesFactory.getEOPHistory(context.conventions, true);
    context.utc = TimeScalesFactory.getUTC();
    context.ut1 = TimeScalesFactory.getUT1(eopHistory);
    context.displacements = new StationDisplacement[] { new TidalDisplacement(Constants.EIGEN5C_EARTH_EQUATORIAL_RADIUS, Constants.JPL_SSD_SUN_EARTH_PLUS_MOON_MASS_RATIO, Constants.JPL_SSD_EARTH_MOON_MASS_RATIO, context.sun, context.moon, context.conventions, false) };
    GravityFieldFactory.addPotentialCoefficientsReader(new GRGSFormatReader("grim4s4_gr", true));
    AstronomicalAmplitudeReader aaReader = new AstronomicalAmplitudeReader("hf-fes2004.dat", 5, 2, 3, 1.0);
    DataProvidersManager.getInstance().feed(aaReader.getSupportedNames(), aaReader);
    Map<Integer, Double> map = aaReader.getAstronomicalAmplitudesMap();
    GravityFieldFactory.addOceanTidesReader(new FESCHatEpsilonReader("fes2004-7x7.dat", 0.01, FastMath.toRadians(1.0), OceanLoadDeformationCoefficients.IERS_2010, map));
    context.gravity = GravityFieldFactory.getNormalizedProvider(20, 20);
    context.initialOrbit = new KeplerianOrbit(15000000.0, 0.125, 1.25, 0.250, 1.375, 0.0625, PositionAngle.TRUE, FramesFactory.getEME2000(), new AbsoluteDate(2000, 2, 24, 11, 35, 47.0, context.utc), context.gravity.getMu());
    context.stations = // context.createStation(-18.59146, -173.98363,   76.0, "Leimatu`a"),
    Arrays.asList(context.createStation(-53.05388, -75.01551, 1750.0, "Isla Desolación"), context.createStation(62.29639, -7.01250, 880.0, "Slættaratindur"));
    // Turn-around range stations
    // Map entry = master station
    // Map value = slave station associated
    context.TARstations = new HashMap<GroundStation, GroundStation>();
    context.TARstations.put(context.createStation(-53.05388, -75.01551, 1750.0, "Isla Desolación"), context.createStation(-54.815833, -68.317778, 6.0, "Ushuaïa"));
    context.TARstations.put(context.createStation(62.29639, -7.01250, 880.0, "Slættaratindur"), context.createStation(61.405833, -6.705278, 470.0, "Sumba"));
    return context;
}
Also used : OneAxisEllipsoid(org.orekit.bodies.OneAxisEllipsoid) IsotropicDrag(org.orekit.forces.drag.IsotropicDrag) GroundStation(org.orekit.estimation.measurements.GroundStation) EOPHistory(org.orekit.frames.EOPHistory) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate) AbsoluteDate(org.orekit.time.AbsoluteDate) GRGSFormatReader(org.orekit.forces.gravity.potential.GRGSFormatReader) FESCHatEpsilonReader(org.orekit.forces.gravity.potential.FESCHatEpsilonReader) IsotropicRadiationClassicalConvention(org.orekit.forces.radiation.IsotropicRadiationClassicalConvention) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) AstronomicalAmplitudeReader(org.orekit.forces.gravity.potential.AstronomicalAmplitudeReader) TidalDisplacement(org.orekit.models.earth.displacement.TidalDisplacement)

Example 17 with KeplerianOrbit

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

the class IodGibbsTest method testGibbs1.

@Test
public void testGibbs1() throws OrekitException {
    final Context context = EstimationTestUtils.eccentricContext("regular-data:potential:tides");
    final double mu = context.initialOrbit.getMu();
    final Frame frame = context.initialOrbit.getFrame();
    final NumericalPropagatorBuilder propagatorBuilder = context.createBuilder(OrbitType.KEPLERIAN, PositionAngle.TRUE, true, 1.0e-6, 60.0, 0.001);
    // create perfect range measurements
    final Propagator propagator = EstimationTestUtils.createPropagator(context.initialOrbit, propagatorBuilder);
    final List<ObservedMeasurement<?>> measurements = EstimationTestUtils.createMeasurements(propagator, new PVMeasurementCreator(), 0.0, 1.0, 60.0);
    final Vector3D position1 = new Vector3D(measurements.get(0).getObservedValue()[0], measurements.get(0).getObservedValue()[1], measurements.get(0).getObservedValue()[2]);
    final PV pv1 = new PV(measurements.get(0).getDate(), position1, Vector3D.ZERO, 0., 0., 1.);
    final Vector3D position2 = new Vector3D(measurements.get(1).getObservedValue()[0], measurements.get(1).getObservedValue()[1], measurements.get(1).getObservedValue()[2]);
    final PV pv2 = new PV(measurements.get(1).getDate(), position2, Vector3D.ZERO, 0., 0., 1.);
    final Vector3D position3 = new Vector3D(measurements.get(2).getObservedValue()[0], measurements.get(2).getObservedValue()[1], measurements.get(2).getObservedValue()[2]);
    final PV pv3 = new PV(measurements.get(2).getDate(), position3, Vector3D.ZERO, 0., 0., 1.);
    // instantiate the IOD method
    final IodGibbs gibbs = new IodGibbs(mu);
    final KeplerianOrbit orbit = gibbs.estimate(frame, pv1, pv2, pv3);
    Assert.assertEquals(context.initialOrbit.getA(), orbit.getA(), 1.0e-9 * context.initialOrbit.getA());
    Assert.assertEquals(context.initialOrbit.getE(), orbit.getE(), 1.0e-9 * context.initialOrbit.getE());
    Assert.assertEquals(context.initialOrbit.getI(), orbit.getI(), 1.0e-9 * context.initialOrbit.getI());
}
Also used : Context(org.orekit.estimation.Context) Frame(org.orekit.frames.Frame) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) NumericalPropagatorBuilder(org.orekit.propagation.conversion.NumericalPropagatorBuilder) PV(org.orekit.estimation.measurements.PV) Propagator(org.orekit.propagation.Propagator) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) ObservedMeasurement(org.orekit.estimation.measurements.ObservedMeasurement) PVMeasurementCreator(org.orekit.estimation.measurements.PVMeasurementCreator) Test(org.junit.Test)

Example 18 with KeplerianOrbit

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

the class IodGibbsTest method testGibbs2.

@Test
public void testGibbs2() throws OrekitException {
    // test extracted from "Fundamentals of astrodynamics & applications", D. Vallado, 3rd ed, chap Initial Orbit Determination, Exple 7-3, p457
    // extraction of the context.
    final Context context = EstimationTestUtils.eccentricContext("regular-data:potential:tides");
    final double mu = context.initialOrbit.getMu();
    // initialisation
    final IodGibbs gibbs = new IodGibbs(mu);
    // Observation  vector (EME2000)
    final Vector3D posR1 = new Vector3D(0.0, 0.0, 6378137.0);
    final Vector3D posR2 = new Vector3D(0.0, -4464696.0, -5102509.0);
    final Vector3D posR3 = new Vector3D(0.0, 5740323.0, 3189068);
    // epoch corresponding to the observation vector
    AbsoluteDate dateRef = new AbsoluteDate(2000, 01, 01, 0, 0, 0, TimeScalesFactory.getUTC());
    AbsoluteDate date2 = dateRef.shiftedBy(76.48);
    AbsoluteDate date3 = dateRef.shiftedBy(153.04);
    // Reference result (cf. Vallado)
    final Vector3D velR2 = new Vector3D(0.0, 5531.148, -5191.806);
    // Gibbs IOD
    final KeplerianOrbit orbit = gibbs.estimate(FramesFactory.getEME2000(), posR1, dateRef, posR2, date2, posR3, date3);
    // test
    Assert.assertEquals(0.0, orbit.getPVCoordinates().getVelocity().getNorm() - velR2.getNorm(), 1e-3);
}
Also used : Context(org.orekit.estimation.Context) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) AbsoluteDate(org.orekit.time.AbsoluteDate) Test(org.junit.Test)

Example 19 with KeplerianOrbit

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

the class IodGibbsTest method testGibbs3.

@Test
public void testGibbs3() throws OrekitException {
    // test extracted from "Fundamentals of astrodynamics & applications", D. Vallado, 3rd ed, chap Initial Orbit Determination, Exple 7-4, p463
    // Remark: the test value in Vallado is performed with an Herrick-Gibbs methods but results are very close with Gibbs method.
    // extraction of context
    final Context context = EstimationTestUtils.eccentricContext("regular-data:potential:tides");
    final double mu = context.initialOrbit.getMu();
    // Initialisation
    final IodGibbs gibbs = new IodGibbs(mu);
    // Observations vector (EME2000)
    final Vector3D posR1 = new Vector3D(3419855.64, 6019826.02, 2784600.22);
    final Vector3D posR2 = new Vector3D(2935911.95, 6326183.24, 2660595.84);
    final Vector3D posR3 = new Vector3D(2434952.02, 6597386.74, 2521523.11);
    // epoch corresponding to the observation vector
    AbsoluteDate dateRef = new AbsoluteDate(2000, 01, 01, 0, 0, 0, TimeScalesFactory.getUTC());
    AbsoluteDate date2 = dateRef.shiftedBy(76.48);
    AbsoluteDate date3 = dateRef.shiftedBy(153.04);
    // Reference result
    final Vector3D velR2 = new Vector3D(-6441.632, 3777.625, -1720.582);
    // Gibbs IOD
    final KeplerianOrbit orbit = gibbs.estimate(FramesFactory.getEME2000(), posR1, dateRef, posR2, date2, posR3, date3);
    // test for the norm of the velocity
    Assert.assertEquals(0.0, orbit.getPVCoordinates().getVelocity().getNorm() - velR2.getNorm(), 1e-3);
}
Also used : Context(org.orekit.estimation.Context) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) AbsoluteDate(org.orekit.time.AbsoluteDate) Test(org.junit.Test)

Example 20 with KeplerianOrbit

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

the class IodGoodingTest method testGooding.

@Test
public void testGooding() throws OrekitException {
    final Context context = EstimationTestUtils.eccentricContext("regular-data:potential:tides");
    final double mu = context.initialOrbit.getMu();
    final Frame frame = context.initialOrbit.getFrame();
    final NumericalPropagatorBuilder propagatorBuilder = context.createBuilder(OrbitType.KEPLERIAN, PositionAngle.TRUE, true, 1.0e-6, 60.0, 0.001);
    // create perfect range measurements
    final Propagator propagator = EstimationTestUtils.createPropagator(context.initialOrbit, propagatorBuilder);
    final List<ObservedMeasurement<?>> measurements = EstimationTestUtils.createMeasurements(propagator, new PVMeasurementCreator(), 0.0, 1.0, 60.0);
    // measurement data 1
    final int idMeasure1 = 0;
    final AbsoluteDate date1 = measurements.get(idMeasure1).getDate();
    final Vector3D stapos1 = Vector3D.ZERO;
    /*context.stations.get(0)  // FIXME we need to access the station of the measurement
                                    .getBaseFrame()
                                    .getPVCoordinates(date1, frame)
                                    .getPosition();*/
    final Vector3D position1 = new Vector3D(measurements.get(idMeasure1).getObservedValue()[0], measurements.get(idMeasure1).getObservedValue()[1], measurements.get(idMeasure1).getObservedValue()[2]);
    final double r1 = position1.getNorm();
    final Vector3D lineOfSight1 = position1.normalize();
    // measurement data 2
    final int idMeasure2 = 20;
    final AbsoluteDate date2 = measurements.get(idMeasure2).getDate();
    final Vector3D stapos2 = Vector3D.ZERO;
    /*context.stations.get(0)  // FIXME we need to access the station of the measurement
                        .getBaseFrame()
                        .getPVCoordinates(date2, frame)
                        .getPosition();*/
    final Vector3D position2 = new Vector3D(measurements.get(idMeasure2).getObservedValue()[0], measurements.get(idMeasure2).getObservedValue()[1], measurements.get(idMeasure2).getObservedValue()[2]);
    final Vector3D lineOfSight2 = position2.normalize();
    // measurement data 3
    final int idMeasure3 = 40;
    final AbsoluteDate date3 = measurements.get(idMeasure3).getDate();
    final Vector3D stapos3 = Vector3D.ZERO;
    /*context.stations.get(0)  // FIXME we need to access the station of the measurement
                        .getBaseFrame()
                        .getPVCoordinates(date3, frame)
                        .getPosition();*/
    final Vector3D position3 = new Vector3D(measurements.get(idMeasure3).getObservedValue()[0], measurements.get(idMeasure3).getObservedValue()[1], measurements.get(idMeasure3).getObservedValue()[2]);
    final double r3 = position3.getNorm();
    final Vector3D lineOfSight3 = position3.normalize();
    // instantiate the IOD method
    final IodGooding iod = new IodGooding(frame, mu);
    // the problem is very sensitive, and unless one can provide the exact
    // initial range estimate, the estimate may be far off the truth...
    final KeplerianOrbit orbit = iod.estimate(stapos1, stapos2, stapos3, lineOfSight1, date1, lineOfSight2, date2, lineOfSight3, date3, r1 * 1.0, r3 * 1.0);
    Assert.assertEquals(orbit.getA(), context.initialOrbit.getA(), 1.0e-6 * context.initialOrbit.getA());
    Assert.assertEquals(orbit.getE(), context.initialOrbit.getE(), 1.0e-6 * context.initialOrbit.getE());
    Assert.assertEquals(orbit.getI(), context.initialOrbit.getI(), 1.0e-6 * context.initialOrbit.getI());
    Assert.assertEquals(13127847.99808, iod.getRange1(), 1.0e-3);
    Assert.assertEquals(13375711.51931, iod.getRange2(), 1.0e-3);
    Assert.assertEquals(13950296.64852, iod.getRange3(), 1.0e-3);
}
Also used : Context(org.orekit.estimation.Context) Frame(org.orekit.frames.Frame) AbsoluteDate(org.orekit.time.AbsoluteDate) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) NumericalPropagatorBuilder(org.orekit.propagation.conversion.NumericalPropagatorBuilder) Propagator(org.orekit.propagation.Propagator) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) ObservedMeasurement(org.orekit.estimation.measurements.ObservedMeasurement) PVMeasurementCreator(org.orekit.estimation.measurements.PVMeasurementCreator) Test(org.junit.Test)

Aggregations

KeplerianOrbit (org.orekit.orbits.KeplerianOrbit)211 Test (org.junit.Test)175 AbsoluteDate (org.orekit.time.AbsoluteDate)154 SpacecraftState (org.orekit.propagation.SpacecraftState)146 Orbit (org.orekit.orbits.Orbit)101 FieldAbsoluteDate (org.orekit.time.FieldAbsoluteDate)96 Frame (org.orekit.frames.Frame)71 Vector3D (org.hipparchus.geometry.euclidean.threed.Vector3D)65 CartesianOrbit (org.orekit.orbits.CartesianOrbit)57 FieldSpacecraftState (org.orekit.propagation.FieldSpacecraftState)54 DateComponents (org.orekit.time.DateComponents)50 OneAxisEllipsoid (org.orekit.bodies.OneAxisEllipsoid)46 PVCoordinates (org.orekit.utils.PVCoordinates)45 FieldKeplerianOrbit (org.orekit.orbits.FieldKeplerianOrbit)43 TimeComponents (org.orekit.time.TimeComponents)43 EquinoctialOrbit (org.orekit.orbits.EquinoctialOrbit)42 AbstractLegacyForceModelTest (org.orekit.forces.AbstractLegacyForceModelTest)41 Propagator (org.orekit.propagation.Propagator)39 NumericalPropagator (org.orekit.propagation.numerical.NumericalPropagator)36 DormandPrince853Integrator (org.hipparchus.ode.nonstiff.DormandPrince853Integrator)35