1   /* Copyright 2022-2025 Thales Alenia Space
2    * Licensed to CS Communication & Systèmes (CS) under one or more
3    * contributor license agreements.  See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * CS licenses this file to You under the Apache License, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License.  You may obtain a copy of the License at
8    *
9    *   http://www.apache.org/licenses/LICENSE-2.0
10   *
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the License for the specific language governing permissions and
15   * limitations under the License.
16   */
17  package org.orekit.models.earth.troposphere;
18  
19  import org.hipparchus.util.Binary64Field;
20  import org.junit.jupiter.api.Assertions;
21  import org.junit.jupiter.api.Test;
22  import org.orekit.data.DataSource;
23  import org.orekit.models.earth.weather.GlobalPressureTemperature3;
24  import org.orekit.models.earth.weather.PressureTemperatureHumidityProvider;
25  import org.orekit.time.TimeScalesFactory;
26  
27  import java.io.IOException;
28  import java.net.URISyntaxException;
29  import java.net.URL;
30  
31  public class AskneNordiusModelTest extends AbstractPathDelayTest<AskneNordiusModel> {
32  
33      @Override
34      protected AskneNordiusModel buildTroposphericModel(final PressureTemperatureHumidityProvider provider) {
35          return new AskneNordiusModel(new GlobalMappingFunctionModel(), provider);
36      }
37  
38      @Test
39      @Override
40      public void testDelay() {
41          doTestDelay(defaultDate, defaultPoint, defaultTrackingCoordinates, getGPT(),
42                      2.0938, 6.80095, 3.39416, 11.03650, 14.43066);
43      }
44  
45      @Test
46      @Override
47      public void testFieldDelay() {
48          doTestDelay(Binary64Field.getInstance(),
49                      defaultDate, defaultPoint, defaultTrackingCoordinates, getGPT(),
50                      2.0938, 6.80095, 3.39416, 11.03650, 14.43066);
51      }
52  
53      @Test
54      @Override
55      public void testFixedElevation() {
56          doTestFixedElevation(getGPT());
57      }
58  
59      @Test
60      @Override
61      public void testFieldFixedElevation() {
62          doTestFieldFixedElevation(Binary64Field.getInstance(), getGPT());
63      }
64  
65      @Test
66      @Override
67      public void testFixedHeight() {
68          doTestFixedHeight(getGPT());
69      }
70  
71      @Test
72      @Override
73      public void testFieldFixedHeight() {
74          doTestFieldFixedHeight(Binary64Field.getInstance(), getGPT());
75      }
76  
77      private PressureTemperatureHumidityProvider getGPT() {
78          try {
79              final URL url = AskneNordiusModelTest.class.getClassLoader().getResource("gpt-grid/gpt3_5.grd");
80              return new GlobalPressureTemperature3(new DataSource(url.toURI()), TimeScalesFactory.getUTC());
81          } catch (URISyntaxException | IOException use) {
82              Assertions.fail(use);
83              return null;
84          }
85      }
86  
87  }