1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.orekit.estimation.measurements.modifiers;
18
19 import org.hipparchus.geometry.euclidean.threed.Vector3D;
20 import org.junit.jupiter.api.Assertions;
21 import org.junit.jupiter.api.BeforeEach;
22 import org.junit.jupiter.api.Test;
23 import org.orekit.Utils;
24 import org.orekit.estimation.measurements.EstimatedMeasurement;
25 import org.orekit.estimation.measurements.EstimatedMeasurementBase;
26 import org.orekit.estimation.measurements.EstimationModifier;
27 import org.orekit.estimation.measurements.gnss.InterSatellitesOneWayRangeRate;
28 import org.orekit.estimation.measurements.ObservableSatellite;
29 import org.orekit.propagation.SpacecraftState;
30 import org.orekit.propagation.analytical.tle.TLE;
31 import org.orekit.propagation.analytical.tle.TLEPropagator;
32 import org.orekit.time.AbsoluteDate;
33 import org.orekit.time.TimeScalesFactory;
34 import org.orekit.utils.Constants;
35 import org.orekit.utils.PVCoordinates;
36
37 public class RelativisticClockInterSatellitesOneWayRangeRateModifierTest {
38
39
40 private static AbsoluteDate date;
41
42
43 private static SpacecraftState[] states;
44
45 @Test
46 public void testRelativisticClockCorrection() {
47
48
49 final PVCoordinates delta = new PVCoordinates(states[1].getPVCoordinates(),
50 states[0].getPVCoordinates());
51 final InterSatellitesOneWayRangeRate range = new InterSatellitesOneWayRangeRate(new ObservableSatellite(0),
52 new ObservableSatellite(1),
53 date,
54 Vector3D.dotProduct(delta.getVelocity(),
55 delta.getPosition().normalize()),
56 1.0, 1.0);
57
58
59 final EstimatedMeasurementBase<InterSatellitesOneWayRangeRate> estimatedBefore = range.estimateWithoutDerivatives(states);
60
61
62 final EstimationModifier<InterSatellitesOneWayRangeRate> modifier =
63 new RelativisticClockInterSatellitesOneWayRangeRateModifier(Constants.EIGEN5C_EARTH_MU);
64 range.addModifier(modifier);
65 final EstimatedMeasurement<InterSatellitesOneWayRangeRate> estimatedAfter = range.estimate(0, 0, states);
66
67
68 Assertions.assertEquals(1.63e-3, estimatedBefore.getEstimatedValue()[0] - estimatedAfter.getEstimatedValue()[0], 1.0e-5);
69 Assertions.assertEquals(0, modifier.getParametersDrivers().size());
70 Assertions.assertEquals(1,
71 estimatedAfter.getAppliedEffects().entrySet().stream().
72 filter(e -> e.getKey().getEffectName().equals("clock relativity")).count());
73 }
74
75 @BeforeEach
76 public void setUp() {
77
78 Utils.setDataRoot("regular-data");
79
80
81 date = new AbsoluteDate("2004-01-13T00:00:00.000", TimeScalesFactory.getUTC());
82
83
84 states = new SpacecraftState[2];
85 final TLE local = new TLE("1 27642U 03002A 04013.91734903 .00000108 00000-0 12227-4 0 3621",
86 "2 27642 93.9970 6.8623 0003169 80.1383 280.0205 14.90871424 54508");
87 final TLE remote = new TLE("1 20061U 89044A 04013.44391333 .00000095 00000-0 10000-3 0 3242",
88 "2 20061 53.4233 172.2072 0234017 261.4179 95.8975 2.00577231106949");
89 states[0] = TLEPropagator.selectExtrapolator(local).propagate(date);
90 states[1] = TLEPropagator.selectExtrapolator(remote).propagate(date);
91 }
92
93 }