Search in sources :

Example 1 with OceanTidesWave

use of org.orekit.forces.gravity.potential.OceanTidesWave in project Orekit by CS-SI.

the class OceanTidesWaveTest method testDelaunayParameters.

@Test
public void testDelaunayParameters() throws OrekitException, SecurityException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException {
    Field cGammaField = OceanTidesWave.class.getDeclaredField("cGamma");
    cGammaField.setAccessible(true);
    Field cLField = OceanTidesWave.class.getDeclaredField("cL");
    cLField.setAccessible(true);
    Field cLPrimeField = OceanTidesWave.class.getDeclaredField("cLPrime");
    cLPrimeField.setAccessible(true);
    Field cFField = OceanTidesWave.class.getDeclaredField("cF");
    cFField.setAccessible(true);
    Field cDField = OceanTidesWave.class.getDeclaredField("cD");
    cDField.setAccessible(true);
    Field cOmegaField = OceanTidesWave.class.getDeclaredField("cOmega");
    cOmegaField.setAccessible(true);
    // these reference values have been extract from table 6.5b, 6.5a and 6.5c
    // in IERS conventions 2010
    int[][] tab65 = new int[][] { // long period waves from table 6.5b
    { 55565, 0, 0, 0, 0, 0, 1 }, { 55575, 0, 0, 0, 0, 0, 2 }, { 56554, 0, 0, -1, 0, 0, 0 }, { 57555, 0, 0, 0, -2, 2, -2 }, { 57565, 0, 0, 0, -2, 2, -1 }, { 58554, 0, 0, -1, -2, 2, -2 }, { 63655, 0, 1, 0, 0, -2, 0 }, { 65445, 0, -1, 0, 0, 0, -1 }, { 65455, 0, -1, 0, 0, 0, 0 }, { 65465, 0, -1, 0, 0, 0, 1 }, { 65655, 0, 1, 0, -2, 0, -2 }, { 73555, 0, 0, 0, 0, -2, 0 }, { 75355, 0, -2, 0, 0, 0, 0 }, { 75555, 0, 0, 0, -2, 0, -2 }, { 75565, 0, 0, 0, -2, 0, -1 }, { 75575, 0, 0, 0, -2, 0, 0 }, { 83655, 0, 1, 0, -2, -2, -2 }, { 85455, 0, -1, 0, -2, 0, -2 }, { 85465, 0, -1, 0, -2, 0, -1 }, { 93555, 0, 0, 0, -2, -2, -2 }, { 95355, 0, -2, 0, -2, 0, -2 }, // diurnal waves from table 6.5a
    { 125755, 1, 2, 0, 2, 0, 2 }, { 127555, 1, 0, 0, 2, 2, 2 }, { 135645, 1, 1, 0, 2, 0, 1 }, { 135655, 1, 1, 0, 2, 0, 2 }, { 137455, 1, -1, 0, 2, 2, 2 }, { 145545, 1, 0, 0, 2, 0, 1 }, { 145555, 1, 0, 0, 2, 0, 2 }, { 147555, 1, 0, 0, 0, 2, 0 }, { 153655, 1, 1, 0, 2, -2, 2 }, { 155445, 1, -1, 0, 2, 0, 1 }, { 155455, 1, -1, 0, 2, 0, 2 }, { 155655, 1, 1, 0, 0, 0, 0 }, { 155665, 1, 1, 0, 0, 0, 1 }, { 157455, 1, -1, 0, 0, 2, 0 }, { 157465, 1, -1, 0, 0, 2, 1 }, { 162556, 1, 0, 1, 2, -2, 2 }, { 163545, 1, 0, 0, 2, -2, 1 }, { 163555, 1, 0, 0, 2, -2, 2 }, { 164554, 1, 0, -1, 2, -2, 2 }, { 164556, 1, 0, 1, 0, 0, 0 }, { 165345, 1, -2, 0, 2, 0, 1 }, { 165535, 1, 0, 0, 0, 0, -2 }, { 165545, 1, 0, 0, 0, 0, -1 }, { 165555, 1, 0, 0, 0, 0, 0 }, { 165565, 1, 0, 0, 0, 0, 1 }, { 165575, 1, 0, 0, 0, 0, 2 }, { 166455, 1, -1, 0, 0, 1, 0 }, { 166544, 1, 0, -1, 0, 0, -1 }, { 166554, 1, 0, -1, 0, 0, 0 }, { 166556, 1, 0, 1, -2, 2, -2 }, { 166564, 1, 0, -1, 0, 0, 1 }, { 167355, 1, -2, 0, 0, 2, 0 }, { 167365, 1, -2, 0, 0, 2, 1 }, { 167555, 1, 0, 0, -2, 2, -2 }, { 167565, 1, 0, 0, -2, 2, -1 }, { 168554, 1, 0, -1, -2, 2, -2 }, { 173655, 1, 1, 0, 0, -2, 0 }, { 173665, 1, 1, 0, 0, -2, 1 }, { 175445, 1, -1, 0, 0, 0, -1 }, { 175455, 1, -1, 0, 0, 0, 0 }, { 175465, 1, -1, 0, 0, 0, 1 }, { 183555, 1, 0, 0, 0, -2, 0 }, { 185355, 1, -2, 0, 0, 0, 0 }, { 185555, 1, 0, 0, -2, 0, -2 }, { 185565, 1, 0, 0, -2, 0, -1 }, { 185575, 1, 0, 0, -2, 0, 0 }, { 195455, 1, -1, 0, -2, 0, -2 }, { 195465, 1, -1, 0, -2, 0, -1 }, // semi-diurnal waves from table 6.5.c
    { 245655, 2, 1, 0, 2, 0, 2 }, { 255555, 2, 0, 0, 2, 0, 2 } };
    for (int[] row : tab65) {
        OceanTidesWave wave = new OceanTidesWave(row[0], 0, 0, new double[1][1][4]);
        Assert.assertEquals(row[0], wave.getDoodson());
        Assert.assertEquals(row[1], ((Integer) cGammaField.get(wave)).intValue());
        Assert.assertEquals(-row[2], ((Integer) cLField.get(wave)).intValue());
        Assert.assertEquals(-row[3], ((Integer) cLPrimeField.get(wave)).intValue());
        Assert.assertEquals(-row[4], ((Integer) cFField.get(wave)).intValue());
        Assert.assertEquals(-row[5], ((Integer) cDField.get(wave)).intValue());
        Assert.assertEquals(-row[6], ((Integer) cOmegaField.get(wave)).intValue());
    }
}
Also used : Field(java.lang.reflect.Field) OceanTidesWave(org.orekit.forces.gravity.potential.OceanTidesWave) Test(org.junit.Test)

