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.ObservableSatellite;
28 import org.orekit.estimation.measurements.gnss.AmbiguityCache;
29 import org.orekit.estimation.measurements.gnss.InterSatellitesPhase;
30 import org.orekit.gnss.PredefinedGnssSignal;
31 import org.orekit.propagation.SpacecraftState;
32 import org.orekit.propagation.analytical.tle.TLE;
33 import org.orekit.propagation.analytical.tle.TLEPropagator;
34 import org.orekit.time.AbsoluteDate;
35 import org.orekit.time.TimeScalesFactory;
36 import org.orekit.utils.Constants;
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53 public class RelativisticJ2ClockInterSatellitesPhaseModifierTest {
54
55
56 private static AbsoluteDate date;
57
58
59 private static SpacecraftState[] states;
60
61 @Deprecated
62 @Test
63 public void testRelativisticClockCorrectionDeprecated() {
64
65
66 final double wavelength = PredefinedGnssSignal.G01.getWavelength();
67 final InterSatellitesPhase phase = new InterSatellitesPhase(new ObservableSatellite(0), new ObservableSatellite(1),
68 date,
69 Vector3D.distance(states[0].getPosition(),
70 states[1].getPosition()) / wavelength,
71 wavelength, 1.0, 1.0,
72 new AmbiguityCache());
73
74
75 final EstimatedMeasurementBase<InterSatellitesPhase> estimatedBefore = phase.estimateWithoutDerivatives(states);
76
77
78 final EstimationModifier<InterSatellitesPhase> modifier = new RelativisticJ2ClockInterSatellitesPhaseModifier(Constants.WGS84_EARTH_MU,
79 Constants.WGS84_EARTH_C20, Constants.WGS84_EARTH_EQUATORIAL_RADIUS );
80 phase.addModifier(modifier);
81 final EstimatedMeasurement<InterSatellitesPhase> estimatedAfter = phase.estimate(0, 0, states);
82
83
84
85 Assertions.assertEquals(-0.106217, estimatedBefore.getEstimatedValue()[0] - estimatedAfter.getEstimatedValue()[0], 1.0e-6);
86 Assertions.assertEquals(0, modifier.getParametersDrivers().size());
87 Assertions.assertEquals(1,
88 estimatedAfter.getAppliedEffects().entrySet().stream().
89 filter(e -> e.getKey().getEffectName().equals("J₂ clock relativity")).count());
90
91 }
92
93 @Test
94 public void testRelativisticClockCorrection() {
95
96
97 final AmbiguityCache cache = new AmbiguityCache();
98 final double wavelength = PredefinedGnssSignal.G01.getWavelength();
99 final InterSatellitesPhase phase = new InterSatellitesPhase(new ObservableSatellite(0), new ObservableSatellite(1),
100 date,
101 Vector3D.distance(states[0].getPosition(),
102 states[1].getPosition()) / wavelength,
103 wavelength, 1.0, 1.0,
104 cache);
105
106
107 final EstimatedMeasurementBase<InterSatellitesPhase> estimatedBefore = phase.estimateWithoutDerivatives(states);
108
109
110 final EstimationModifier<InterSatellitesPhase> modifier = new RelativisticJ2ClockInterSatellitesPhaseModifier(Constants.WGS84_EARTH_MU,
111 Constants.WGS84_EARTH_C20, Constants.WGS84_EARTH_EQUATORIAL_RADIUS );
112 phase.addModifier(modifier);
113 final EstimatedMeasurement<InterSatellitesPhase> estimatedAfter = phase.estimate(0, 0, states);
114
115
116
117 Assertions.assertEquals(-0.106217, estimatedBefore.getEstimatedValue()[0] - estimatedAfter.getEstimatedValue()[0], 1.0e-6);
118 Assertions.assertEquals(0, modifier.getParametersDrivers().size());
119
120 }
121
122 @BeforeEach
123 public void setUp() {
124
125 Utils.setDataRoot("regular-data");
126
127
128 date = new AbsoluteDate("2004-01-13T00:00:00.000", TimeScalesFactory.getUTC());
129
130
131 states = new SpacecraftState[2];
132 final TLE local = new TLE("1 27642U 03002A 04013.91734903 .00000108 00000-0 12227-4 0 3621",
133 "2 27642 93.9970 6.8623 0003169 80.1383 280.0205 14.90871424 54508");
134 final TLE remote = new TLE("1 20061U 89044A 04013.44391333 .00000095 00000-0 10000-3 0 3242",
135 "2 20061 53.4233 172.2072 0234017 261.4179 95.8975 2.00577231106949");
136 states[0] = TLEPropagator.selectExtrapolator(local).propagate(date);
137 states[1] = TLEPropagator.selectExtrapolator(remote).propagate(date);
138 }
139
140 }