Search in sources :

Example 1 with InterSatellitesRange

use of org.orekit.estimation.measurements.InterSatellitesRange in project Orekit by CS-SI.

the class OnBoardAntennaInterSatellitesRangeModifierTest method testPreliminary.

@Test
public void testPreliminary() throws OrekitException {
    // this test does not check OnBoardAntennaInterSatellitesRangeModifier at all,
    // it just checks InterSatellitesRangeMeasurementCreator behaves as necessary for the other test
    // the *real* test is testEffect below
    Context context = EstimationTestUtils.eccentricContext("regular-data:potential:tides");
    final NumericalPropagatorBuilder propagatorBuilder = context.createBuilder(OrbitType.KEPLERIAN, PositionAngle.TRUE, true, 1.0e-6, 60.0, 0.001);
    propagatorBuilder.setAttitudeProvider(new LofOffset(propagatorBuilder.getFrame(), LOFType.LVLH));
    // create perfect inter-satellites range measurements without antenna offset
    final TimeStampedPVCoordinates original = context.initialOrbit.getPVCoordinates();
    final Orbit closeOrbit = new CartesianOrbit(new TimeStampedPVCoordinates(context.initialOrbit.getDate(), original.getPosition().add(new Vector3D(1000, 2000, 3000)), original.getVelocity().add(new Vector3D(-0.03, 0.01, 0.02))), context.initialOrbit.getFrame(), context.initialOrbit.getMu());
    final Propagator closePropagator = EstimationTestUtils.createPropagator(closeOrbit, propagatorBuilder);
    closePropagator.setEphemerisMode();
    closePropagator.propagate(context.initialOrbit.getDate().shiftedBy(3.5 * closeOrbit.getKeplerianPeriod()));
    final BoundedPropagator ephemeris = closePropagator.getGeneratedEphemeris();
    final Propagator p1 = EstimationTestUtils.createPropagator(context.initialOrbit, propagatorBuilder);
    final List<ObservedMeasurement<?>> spacecraftCenteredMeasurements = EstimationTestUtils.createMeasurements(p1, new InterSatellitesRangeMeasurementCreator(ephemeris, Vector3D.ZERO, Vector3D.ZERO), 1.0, 3.0, 300.0);
    // create perfect inter-satellites range measurements with antenna offset
    final double xOffset1 = -2.5;
    final double yOffset2 = 0.8;
    final Propagator p2 = EstimationTestUtils.createPropagator(context.initialOrbit, propagatorBuilder);
    final List<ObservedMeasurement<?>> antennaCenteredMeasurements = EstimationTestUtils.createMeasurements(p2, new InterSatellitesRangeMeasurementCreator(ephemeris, new Vector3D(xOffset1, 0, 0), new Vector3D(0, yOffset2, 0)), 1.0, 3.0, 300.0);
    for (int i = 0; i < spacecraftCenteredMeasurements.size(); ++i) {
        InterSatellitesRange sr = (InterSatellitesRange) spacecraftCenteredMeasurements.get(i);
        InterSatellitesRange ar = (InterSatellitesRange) antennaCenteredMeasurements.get(i);
        Assert.assertEquals(0.0, sr.getDate().durationFrom(ar.getDate()), 2.0e-8);
        Assert.assertTrue(ar.getObservedValue()[0] - sr.getObservedValue()[0] >= -1.0);
        Assert.assertTrue(ar.getObservedValue()[0] - sr.getObservedValue()[0] <= -0.36);
    }
}
Also used : Context(org.orekit.estimation.Context) CartesianOrbit(org.orekit.orbits.CartesianOrbit) CartesianOrbit(org.orekit.orbits.CartesianOrbit) Orbit(org.orekit.orbits.Orbit) TimeStampedPVCoordinates(org.orekit.utils.TimeStampedPVCoordinates) InterSatellitesRange(org.orekit.estimation.measurements.InterSatellitesRange) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) NumericalPropagatorBuilder(org.orekit.propagation.conversion.NumericalPropagatorBuilder) BoundedPropagator(org.orekit.propagation.BoundedPropagator) Propagator(org.orekit.propagation.Propagator) InterSatellitesRangeMeasurementCreator(org.orekit.estimation.measurements.InterSatellitesRangeMeasurementCreator) LofOffset(org.orekit.attitudes.LofOffset) BoundedPropagator(org.orekit.propagation.BoundedPropagator) ObservedMeasurement(org.orekit.estimation.measurements.ObservedMeasurement) Test(org.junit.Test)

Example 2 with InterSatellitesRange

use of org.orekit.estimation.measurements.InterSatellitesRange in project Orekit by CS-SI.

the class OnBoardAntennaInterSatellitesRangeModifierTest method testEffect.

