use of org.orekit.forces.gravity.potential.UnnormalizedSphericalHarmonicsProvider.UnnormalizedSphericalHarmonics in project Orekit by CS-SI.
the class ICGEMFormatReaderTest method testMissingDegree1.
/**
* check files without 1,0 and 1,1 can be parsed.
*/
@Test
public void testMissingDegree1() throws OrekitException {
Utils.setDataRoot("potential");
GravityFieldFactory.addPotentialCoefficientsReader(new ICGEMFormatReader("dummy_missing_degree_1", false));
UnnormalizedSphericalHarmonics harmonics = GravityFieldFactory.getUnnormalizedProvider(2, 2).onDate(AbsoluteDate.J2000_EPOCH);
// check coefficients not in the file are initialized correctly
Assert.assertEquals(0.0, harmonics.getUnnormalizedCnm(1, 0), 0.0);
Assert.assertEquals(0.0, harmonics.getUnnormalizedCnm(1, 1), 0.0);
// check a coefficient is read correctly
Assert.assertEquals(10.0, harmonics.getUnnormalizedCnm(2, 2), 0.0);
}
use of org.orekit.forces.gravity.potential.UnnormalizedSphericalHarmonicsProvider.UnnormalizedSphericalHarmonics in project Orekit by CS-SI.
the class ICGEMFormatReaderTest method testEigen06.
@Test
public void testEigen06() throws OrekitException {
Utils.setDataRoot("potential");
GravityFieldFactory.addPotentialCoefficientsReader(new ICGEMFormatReader("eigen-6s-truncated", false));
UnnormalizedSphericalHarmonicsProvider provider = GravityFieldFactory.getUnnormalizedProvider(5, 5);
Assert.assertEquals(TideSystem.TIDE_FREE, provider.getTideSystem());
AbsoluteDate refDate = new AbsoluteDate("2005-01-01T12:00:00", TimeScalesFactory.getTT());
Assert.assertEquals(refDate, provider.getReferenceDate());
AbsoluteDate date = new AbsoluteDate("2013-01-08T10:46:53", TimeScalesFactory.getTT());
Assert.assertEquals(date.durationFrom(refDate), provider.getOffset(date), Precision.SAFE_MIN);
UnnormalizedSphericalHarmonics harmonics = provider.onDate(date);
int maxUlps = 2;
checkValue(harmonics.getUnnormalizedCnm(3, 0), date, 3, 0, 2005, 1, 1, 9.57211326674e-07, -8.37191630994e-12, -1.76087178236e-11, 9.47617140143e-11, 1.06252954726e-11, -9.12524501214e-12, maxUlps);
checkValue(harmonics.getUnnormalizedCnm(5, 5), date, 5, 5, 2005, 1, 1, 1.74807033099e-07, -1.33498578664e-12, -2.76043013690e-12, -8.28591865697e-12, 1.57898939101e-12, 2.90931436419e-12, maxUlps);
checkValue(harmonics.getUnnormalizedSnm(4, 0), date, 4, 0, 2005, 1, 1, 0, 0, 0, 0, 0, 0, maxUlps);
checkValue(harmonics.getUnnormalizedSnm(4, 4), date, 4, 4, 2005, 1, 1, 3.08820169866e-07, 4.35447782358e-13, -1.21823769110e-11, 3.89722186321e-11, 7.28153817742e-12, -7.64506592459e-12, maxUlps);
Assert.assertEquals(0.3986004415E+15, provider.getMu(), 1.0e-20);
Assert.assertEquals(0.6378136460E+07, provider.getAe(), 1.0e-20);
}
use of org.orekit.forces.gravity.potential.UnnormalizedSphericalHarmonicsProvider.UnnormalizedSphericalHarmonics in project Orekit by CS-SI.
the class ICGEMFormatReaderTest method testReadLimits.
@Test
public void testReadLimits() throws OrekitException {
Utils.setDataRoot("potential");
GravityFieldFactory.addPotentialCoefficientsReader(new ICGEMFormatReader("g007_eigen_05c_coef", false));
UnnormalizedSphericalHarmonicsProvider provider = GravityFieldFactory.getUnnormalizedProvider(3, 2);
UnnormalizedSphericalHarmonics harmonics = provider.onDate(provider.getReferenceDate());
Assert.assertEquals(TideSystem.TIDE_FREE, provider.getTideSystem());
try {
harmonics.getUnnormalizedCnm(3, 3);
Assert.fail("an exception should have been thrown");
} catch (OrekitException oe) {
// expected
} catch (Exception e) {
Assert.fail("wrong exception caught: " + e.getLocalizedMessage());
}
try {
harmonics.getUnnormalizedCnm(4, 2);
Assert.fail("an exception should have been thrown");
} catch (OrekitException oe) {
// expected
} catch (Exception e) {
Assert.fail("wrong exception caught: " + e.getLocalizedMessage());
}
harmonics.getUnnormalizedCnm(3, 2);
Assert.assertEquals(3, provider.getMaxDegree());
Assert.assertEquals(2, provider.getMaxOrder());
}
use of org.orekit.forces.gravity.potential.UnnormalizedSphericalHarmonicsProvider.UnnormalizedSphericalHarmonics in project Orekit by CS-SI.
the class ICGEMFormatReaderTest method testRegular05cUnnormalized.
@Test
public void testRegular05cUnnormalized() throws OrekitException {
Utils.setDataRoot("potential");
GravityFieldFactory.addPotentialCoefficientsReader(new ICGEMFormatReader("g007_eigen_05c_coef", false));
UnnormalizedSphericalHarmonicsProvider provider = GravityFieldFactory.getUnnormalizedProvider(5, 5);
Assert.assertEquals(TideSystem.TIDE_FREE, provider.getTideSystem());
AbsoluteDate refDate = new AbsoluteDate("2004-10-01T12:00:00", TimeScalesFactory.getTT());
Assert.assertEquals(refDate, provider.getReferenceDate());
AbsoluteDate date = new AbsoluteDate("2013-01-08T10:46:53", TimeScalesFactory.getTT());
Assert.assertEquals(date.durationFrom(refDate), provider.getOffset(date), Precision.SAFE_MIN);
UnnormalizedSphericalHarmonics harmonics = provider.onDate(date);
int maxUlps = 2;
checkValue(harmonics.getUnnormalizedCnm(3, 0), date, 3, 0, 2004, 10, 1, 0.957212879862e-06, 0.490000000000e-11, 0, 0, 0, 0, maxUlps);
checkValue(harmonics.getUnnormalizedCnm(5, 5), date, 5, 5, 2004, 10, 1, 0.174804558032e-06, 0, 0, 0, 0, 0, maxUlps);
checkValue(harmonics.getUnnormalizedSnm(4, 0), date, 4, 0, 2004, 10, 1, 0, 0, 0, 0, 0, 0, maxUlps);
checkValue(harmonics.getUnnormalizedSnm(4, 4), date, 4, 4, 2004, 10, 1, 0.308816581016e-06, 0, 0, 0, 0, 0, maxUlps);
Assert.assertEquals(0.3986004415E+15, provider.getMu(), 1.0e-20);
Assert.assertEquals(0.6378136460E+07, provider.getAe(), 1.0e-20);
}
use of org.orekit.forces.gravity.potential.UnnormalizedSphericalHarmonicsProvider.UnnormalizedSphericalHarmonics in project Orekit by CS-SI.
the class SHMFormatReaderTest method testReadCompressed01c.
@Test
public void testReadCompressed01c() throws OrekitException {
Utils.setDataRoot("potential");
GravityFieldFactory.addPotentialCoefficientsReader(new SHMFormatReader("compressed-eigen-cg01c_coef", false));
UnnormalizedSphericalHarmonicsProvider provider = GravityFieldFactory.getUnnormalizedProvider(5, 5);
Assert.assertEquals(TideSystem.TIDE_FREE, provider.getTideSystem());
AbsoluteDate refDate = new AbsoluteDate("1997-01-01T12:00:00", TimeScalesFactory.getTT());
Assert.assertEquals(refDate, provider.getReferenceDate());
AbsoluteDate date = new AbsoluteDate("2011-05-01T01:02:03", TimeScalesFactory.getTT());
Assert.assertEquals(date.durationFrom(refDate), provider.getOffset(date), Precision.SAFE_MIN);
UnnormalizedSphericalHarmonics harmonics = provider.onDate(date);
int maxUlps = 2;
checkValue(harmonics.getUnnormalizedCnm(3, 0), date, 3, 0, 1997, 1, 1, 0.957187536534E-06, 0.490000000000E-11, maxUlps);
checkValue(harmonics.getUnnormalizedCnm(5, 5), date, 5, 5, 1997, 1, 1, 0.174787189024E-06, 0.0, maxUlps);
checkValue(harmonics.getUnnormalizedSnm(4, 0), date, 4, 0, 1997, 1, 1, 0, 0, maxUlps);
checkValue(harmonics.getUnnormalizedSnm(4, 4), date, 4, 4, 1997, 1, 1, 0.308834848269E-06, 0, maxUlps);
Assert.assertEquals(0.3986004415E+15, provider.getMu(), 0);
Assert.assertEquals(0.6378136460E+07, provider.getAe(), 0);
}
Aggregations