1   /* Copyright 2002-2025 CS GROUP
2    * Licensed to CS GROUP (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.atmosphere.data;
18  
19  import static org.hamcrest.MatcherAssert.assertThat;
20  import static org.orekit.OrekitMatchers.closeTo;
21  
22  import java.net.URISyntaxException;
23  import java.net.URL;
24  
25  import org.junit.jupiter.api.BeforeEach;
26  import org.junit.jupiter.api.Test;
27  import org.orekit.Utils;
28  import org.orekit.data.DataSource;
29  import org.orekit.time.AbsoluteDate;
30  import org.orekit.time.TimeScalesFactory;
31  
32  
33  public class JB2008SpaceEnvironmentDataTest {
34  
35      @BeforeEach
36      public void setUp() {
37          Utils.setDataRoot("regular-data:atmosphere");
38      }
39  
40      @Test
41      public void testIssue1116() throws URISyntaxException {
42          final URL urlSolfsmy = JB2008SpaceEnvironmentDataTest.class.getClassLoader().getResource("atmosphere/SOLFSMY_trunc.txt");
43          final URL urlDtc = JB2008SpaceEnvironmentDataTest.class.getClassLoader().getResource("atmosphere/DTCFILE_trunc.TXT");
44          JB2008SpaceEnvironmentData JBData = new JB2008SpaceEnvironmentData(new DataSource(urlSolfsmy.toURI()), new DataSource(urlDtc.toURI()));
45          final AbsoluteDate julianDate = AbsoluteDate.createJDDate(2453006, 0, TimeScalesFactory.getUTC());
46          assertThat(120.6, closeTo(JBData.getF10B(julianDate), 1e-10));
47      }
48  
49  }