@Test
public void testEffect() throws OrekitException {
    Context context = EstimationTestUtils.eccentricContext("regular-data:potential:tides");
    final NumericalPropagatorBuilder propagatorBuilder = context.createBuilder(OrbitType.KEPLERIAN, PositionAngle.TRUE, true, 1.0e-6, 60.0, 0.001);
    propagatorBuilder.setAttitudeProvider(new LofOffset(propagatorBuilder.getFrame(), LOFType.LVLH));
    // create perfect inter-satellites range measurements without antenna offset
    final TimeStampedPVCoordinates original = context.initialOrbit.getPVCoordinates();
    final Orbit closeOrbit = new CartesianOrbit(new TimeStampedPVCoordinates(context.initialOrbit.getDate(), original.getPosition().add(new Vector3D(1000, 2000, 3000)), original.getVelocity().add(new Vector3D(-0.03, 0.01, 0.02))), context.initialOrbit.getFrame(), context.initialOrbit.getMu());
    final Propagator closePropagator = EstimationTestUtils.createPropagator(closeOrbit, propagatorBuilder);
    closePropagator.setEphemerisMode();
    closePropagator.propagate(context.initialOrbit.getDate().shiftedBy(3.5 * closeOrbit.getKeplerianPeriod()));
    final BoundedPropagator ephemeris = closePropagator.getGeneratedEphemeris();
    final Propagator p1 = EstimationTestUtils.createPropagator(context.initialOrbit, propagatorBuilder);
    final List<ObservedMeasurement<?>> spacecraftCenteredMeasurements = EstimationTestUtils.createMeasurements(p1, new InterSatellitesRangeMeasurementCreator(ephemeris, Vector3D.ZERO, Vector3D.ZERO), 1.0, 3.0, 300.0);
    // create perfect inter-satellites range measurements with antenna offset
    final Vector3D apc1 = new Vector3D(-2.5, 0.0, 0);
    final Vector3D apc2 = new Vector3D(0.0, 0.8, 0);
    final Propagator p2 = EstimationTestUtils.createPropagator(context.initialOrbit, propagatorBuilder);
    final List<ObservedMeasurement<?>> antennaCenteredMeasurements = EstimationTestUtils.createMeasurements(p2, new InterSatellitesRangeMeasurementCreator(ephemeris, apc1, apc2), 1.0, 3.0, 300.0);
    final Propagator p3 = EstimationTestUtils.createPropagator(context.initialOrbit, propagatorBuilder);
    OnBoardAntennaInterSatellitesRangeModifier modifier = new OnBoardAntennaInterSatellitesRangeModifier(apc1, apc2);
    for (int i = 0; i < spacecraftCenteredMeasurements.size(); ++i) {
        InterSatellitesRange sr = (InterSatellitesRange) spacecraftCenteredMeasurements.get(i);
        sr.addModifier(modifier);
        EstimatedMeasurement<InterSatellitesRange> estimated = sr.estimate(0, 0, new SpacecraftState[] { p3.propagate(sr.getDate()), ephemeris.propagate(sr.getDate()) });
        InterSatellitesRange ar = (InterSatellitesRange) antennaCenteredMeasurements.get(i);
        Assert.assertEquals(0.0, sr.getDate().durationFrom(ar.getDate()), 2.0e-8);
        Assert.assertEquals(ar.getObservedValue()[0], estimated.getEstimatedValue()[0], 2.0e-5);
    }
}
Also used : Context(org.orekit.estimation.Context) CartesianOrbit(org.orekit.orbits.CartesianOrbit) CartesianOrbit(org.orekit.orbits.CartesianOrbit) Orbit(org.orekit.orbits.Orbit) TimeStampedPVCoordinates(org.orekit.utils.TimeStampedPVCoordinates) InterSatellitesRange(org.orekit.estimation.measurements.InterSatellitesRange) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) NumericalPropagatorBuilder(org.orekit.propagation.conversion.NumericalPropagatorBuilder) BoundedPropagator(org.orekit.propagation.BoundedPropagator) Propagator(org.orekit.propagation.Propagator) InterSatellitesRangeMeasurementCreator(org.orekit.estimation.measurements.InterSatellitesRangeMeasurementCreator) LofOffset(org.orekit.attitudes.LofOffset) BoundedPropagator(org.orekit.propagation.BoundedPropagator) ObservedMeasurement(org.orekit.estimation.measurements.ObservedMeasurement) Test(org.junit.Test)

Aggregations

Vector3D (org.hipparchus.geometry.euclidean.threed.Vector3D)2 Test (org.junit.Test)2 LofOffset (org.orekit.attitudes.LofOffset)2 Context (org.orekit.estimation.Context)2 InterSatellitesRange (org.orekit.estimation.measurements.InterSatellitesRange)2 InterSatellitesRangeMeasurementCreator (org.orekit.estimation.measurements.InterSatellitesRangeMeasurementCreator)2 ObservedMeasurement (org.orekit.estimation.measurements.ObservedMeasurement)2 CartesianOrbit (org.orekit.orbits.CartesianOrbit)2 Orbit (org.orekit.orbits.Orbit)2 BoundedPropagator (org.orekit.propagation.BoundedPropagator)2 Propagator (org.orekit.propagation.Propagator)2 NumericalPropagatorBuilder (org.orekit.propagation.conversion.NumericalPropagatorBuilder)2 TimeStampedPVCoordinates (org.orekit.utils.TimeStampedPVCoordinates)2