use of org.orekit.forces.gravity.potential.FESCHatEpsilonReader in project Orekit by CS-SI.
the class OceanTidesTest method testNoGetParameter.
@Test
public void testNoGetParameter() throws OrekitException {
AstronomicalAmplitudeReader aaReader = new AstronomicalAmplitudeReader("hf-fes2004.dat", 5, 2, 3, 1.0);
DataProvidersManager.getInstance().feed(aaReader.getSupportedNames(), aaReader);
Map<Integer, Double> map = aaReader.getAstronomicalAmplitudesMap();
GravityFieldFactory.addOceanTidesReader(new FESCHatEpsilonReader("fes2004-7x7.dat", 0.01, FastMath.toRadians(1.0), OceanLoadDeformationCoefficients.IERS_2010, map));
ForceModel fm = new OceanTides(FramesFactory.getITRF(IERSConventions.IERS_1996, false), Constants.WGS84_EARTH_EQUATORIAL_RADIUS, Constants.WGS84_EARTH_MU, 5, 5, IERSConventions.IERS_1996, TimeScalesFactory.getUT1(IERSConventions.IERS_1996, false));
Assert.assertTrue(fm.dependsOnPositionOnly());
Assert.assertEquals(1, fm.getParametersDrivers().length);
try {
fm.getParameterDriver("unknown");
Assert.fail("an exception should have been thrown");
} catch (OrekitException miae) {
Assert.assertEquals(OrekitMessages.UNSUPPORTED_PARAMETER_NAME, miae.getSpecifier());
}
}
use of org.orekit.forces.gravity.potential.FESCHatEpsilonReader in project Orekit by CS-SI.
the class OceanTidesFieldTest method getWaves.
private List<OceanTidesWave> getWaves(int degree, int order, int... doodson) throws OrekitException {
// load a complete model
AstronomicalAmplitudeReader aaReader = new AstronomicalAmplitudeReader("hf-fes2004.dat", 5, 2, 3, 1.0);
DataProvidersManager.getInstance().feed(aaReader.getSupportedNames(), aaReader);
Map<Integer, Double> map = aaReader.getAstronomicalAmplitudesMap();
GravityFieldFactory.addOceanTidesReader(new FESCHatEpsilonReader("fes2004-7x7.dat", 0.01, FastMath.toRadians(1.0), OceanLoadDeformationCoefficients.IERS_2010, map));
List<OceanTidesWave> complete = GravityFieldFactory.getOceanTidesWaves(degree, order);
double[][][] triangular = new double[degree + 1][][];
for (int i = 0; i <= degree; ++i) {
triangular[i] = new double[FastMath.min(i, order) + 1][4];
}
;
// filter waves
List<OceanTidesWave> filtered = new ArrayList<OceanTidesWave>(doodson.length);
for (final int d : doodson) {
for (final OceanTidesWave wave : complete) {
if (wave.getDoodson() == d) {
filtered.add(wave);
}
}
}
return filtered;
}
Aggregations