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.Assert;
21 import org.junit.Before;
22 import org.junit.Test;
23 import org.orekit.Utils;
24 import org.orekit.estimation.measurements.EstimatedMeasurement;
25 import org.orekit.estimation.measurements.EstimationModifier;
26 import org.orekit.estimation.measurements.ObservableSatellite;
27 import org.orekit.estimation.measurements.gnss.InterSatellitesPhase;
28 import org.orekit.gnss.Frequency;
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
35 public class RelativisticClockInterSatellitesPhaseModifierTest {
36
37
38 private static AbsoluteDate date;
39
40
41 private static SpacecraftState[] states;
42
43 @Test
44 public void testRelativisticClockCorrection() {
45
46
47 final double wavelength = Frequency.G01.getWavelength();
48 final InterSatellitesPhase phase = new InterSatellitesPhase(new ObservableSatellite(0), new ObservableSatellite(1),
49 date,
50 Vector3D.distance(states[0].getPVCoordinates().getPosition(),
51 states[1].getPVCoordinates().getPosition()) / wavelength,
52 wavelength, 1.0, 1.0);
53
54
55 final EstimatedMeasurement<InterSatellitesPhase> estimatedBefore = phase.estimate(0, 0, states);
56
57
58 final EstimationModifier<InterSatellitesPhase> modifier = new RelativisticClockInterSatellitesPhaseModifier();
59 phase.addModifier(modifier);
60 final EstimatedMeasurement<InterSatellitesPhase> estimatedAfter = phase.estimate(0, 0, states);
61
62
63 Assert.assertEquals(-10.57, (estimatedBefore.getEstimatedValue()[0] - estimatedAfter.getEstimatedValue()[0]) * wavelength, 1.0e-2);
64 Assert.assertEquals(0, modifier.getParametersDrivers().size());
65
66 }
67
68 @Before
69 public void setUp() {
70
71 Utils.setDataRoot("regular-data");
72
73
74 date = new AbsoluteDate("2004-01-13T00:00:00.000", TimeScalesFactory.getUTC());
75
76
77 states = new SpacecraftState[2];
78 final TLE local = new TLE("1 27642U 03002A 04013.91734903 .00000108 00000-0 12227-4 0 3621",
79 "2 27642 93.9970 6.8623 0003169 80.1383 280.0205 14.90871424 54508");
80 final TLE remote = new TLE("1 20061U 89044A 04013.44391333 .00000095 00000-0 10000-3 0 3242",
81 "2 20061 53.4233 172.2072 0234017 261.4179 95.8975 2.00577231106949");
82 states[0] = TLEPropagator.selectExtrapolator(local).propagate(date);
83 states[1] = TLEPropagator.selectExtrapolator(remote).propagate(date);
84 }
85
86 }