Search in sources :

Example 1 with TidalDisplacement

use of org.orekit.models.earth.displacement.TidalDisplacement in project Orekit by CS-SI.

the class EstimationTestUtils method eccentricContext.

public static Context eccentricContext(final String dataRoot) throws OrekitException {
    Utils.setDataRoot(dataRoot);
    Context context = new Context();
    context.conventions = IERSConventions.IERS_2010;
    context.earth = new OneAxisEllipsoid(Constants.WGS84_EARTH_EQUATORIAL_RADIUS, Constants.WGS84_EARTH_FLATTENING, FramesFactory.getITRF(context.conventions, true));
    context.sun = CelestialBodyFactory.getSun();
    context.moon = CelestialBodyFactory.getMoon();
    context.radiationSensitive = new IsotropicRadiationClassicalConvention(2.0, 0.2, 0.8);
    context.dragSensitive = new IsotropicDrag(2.0, 1.2);
    final EOPHistory eopHistory = FramesFactory.getEOPHistory(context.conventions, true);
    context.utc = TimeScalesFactory.getUTC();
    context.ut1 = TimeScalesFactory.getUT1(eopHistory);
    context.displacements = new StationDisplacement[] { new TidalDisplacement(Constants.EIGEN5C_EARTH_EQUATORIAL_RADIUS, Constants.JPL_SSD_SUN_EARTH_PLUS_MOON_MASS_RATIO, Constants.JPL_SSD_EARTH_MOON_MASS_RATIO, context.sun, context.moon, context.conventions, false) };
    GravityFieldFactory.addPotentialCoefficientsReader(new GRGSFormatReader("grim4s4_gr", true));
    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));
    context.gravity = GravityFieldFactory.getNormalizedProvider(20, 20);
    context.initialOrbit = new KeplerianOrbit(15000000.0, 0.125, 1.25, 0.250, 1.375, 0.0625, PositionAngle.TRUE, FramesFactory.getEME2000(), new AbsoluteDate(2000, 2, 24, 11, 35, 47.0, context.utc), context.gravity.getMu());
    context.stations = // context.createStation(-18.59146, -173.98363,   76.0, "Leimatu`a"),
    Arrays.asList(context.createStation(-53.05388, -75.01551, 1750.0, "Isla Desolación"), context.createStation(62.29639, -7.01250, 880.0, "Slættaratindur"));
    // Turn-around range stations
    // Map entry = master station
    // Map value = slave station associated
    context.TARstations = new HashMap<GroundStation, GroundStation>();
    context.TARstations.put(context.createStation(-53.05388, -75.01551, 1750.0, "Isla Desolación"), context.createStation(-54.815833, -68.317778, 6.0, "Ushuaïa"));
    context.TARstations.put(context.createStation(62.29639, -7.01250, 880.0, "Slættaratindur"), context.createStation(61.405833, -6.705278, 470.0, "Sumba"));
    return context;
}
Also used : OneAxisEllipsoid(org.orekit.bodies.OneAxisEllipsoid) IsotropicDrag(org.orekit.forces.drag.IsotropicDrag) GroundStation(org.orekit.estimation.measurements.GroundStation) EOPHistory(org.orekit.frames.EOPHistory) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate) AbsoluteDate(org.orekit.time.AbsoluteDate) GRGSFormatReader(org.orekit.forces.gravity.potential.GRGSFormatReader) FESCHatEpsilonReader(org.orekit.forces.gravity.potential.FESCHatEpsilonReader) IsotropicRadiationClassicalConvention(org.orekit.forces.radiation.IsotropicRadiationClassicalConvention) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) AstronomicalAmplitudeReader(org.orekit.forces.gravity.potential.AstronomicalAmplitudeReader) TidalDisplacement(org.orekit.models.earth.displacement.TidalDisplacement)

Example 2 with TidalDisplacement

use of org.orekit.models.earth.displacement.TidalDisplacement in project Orekit by CS-SI.

the class TidalDisplacementTest method doTestDehant.