Example 2 with OceanTidesWave

use of org.orekit.forces.gravity.potential.OceanTidesWave in project Orekit by CS-SI.

the class OceanTidesField method onDate.

/**
 * {@inheritDoc}
 */
@Override
public NormalizedSphericalHarmonics onDate(final AbsoluteDate date) throws OrekitException {
    // computed Cnm and Snm coefficients
    final int rows = degree + 1;
    final double[][] cnm = new double[rows][];
    final double[][] snm = new double[rows][];
    for (int i = 0; i <= degree; ++i) {
        final int m = FastMath.min(i, order) + 1;
        cnm[i] = new double[m];
        snm[i] = new double[m];
    }
    final BodiesElements bodiesElements = arguments.evaluateAll(date);
    for (final OceanTidesWave wave : waves) {
        wave.addContribution(bodiesElements, cnm, snm);
    }
    if (poleTideFunction != null && degree > 1 && order > 0) {
        // add pole tide
        poleTide(date, cnm, snm);
    }
    return new TideHarmonics(date, cnm, snm);
}
Also used : BodiesElements(org.orekit.data.BodiesElements) OceanTidesWave(org.orekit.forces.gravity.potential.OceanTidesWave)

Example 3 with OceanTidesWave

use of org.orekit.forces.gravity.potential.OceanTidesWave 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;
}
Also used : FESCHatEpsilonReader(org.orekit.forces.gravity.potential.FESCHatEpsilonReader) OceanTidesWave(org.orekit.forces.gravity.potential.OceanTidesWave) ArrayList(java.util.ArrayList) AstronomicalAmplitudeReader(org.orekit.forces.gravity.potential.AstronomicalAmplitudeReader)

