1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.orekit.models.earth.troposphere;
18
19 import org.hipparchus.util.FastMath;
20 import org.hipparchus.util.Precision;
21 import org.junit.jupiter.api.Assertions;
22 import org.junit.jupiter.api.BeforeAll;
23 import org.junit.jupiter.api.BeforeEach;
24 import org.junit.jupiter.api.Test;
25 import org.orekit.Utils;
26 import org.orekit.bodies.GeodeticPoint;
27 import org.orekit.errors.OrekitException;
28 import org.orekit.time.AbsoluteDate;
29 import org.orekit.time.TimeScalesFactory;
30 import org.orekit.utils.TrackingCoordinates;
31
32 public class ViennaThreeTest {
33
34 private static double epsilon = 1e-6;
35
36 @BeforeAll
37 public static void setUpGlobal() {
38 Utils.setDataRoot("atmosphere");
39 }
40
41 @BeforeEach
42 public void setUp() throws OrekitException {
43 Utils.setDataRoot("regular-data:potential/shm-format");
44 }
45
46 @Test
47 public void testMappingFactors() {
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69 final AbsoluteDate date = new AbsoluteDate(2018, 11, 25, TimeScalesFactory.getUTC());
70
71 final double latitude = FastMath.toRadians(37.5);
72 final double longitude = FastMath.toRadians(277.5);
73 final double height = 824.0;
74 final GeodeticPoint point = new GeodeticPoint(latitude, longitude, height);
75
76 final TrackingCoordinates trackingCoordinates = new TrackingCoordinates(0.0, FastMath.toRadians(38.0), 0.0);
77 final double expectedHydro = 1.621024;
78 final double expectedWet = 1.623023;
79
80 final ViennaThree model = new ViennaThree(new ConstantViennaAProvider(new ViennaACoefficients(0.00123462, 0.00047101)),
81 new ConstantAzimuthalGradientProvider(null),
82 new ConstantTroposphericModel(new TroposphericDelay(2.1993, 0.0690, 0, 0)),
83 TimeScalesFactory.getUTC());
84
85 final double[] computedMapping = model.mappingFactors(trackingCoordinates, point,
86 TroposphericModelUtils.STANDARD_ATMOSPHERE,
87 date);
88
89 Assertions.assertEquals(expectedHydro, computedMapping[0], epsilon);
90 Assertions.assertEquals(expectedWet, computedMapping[1], epsilon);
91 }
92
93 @Test
94 public void testLowElevation() {
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116 final AbsoluteDate date = new AbsoluteDate(2018, 11, 25, TimeScalesFactory.getUTC());
117
118 final double latitude = FastMath.toRadians(37.5);
119 final double longitude = FastMath.toRadians(277.5);
120 final double height = 824.0;
121 final GeodeticPoint point = new GeodeticPoint(latitude, longitude, height);
122
123 final TrackingCoordinates trackingCoordinates = new TrackingCoordinates(0.0, FastMath.toRadians(5.0), 0.0);
124 final double expectedHydro = 10.132802;
125 final double expectedWet = 10.879154;
126
127 final ViennaThree model = new ViennaThree(new ConstantViennaAProvider(new ViennaACoefficients(0.00123462, 0.00047101)),
128 new ConstantAzimuthalGradientProvider(null),
129 new ConstantTroposphericModel(new TroposphericDelay(2.1993, 0.0690, 0, 0)),
130 TimeScalesFactory.getUTC());
131
132 final double[] computedMapping = model.mappingFactors(trackingCoordinates, point,
133 TroposphericModelUtils.STANDARD_ATMOSPHERE,
134 date);
135
136 Assertions.assertEquals(expectedHydro, computedMapping[0], epsilon);
137 Assertions.assertEquals(expectedWet, computedMapping[1], epsilon);
138 }
139
140 @Test
141 public void testHightElevation() {
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163 final AbsoluteDate date = new AbsoluteDate(2018, 11, 25, TimeScalesFactory.getUTC());
164
165 final double latitude = FastMath.toRadians(37.5);
166 final double longitude = FastMath.toRadians(277.5);
167 final double height = 824.0;
168 final GeodeticPoint point = new GeodeticPoint(latitude, longitude, height);
169
170 final TrackingCoordinates trackingCoordinates = new TrackingCoordinates(0.0, FastMath.toRadians(85.0), 0.0);
171 final double expectedHydro = 1.003810;
172 final double expectedWet = 1.003816;
173
174 final ViennaThree model = new ViennaThree(new ConstantViennaAProvider(new ViennaACoefficients(0.00123462, 0.00047101)),
175 new ConstantAzimuthalGradientProvider(null),
176 new ConstantTroposphericModel(new TroposphericDelay(2.1993, 0.0690, 0, 0)),
177 TimeScalesFactory.getUTC());
178
179 final double[] computedMapping = model.mappingFactors(trackingCoordinates, point,
180 TroposphericModelUtils.STANDARD_ATMOSPHERE,
181 date);
182
183 Assertions.assertEquals(expectedHydro, computedMapping[0], epsilon);
184 Assertions.assertEquals(expectedWet, computedMapping[1], epsilon);
185 }
186
187 @Test
188 public void testDelay() {
189 final double azimuth = 30.0;
190 final double elevation = 10.0;
191 final double height = 100.0;
192 final AbsoluteDate date = new AbsoluteDate();
193 final GeodeticPoint point = new GeodeticPoint(FastMath.toRadians(37.5), FastMath.toRadians(277.5), height);
194 final ViennaThree model = new ViennaThree(new ConstantViennaAProvider(new ViennaACoefficients(0.00123462, 0.00047101)),
195 new ConstantAzimuthalGradientProvider(null),
196 new ConstantTroposphericModel(new TroposphericDelay(2.1993, 0.0690, 0, 0)),
197 TimeScalesFactory.getUTC());
198 final TroposphericDelay delay = model.pathDelay(new TrackingCoordinates(FastMath.toRadians(azimuth), FastMath.toRadians(elevation), 0.0),
199 point,
200 TroposphericModelUtils.STANDARD_ATMOSPHERE,
201 model.getParameters(date), date);
202 Assertions.assertEquals( 2.1993, delay.getZh(), 1.0e-4);
203 Assertions.assertEquals( 0.069, delay.getZw(), 1.0e-4);
204 Assertions.assertEquals(12.2124, delay.getSh(), 1.0e-4);
205 Assertions.assertEquals( 0.3916, delay.getSw(), 1.0e-4);
206 Assertions.assertEquals(12.6041, delay.getDelay(), 1.0e-4);
207 }
208
209 @Test
210 public void testDelayWithAzimuthalAsymmetry() {
211 final double azimuth = 30.0;
212 final double elevation = 10.0;
213 final double height = 100.0;
214 final AbsoluteDate date = new AbsoluteDate();
215 final GeodeticPoint point = new GeodeticPoint(FastMath.toRadians(37.5), FastMath.toRadians(277.5), height);
216 final ViennaThree model = new ViennaThree(new ConstantViennaAProvider(new ViennaACoefficients(0.00123462, 0.00047101)),
217 new ConstantAzimuthalGradientProvider(new AzimuthalGradientCoefficients(12.0, 4.5,
218 0.8, 1.25)),
219 new ConstantTroposphericModel(new TroposphericDelay(2.1993, 0.0690, 0, 0)),
220 TimeScalesFactory.getUTC());
221 final TroposphericDelay delay = model.pathDelay(new TrackingCoordinates(FastMath.toRadians(azimuth), FastMath.toRadians(elevation), 0.0),
222 point,
223 TroposphericModelUtils.STANDARD_ATMOSPHERE,
224 model.getParameters(date), date);
225 Assertions.assertEquals( 2.1993, delay.getZh(), 1.0e-4);
226 Assertions.assertEquals( 0.069, delay.getZw(), 1.0e-4);
227 Assertions.assertEquals(12.2124 + 373.8241, delay.getSh(), 1.0e-4);
228 Assertions.assertEquals( 0.3916 + 38.9670, delay.getSw(), 1.0e-4);
229 Assertions.assertEquals(12.6041 + 373.8241 + 38.9670, delay.getDelay(), 1.0e-4);
230 }
231
232 @Test
233 public void testFixedHeight() {
234 final AbsoluteDate date = new AbsoluteDate();
235 final GeodeticPoint point = new GeodeticPoint(FastMath.toRadians(37.5), FastMath.toRadians(277.5), 350.0);
236 ViennaThree model = new ViennaThree(new ConstantViennaAProvider(new ViennaACoefficients(0.00123462, 0.00047101)),
237 new ConstantAzimuthalGradientProvider(null),
238 new ConstantTroposphericModel(new TroposphericDelay(2.1993, 0.0690, 0, 0)),
239 TimeScalesFactory.getUTC());
240 double lastDelay = Double.MAX_VALUE;
241
242 for (double elev = 10d; elev < 90d; elev += 8d) {
243 final double delay = model.pathDelay(new TrackingCoordinates(0.0, FastMath.toRadians(elev), 0.0),
244 point,
245 TroposphericModelUtils.STANDARD_ATMOSPHERE,
246 model.getParameters(date), date).getDelay();
247 Assertions.assertTrue(Precision.compareTo(delay, lastDelay, epsilon) < 0);
248 lastDelay = delay;
249 }
250 }
251
252 }