private void doTestDehant(final IERSConventions conventions, final boolean removePermanentDeformation, final boolean replaceModels, final double expectedDx, final double expectedDy, final double expectedDz, final double tolerance) throws OrekitException {
    Frame itrf = FramesFactory.getITRF(conventions, false);
    TimeScale ut1 = TimeScalesFactory.getUT1(conventions, false);
    final double re;
    final double sunEarthSystemMassRatio;
    final double earthMoonMassRatio;
    if (replaceModels) {
        // constants consistent with DEHANTTIDEINEL.F reference program
        // available at <ftp://tai.bipm.org/iers/conv2010/chapter7/dehanttideinel/>
        // and Copyright (C) 2008 IERS Conventions Center
        re = 6378136.6;
        final double massRatioSun = 332946.0482;
        final double massRatioMoon = 0.0123000371;
        sunEarthSystemMassRatio = massRatioSun * (1.0 / (1.0 + massRatioMoon));
        earthMoonMassRatio = 1.0 / massRatioMoon;
    } else {
        // constants consistent with IERS and JPL
        re = Constants.EIGEN5C_EARTH_EQUATORIAL_RADIUS;
        sunEarthSystemMassRatio = Constants.JPL_SSD_SUN_EARTH_PLUS_MOON_MASS_RATIO;
        earthMoonMassRatio = Constants.JPL_SSD_EARTH_MOON_MASS_RATIO;
    }
    // fake providers generating only the positions from the reference program test
    PVCoordinatesProvider fakeSun = (date, frame) -> new TimeStampedPVCoordinates(date, new Vector3D(137859926952.015, 54228127881.435, 23509422341.6960), Vector3D.ZERO, Vector3D.ZERO);
    PVCoordinatesProvider fakeMoon = (date, frame) -> new TimeStampedPVCoordinates(date, new Vector3D(-179996231.920342, -312468450.131567, -169288918.592160), Vector3D.ZERO, Vector3D.ZERO);
    TidalDisplacement td = new TidalDisplacement(re, sunEarthSystemMassRatio, earthMoonMassRatio, fakeSun, fakeMoon, conventions, removePermanentDeformation);
    FundamentalNutationArguments arguments = null;
    if (replaceModels) {
        try {
            // we override the official IERS conventions 2010 arguments with fake arguments matching DEHANTTIDEINEL.F code
            String regularArguments = "/assets/org/orekit/IERS-conventions/2010/nutation-arguments.txt";
            arguments = new FundamentalNutationArguments(conventions, ut1, IERSConventions.class.getResourceAsStream(regularArguments), regularArguments) {

                private static final long serialVersionUID = 20170913L;

                @Override
                public BodiesElements evaluateAll(final AbsoluteDate date) {
                    BodiesElements base = super.evaluateAll(date);
                    double fhr = date.getComponents(ut1).getTime().getSecondsInUTCDay() / 3600.0;
                    double t = base.getTC();
                    // Doodson fundamental arguments as per DEHANTTIDEINEL.F code
                    double s = 218.31664563 + (481267.88194 + (-0.0014663889 + (0.00000185139) * t) * t) * t;
                    double tau = fhr * 15 + 280.4606184 + (36000.7700536 + (0.00038793 + (-0.0000000258) * t) * t) * t - s;
                    double pr = (1.396971278 + (0.000308889 + (0.000000021 + (0.000000007) * t) * t) * t) * t;
                    double h = 280.46645 + (36000.7697489 + (0.00030322222 + (0.000000020 + (-0.00000000654) * t) * t) * t) * t;
                    double p = 83.35324312 + (4069.01363525 + (-0.01032172222 + (-0.0000124991 + (0.00000005263) * t) * t) * t) * t;
                    double zns = 234.95544499 + (1934.13626197 + (-0.00207561111 + (-0.00000213944 + (0.00000001650) * t) * t) * t) * t;
                    double ps = 282.93734098 + (1.71945766667 + (0.00045688889 + (-0.00000001778 + (-0.00000000334) * t) * t) * t) * t;
                    s += pr;
                    // rebuild Delaunay arguments from Doodson arguments, ignoring derivatives
                    return new BodiesElements(date, base.getTC(), FastMath.toRadians(s + tau), 0.0, FastMath.toRadians(s - p), 0.0, FastMath.toRadians(h - ps), 0.0, FastMath.toRadians(s + zns), 0.0, FastMath.toRadians(s - h), 0.0, FastMath.toRadians(-zns), 0.0, base.getLMe(), 0.0, base.getLVe(), 0.0, base.getLE(), 0.0, base.getLMa(), 0.0, base.getLJu(), 0.0, base.getLSa(), 0.0, base.getLUr(), 0.0, base.getLNe(), 0.0, base.getPa(), 0.0);
                }
            };
            // we override the official IERS conventions 2010 tides displacements with tides displacements matching DEHANTTIDEINEL.F code
            String table73a = "/tides/tab7.3a-Dehant.txt";
            Field diurnalCorrectionField = td.getClass().getDeclaredField("frequencyCorrectionDiurnal");
            diurnalCorrectionField.setAccessible(true);
            Method diurnalCorrectionGetter = IERSConventions.class.getDeclaredMethod("getTidalDisplacementFrequencyCorrectionDiurnal", String.class, Integer.TYPE, Integer.TYPE, Integer.TYPE, Integer.TYPE, Integer.TYPE);
            diurnalCorrectionGetter.setAccessible(true);
            diurnalCorrectionField.set(td, diurnalCorrectionGetter.invoke(null, table73a, 18, 15, 16, 17, 18));
        } catch (SecurityException | NoSuchMethodException | NoSuchFieldException | InvocationTargetException | IllegalArgumentException | IllegalAccessException e) {
            Assert.fail(e.getLocalizedMessage());
        }
    } else {
        arguments = conventions.getNutationArguments(ut1);
    }
    Vector3D fundamentalStationWettzell = new Vector3D(4075578.385, 931852.890, 4801570.154);
    AbsoluteDate date = new AbsoluteDate(2009, 4, 13, 0, 0, 0.0, ut1);
    Vector3D displacement = td.displacement(arguments.evaluateAll(date), itrf, fundamentalStationWettzell);
    Assert.assertEquals(expectedDx, displacement.getX(), tolerance);
    Assert.assertEquals(expectedDy, displacement.getY(), tolerance);
    Assert.assertEquals(expectedDz, displacement.getZ(), tolerance);
}
Also used : Constants(org.orekit.utils.Constants) TimeStampedPVCoordinates(org.orekit.utils.TimeStampedPVCoordinates) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) FramesFactory(org.orekit.frames.FramesFactory) PVCoordinatesProvider(org.orekit.utils.PVCoordinatesProvider) Frame(org.orekit.frames.Frame) TimeScale(org.orekit.time.TimeScale) Test(org.junit.Test) IERSConventions(org.orekit.utils.IERSConventions) Field(java.lang.reflect.Field) InvocationTargetException(java.lang.reflect.InvocationTargetException) TidalDisplacement(org.orekit.models.earth.displacement.TidalDisplacement) OrekitException(org.orekit.errors.OrekitException) TimeScalesFactory(org.orekit.time.TimeScalesFactory) BodiesElements(org.orekit.data.BodiesElements) FastMath(org.hipparchus.util.FastMath) Assert(org.junit.Assert) Method(java.lang.reflect.Method) FundamentalNutationArguments(org.orekit.data.FundamentalNutationArguments) Utils(org.orekit.Utils) Before(org.junit.Before) AbsoluteDate(org.orekit.time.AbsoluteDate) FundamentalNutationArguments(org.orekit.data.FundamentalNutationArguments) Frame(org.orekit.frames.Frame) Method(java.lang.reflect.Method) TimeStampedPVCoordinates(org.orekit.utils.TimeStampedPVCoordinates) TimeScale(org.orekit.time.TimeScale) AbsoluteDate(org.orekit.time.AbsoluteDate) InvocationTargetException(java.lang.reflect.InvocationTargetException) Field(java.lang.reflect.Field) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) BodiesElements(org.orekit.data.BodiesElements) PVCoordinatesProvider(org.orekit.utils.PVCoordinatesProvider) TidalDisplacement(org.orekit.models.earth.displacement.TidalDisplacement)

