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.gnss.attitude;
18  
19  import org.junit.jupiter.api.Test;
20  
21  
22  public class GPSBlockIIRTest extends AbstractGNSSAttitudeProviderTest {
23  
24      @Test
25      public void testPatchedLargeNegativeBeta() {
26          doTestAxes("patched-eclips/beta-large-negative-BLOCK-IIR.txt", 8.0e-15, 8.8e-16, false);
27      }
28  
29      @Test
30      public void testPatchedSmallNegativeBeta() {
31          doTestAxes("patched-eclips/beta-small-negative-BLOCK-IIR.txt", 5.4e-13, 9.6e-16, false);
32      }
33  
34      @Test
35      public void testPatchedCrossingBeta() {
36          doTestAxes("patched-eclips/beta-crossing-BLOCK-IIR.txt", 5.2e-5, 8.7e-16, false);
37      }
38  
39      @Test
40      public void testPatchedSmallPositiveBeta() {
41          doTestAxes("patched-eclips/beta-small-positive-BLOCK-IIR.txt", 1.2e-12, 9.4e-16, false);
42      }
43  
44      @Test
45      public void testPatchedLargePositiveBeta() {
46          doTestAxes("patched-eclips/beta-large-positive-BLOCK-IIR.txt", 6.7e-15, 9.1e-16, false);
47      }
48  
49      @Test
50      public void testOriginalLargeNegativeBeta() {
51          doTestAxes("original-eclips/beta-large-negative-BLOCK-IIR.txt", 8.0e-15, 8.8e-16, false);
52      }
53  
54      @Test
55      public void testOriginalSmallNegativeBeta() {
56          doTestAxes("original-eclips/beta-small-negative-BLOCK-IIR.txt", 6.5e-4, 9.6e-16, false);
57      }
58  
59      @Test
60      public void testOriginalCrossingBeta() {
61          // the very high threshold (1.68 radians) is due to the same probable bugs in original eclips
62          // as the corresponding test for block-IIA. There are non-normalized vectors in the
63          // "original-eclips/beta-crossing-BLOCK-IIR.txt" (one of them having a norm greater than 43000!)
64          // leading to wrong yaw and there are sign changes for PHI/YANGLE
65          // As a conclusion, we consider here that the reference output is wrong and that
66          // Orekit behaviour is correct, so we increased the threshold so the test pass,
67          // and wrote this big comment to explain the situation
68          doTestAxes("original-eclips/beta-crossing-BLOCK-IIR.txt", 1.68, 8.7e-16, false);
69      }
70  
71      @Test
72      public void testOriginalSmallPositiveBeta() {
73          doTestAxes("original-eclips/beta-small-positive-BLOCK-IIR.txt", 7.4e-4, 9.4e-16, false);
74      }
75  
76      @Test
77      public void testOriginalLargePositiveBeta() {
78          doTestAxes("original-eclips/beta-large-positive-BLOCK-IIR.txt", 6.7e-15, 9.1e-16, false);
79      }
80  
81  }