1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.orekit.forces.gravity.potential;
18
19 import org.hipparchus.util.FastMath;
20 import org.junit.jupiter.api.Assertions;
21 import org.junit.jupiter.api.Test;
22
23 public class OceanLoadDeformationCoefficientsTest {
24
25 @Test
26 void testIERS1996EqualsIERS2003()
27 {
28 double[] coeff1996 = OceanLoadDeformationCoefficients.IERS_1996.getCoefficients();
29 double[] coeff2003 = OceanLoadDeformationCoefficients.IERS_2003.getCoefficients();
30 Assertions.assertEquals(coeff1996.length, coeff2003.length);
31 for (int i = 0; i < coeff1996.length; ++i) {
32 Assertions.assertEquals(coeff1996[i], coeff2003[i], 1.0e-15);
33 }
34 }
35
36 @Test
37 void testIERS1996EqualsIERS2010()
38 {
39 double[] coeff1996 = OceanLoadDeformationCoefficients.IERS_1996.getCoefficients();
40 double[] coeff2010 = OceanLoadDeformationCoefficients.IERS_2010.getCoefficients();
41 Assertions.assertEquals(coeff1996.length, coeff2010.length);
42 for (int i = 0; i < coeff1996.length; ++i) {
43 Assertions.assertEquals(coeff1996[i], coeff2010[i], 1.0e-15);
44 }
45 }
46
47 @Test
48 void testGegoutHighDegree()
49 {
50 Assertions.assertEquals(251, OceanLoadDeformationCoefficients.GEGOUT.getCoefficients().length);
51 }
52
53 @Test
54 void testGegoutNotEqualToIERS()
55 {
56 double[] coeff1996 = OceanLoadDeformationCoefficients.IERS_1996.getCoefficients();
57 double[] coeffGegout = OceanLoadDeformationCoefficients.GEGOUT.getCoefficients();
58 for (int i = 0; i < coeff1996.length; ++i) {
59 if (coeff1996[i] == 0) {
60 Assertions.assertEquals(0.0, coeffGegout[i], 1.0e-15);
61 } else {
62 Assertions.assertTrue(FastMath.abs(coeff1996[i] - coeffGegout[i]) > FastMath.abs(coeff1996[i]) / 200);
63 }
64 }
65 }
66
67 }