Aggregations

TidalDisplacement (org.orekit.models.earth.displacement.TidalDisplacement)2 AbsoluteDate (org.orekit.time.AbsoluteDate)2 Field (java.lang.reflect.Field)1 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 Method (java.lang.reflect.Method)1 Vector3D (org.hipparchus.geometry.euclidean.threed.Vector3D)1 FastMath (org.hipparchus.util.FastMath)1 Assert (org.junit.Assert)1 Before (org.junit.Before)1 Test (org.junit.Test)1 Utils (org.orekit.Utils)1 OneAxisEllipsoid (org.orekit.bodies.OneAxisEllipsoid)1 BodiesElements (org.orekit.data.BodiesElements)1 FundamentalNutationArguments (org.orekit.data.FundamentalNutationArguments)1 OrekitException (org.orekit.errors.OrekitException)1 GroundStation (org.orekit.estimation.measurements.GroundStation)1 IsotropicDrag (org.orekit.forces.drag.IsotropicDrag)1 AstronomicalAmplitudeReader (org.orekit.forces.gravity.potential.AstronomicalAmplitudeReader)1 FESCHatEpsilonReader (org.orekit.forces.gravity.potential.FESCHatEpsilonReader)1 GRGSFormatReader (org.orekit.forces.gravity.potential.GRGSFormatReader)1