Example 4 with OceanTidesWave

use of org.orekit.forces.gravity.potential.OceanTidesWave in project Orekit by CS-SI.

the class OceanTidesFieldTest method testDeltaCnmSnm.

@Test
public void testDeltaCnmSnm() throws OrekitException {
    // this is an arbitrarily truncated model, limited to 4x4 and with only a few waves
    List<OceanTidesWave> waves = getWaves(4, 4, 55565, 56554, 85455, 135655, 273555);
    UT1Scale ut1 = TimeScalesFactory.getUT1(IERSConventions.IERS_2010, true);
    TimeScale utc = TimeScalesFactory.getUTC();
    AbsoluteDate date = new AbsoluteDate(2003, 5, 6, 13, 43, 32.125, utc);
    OceanTidesField tidesField = new OceanTidesField(Constants.EIGEN5C_EARTH_EQUATORIAL_RADIUS, Constants.EIGEN5C_EARTH_MU, waves, IERSConventions.IERS_2010.getNutationArguments(ut1), null);
    NormalizedSphericalHarmonics harmonics = tidesField.onDate(date);
    double[][] refDeltaCnm = new double[][] { { 0.0, 0.0, 0.0, 0.0, 0.0 }, { 0.0, 0.0, 0.0, 0.0, 0.0 }, { -4.812565797928061E-11, -4.1748378190052583E-11, 7.013273986245356E-11, 0.0, 0.0 }, { -2.5341227608443308E-11, 9.76515813742254E-11, -1.21931214469994E-10, 1.3179722429471184E-10, 0.0 }, { -2.7496974839179478E-11, 8.419627031293907E-11, 6.56546217101275E-11, -3.375298928713117E-11, -7.588006744166988E-11 } };
    double[][] refDeltaSnm = new double[][] { { 0.0, 0.0, 0.0, 0.0, 0.0 }, { 0.0, 0.0, 0.0, 0.0, 0.0 }, { -1.168129177701461E-10, 5.646187590518608E-12, 1.742233297668071E-10, 0.0, 0.0 }, { -6.586546350227345E-11, -8.032186864783105E-11, -3.118910148495339E-11, 1.0566857199592183E-10, 0.0 }, { 7.665313525684617E-11, 7.37884528812169E-11, -1.3085142873419844E-10, -1.5813709543115768E-10, 1.770903634801541E-10 } };
    for (int n = 0; n < refDeltaCnm.length; ++n) {
        double threshold = 4.0e-17;
        for (int m = 0; m <= n; ++m) {
            Assert.assertEquals(refDeltaCnm[n][m], harmonics.getNormalizedCnm(n, m), threshold);
            Assert.assertEquals(refDeltaSnm[n][m], harmonics.getNormalizedSnm(n, m), threshold);
        }
    }
}
Also used : UT1Scale(org.orekit.time.UT1Scale) OceanTidesWave(org.orekit.forces.gravity.potential.OceanTidesWave) NormalizedSphericalHarmonics(org.orekit.forces.gravity.potential.NormalizedSphericalHarmonicsProvider.NormalizedSphericalHarmonics) TimeScale(org.orekit.time.TimeScale) AbsoluteDate(org.orekit.time.AbsoluteDate) Test(org.junit.Test)

Aggregations

OceanTidesWave (org.orekit.forces.gravity.potential.OceanTidesWave)4 Test (org.junit.Test)2 Field (java.lang.reflect.Field)1 ArrayList (java.util.ArrayList)1 BodiesElements (org.orekit.data.BodiesElements)1 AstronomicalAmplitudeReader (org.orekit.forces.gravity.potential.AstronomicalAmplitudeReader)1 FESCHatEpsilonReader (org.orekit.forces.gravity.potential.FESCHatEpsilonReader)1 NormalizedSphericalHarmonics (org.orekit.forces.gravity.potential.NormalizedSphericalHarmonicsProvider.NormalizedSphericalHarmonics)1 AbsoluteDate (org.orekit.time.AbsoluteDate)1 TimeScale (org.orekit.time.TimeScale)1 UT1Scale (org.orekit.time.UT1Scale)1