Search in sources :

Example 1 with FESCHatEpsilonReader

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

the class OceanTidesTest method testDefaultInterpolation.

@Test
public void testDefaultInterpolation() throws OrekitException {
    IERSConventions conventions = IERSConventions.IERS_2010;
    Frame eme2000 = FramesFactory.getEME2000();
    Frame itrf = FramesFactory.getITRF(conventions, true);
    TimeScale utc = TimeScalesFactory.getUTC();
    UT1Scale ut1 = TimeScalesFactory.getUT1(conventions, 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));
    NormalizedSphericalHarmonicsProvider gravityField = GravityFieldFactory.getConstantNormalizedProvider(5, 5);
    // initialization
    AbsoluteDate date = new AbsoluteDate(1970, 07, 01, 13, 59, 27.816, utc);
    Orbit orbit = new KeplerianOrbit(7201009.7124401, 1e-3, FastMath.toRadians(98.7), FastMath.toRadians(93.0), FastMath.toRadians(15.0 * 22.5), 0, PositionAngle.MEAN, eme2000, date, gravityField.getMu());
    AbsoluteDate target = date.shiftedBy(7 * Constants.JULIAN_DAY);
    ForceModel hf = new HolmesFeatherstoneAttractionModel(itrf, gravityField);
    SpacecraftState raw = propagate(orbit, target, hf, new OceanTides(itrf, gravityField.getAe(), gravityField.getMu(), true, Double.NaN, -1, 6, 6, conventions, ut1));
    SpacecraftState interpolated = propagate(orbit, target, hf, new OceanTides(itrf, gravityField.getAe(), gravityField.getMu(), 6, 6, IERSConventions.IERS_2010, ut1));
    Assert.assertEquals(0.0, Vector3D.distance(raw.getPVCoordinates().getPosition(), interpolated.getPVCoordinates().getPosition()), // threshold would be 3.4e-5 for 30 days propagation
    9.9e-6);
}
Also used : Frame(org.orekit.frames.Frame) Orbit(org.orekit.orbits.Orbit) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) ForceModel(org.orekit.forces.ForceModel) IERSConventions(org.orekit.utils.IERSConventions) TimeScale(org.orekit.time.TimeScale) AbsoluteDate(org.orekit.time.AbsoluteDate) SpacecraftState(org.orekit.propagation.SpacecraftState) UT1Scale(org.orekit.time.UT1Scale) FESCHatEpsilonReader(org.orekit.forces.gravity.potential.FESCHatEpsilonReader) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) NormalizedSphericalHarmonicsProvider(org.orekit.forces.gravity.potential.NormalizedSphericalHarmonicsProvider) AstronomicalAmplitudeReader(org.orekit.forces.gravity.potential.AstronomicalAmplitudeReader) Test(org.junit.Test)

Example 2 with FESCHatEpsilonReader

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

the class OceanTidesTest method testNoSetParameter.

@Test
public void testNoSetParameter() 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.assertEquals(1, fm.getParametersDrivers().length);
    try {
        fm.getParameterDriver("unknown").setValue(0.0);
        Assert.fail("an exception should have been thrown");
    } catch (OrekitException miae) {
        Assert.assertEquals(OrekitMessages.UNSUPPORTED_PARAMETER_NAME, miae.getSpecifier());
    }
}
Also used : FESCHatEpsilonReader(org.orekit.forces.gravity.potential.FESCHatEpsilonReader) ForceModel(org.orekit.forces.ForceModel) OrekitException(org.orekit.errors.OrekitException) AstronomicalAmplitudeReader(org.orekit.forces.gravity.potential.AstronomicalAmplitudeReader) Test(org.junit.Test)

Example 3 with FESCHatEpsilonReader

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

the class EstimationTestUtils method geoStationnaryContext.

public static Context geoStationnaryContext(final String dataRoot) throws OrekitException {
    Utils.setDataRoot(dataRoot);
    Context context = new Context();
    context.conventions = IERSConventions.IERS_2010;
    context.utc = TimeScalesFactory.getUTC();
    context.ut1 = TimeScalesFactory.getUT1(context.conventions, true);
    context.displacements = new StationDisplacement[0];
    String Myframename = "MyEarthFrame";
    final AbsoluteDate datedef = new AbsoluteDate(2000, 1, 1, 12, 0, 0.0, context.utc);
    final double omega = Constants.WGS84_EARTH_ANGULAR_VELOCITY;
    final Vector3D rotationRate = new Vector3D(0.0, 0.0, omega);
    TransformProvider MyEarthFrame = new TransformProvider() {

        private static final long serialVersionUID = 1L;

        public Transform getTransform(final AbsoluteDate date) {
            final double rotationduration = date.durationFrom(datedef);
            final Vector3D alpharot = new Vector3D(rotationduration, rotationRate);
            final Rotation rotation = new Rotation(Vector3D.PLUS_K, -alpharot.getZ(), RotationConvention.VECTOR_OPERATOR);
            return new Transform(date, rotation, rotationRate);
        }

        public <T extends RealFieldElement<T>> FieldTransform<T> getTransform(final FieldAbsoluteDate<T> date) {
            final T rotationduration = date.durationFrom(datedef);
            final FieldVector3D<T> alpharot = new FieldVector3D<>(rotationduration, rotationRate);
            final FieldRotation<T> rotation = new FieldRotation<>(FieldVector3D.getPlusK(date.getField()), alpharot.getZ().negate(), RotationConvention.VECTOR_OPERATOR);
            return new FieldTransform<>(date, rotation, new FieldVector3D<>(date.getField(), rotationRate));
        }
    };
    Frame FrameTest = new Frame(FramesFactory.getEME2000(), MyEarthFrame, Myframename, true);
    // Earth is spherical, rotating in one sidereal day
    context.earth = new OneAxisEllipsoid(Constants.WGS84_EARTH_EQUATORIAL_RADIUS, 0.0, FrameTest);
    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);
    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);
    // semimajor axis for a geostationnary satellite
    double da = FastMath.cbrt(context.gravity.getMu() / (omega * omega));
    // context.stations = Arrays.asList(context.createStation(  0.0,  0.0, 0.0, "Lat0_Long0"),
    // context.createStation( 62.29639,   -7.01250,  880.0, "Slættaratindur")
    // );
    context.stations = Arrays.asList(context.createStation(0.0, 0.0, 0.0, "Lat0_Long0"));
    // Station position & velocity in EME2000
    final Vector3D geovelocity = new Vector3D(0., 0., 0.);
    // Compute the frames transformation from station frame to EME2000
    Transform topoToEME = context.stations.get(0).getBaseFrame().getTransformTo(FramesFactory.getEME2000(), new AbsoluteDate(2000, 1, 1, 12, 0, 0.0, context.utc));
    // Station position in EME2000 at reference date
    Vector3D stationPositionEME = topoToEME.transformPosition(Vector3D.ZERO);
    // Satellite position and velocity in Station Frame
    final Vector3D sat_pos = new Vector3D(0., 0., da - stationPositionEME.getNorm());
    final Vector3D acceleration = new Vector3D(-context.gravity.getMu(), sat_pos);
    final PVCoordinates pv_sat_topo = new PVCoordinates(sat_pos, geovelocity, acceleration);
    // satellite position in EME2000
    final PVCoordinates pv_sat_iner = topoToEME.transformPVCoordinates(pv_sat_topo);
    // Geo-stationary Satellite Orbit, tightly above the station (l0-L0)
    context.initialOrbit = new KeplerianOrbit(pv_sat_iner, FramesFactory.getEME2000(), new AbsoluteDate(2000, 1, 1, 12, 0, 0.0, context.utc), context.gravity.getMu());
    context.stations = Arrays.asList(context.createStation(10.0, 45.0, 0.0, "Lat10_Long45"));
    // Turn-around range stations
    // Map entry = master station
    // Map value = slave station associated
    context.TARstations = new HashMap<GroundStation, GroundStation>();
    context.TARstations.put(context.createStation(41.977, 13.600, 671.354, "Fucino"), context.createStation(43.604, 1.444, 263.0, "Toulouse"));
    context.TARstations.put(context.createStation(49.867, 8.65, 144.0, "Darmstadt"), context.createStation(-25.885, 27.707, 1566.633, "Pretoria"));
    return context;
}
Also used : Frame(org.orekit.frames.Frame) OneAxisEllipsoid(org.orekit.bodies.OneAxisEllipsoid) IsotropicDrag(org.orekit.forces.drag.IsotropicDrag) PVCoordinates(org.orekit.utils.PVCoordinates) FieldVector3D(org.hipparchus.geometry.euclidean.threed.FieldVector3D) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate) AbsoluteDate(org.orekit.time.AbsoluteDate) GRGSFormatReader(org.orekit.forces.gravity.potential.GRGSFormatReader) FieldVector3D(org.hipparchus.geometry.euclidean.threed.FieldVector3D) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) TransformProvider(org.orekit.frames.TransformProvider) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) AstronomicalAmplitudeReader(org.orekit.forces.gravity.potential.AstronomicalAmplitudeReader) GroundStation(org.orekit.estimation.measurements.GroundStation) RealFieldElement(org.hipparchus.RealFieldElement) FieldTransform(org.orekit.frames.FieldTransform) Rotation(org.hipparchus.geometry.euclidean.threed.Rotation) FieldRotation(org.hipparchus.geometry.euclidean.threed.FieldRotation) FieldRotation(org.hipparchus.geometry.euclidean.threed.FieldRotation) FESCHatEpsilonReader(org.orekit.forces.gravity.potential.FESCHatEpsilonReader) IsotropicRadiationClassicalConvention(org.orekit.forces.radiation.IsotropicRadiationClassicalConvention) FieldTransform(org.orekit.frames.FieldTransform) Transform(org.orekit.frames.Transform) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate)

Example 4 with FESCHatEpsilonReader

use of org.orekit.forces.gravity.potential.FESCHatEpsilonReader 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 5 with FESCHatEpsilonReader

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

the class OceanTidesTest method doTestTideEffect.

private void doTestTideEffect(IERSConventions conventions, double delta1, double delta2) throws OrekitException {
    Frame eme2000 = FramesFactory.getEME2000();
    Frame itrf = FramesFactory.getITRF(conventions, true);
    TimeScale utc = TimeScalesFactory.getUTC();
    UT1Scale ut1 = TimeScalesFactory.getUT1(conventions, 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));
    NormalizedSphericalHarmonicsProvider gravityField = GravityFieldFactory.getConstantNormalizedProvider(5, 5);
    // initialization
    AbsoluteDate date = new AbsoluteDate(2003, 07, 01, 13, 59, 27.816, utc);
    Orbit orbit = new KeplerianOrbit(7201009.7124401, 1e-3, FastMath.toRadians(98.7), FastMath.toRadians(93.0), FastMath.toRadians(15.0 * 22.5), 0, PositionAngle.MEAN, eme2000, date, gravityField.getMu());
    AbsoluteDate target = date.shiftedBy(7 * Constants.JULIAN_DAY);
    ForceModel hf = new HolmesFeatherstoneAttractionModel(itrf, gravityField);
    SpacecraftState noTides = propagate(orbit, target, hf);
    SpacecraftState oceanTidesNoPoleTide = propagate(orbit, target, hf, new OceanTides(itrf, gravityField.getAe(), gravityField.getMu(), false, SolidTides.DEFAULT_STEP, SolidTides.DEFAULT_POINTS, 6, 6, conventions, ut1));
    SpacecraftState oceanTidesPoleTide = propagate(orbit, target, hf, new OceanTides(itrf, gravityField.getAe(), gravityField.getMu(), true, SolidTides.DEFAULT_STEP, SolidTides.DEFAULT_POINTS, 6, 6, conventions, ut1));
    Assert.assertEquals(delta1, Vector3D.distance(noTides.getPVCoordinates().getPosition(), oceanTidesNoPoleTide.getPVCoordinates().getPosition()), 0.01);
    Assert.assertEquals(delta2, Vector3D.distance(oceanTidesNoPoleTide.getPVCoordinates().getPosition(), oceanTidesPoleTide.getPVCoordinates().getPosition()), 0.01);
}
Also used : Frame(org.orekit.frames.Frame) Orbit(org.orekit.orbits.Orbit) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) ForceModel(org.orekit.forces.ForceModel) TimeScale(org.orekit.time.TimeScale) AbsoluteDate(org.orekit.time.AbsoluteDate) SpacecraftState(org.orekit.propagation.SpacecraftState) UT1Scale(org.orekit.time.UT1Scale) FESCHatEpsilonReader(org.orekit.forces.gravity.potential.FESCHatEpsilonReader) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) NormalizedSphericalHarmonicsProvider(org.orekit.forces.gravity.potential.NormalizedSphericalHarmonicsProvider) AstronomicalAmplitudeReader(org.orekit.forces.gravity.potential.AstronomicalAmplitudeReader)

Aggregations

AstronomicalAmplitudeReader (org.orekit.forces.gravity.potential.AstronomicalAmplitudeReader)7 FESCHatEpsilonReader (org.orekit.forces.gravity.potential.FESCHatEpsilonReader)7 ForceModel (org.orekit.forces.ForceModel)4 KeplerianOrbit (org.orekit.orbits.KeplerianOrbit)4 AbsoluteDate (org.orekit.time.AbsoluteDate)4 Test (org.junit.Test)3 Frame (org.orekit.frames.Frame)3 OneAxisEllipsoid (org.orekit.bodies.OneAxisEllipsoid)2 OrekitException (org.orekit.errors.OrekitException)2 GroundStation (org.orekit.estimation.measurements.GroundStation)2 IsotropicDrag (org.orekit.forces.drag.IsotropicDrag)2 GRGSFormatReader (org.orekit.forces.gravity.potential.GRGSFormatReader)2 NormalizedSphericalHarmonicsProvider (org.orekit.forces.gravity.potential.NormalizedSphericalHarmonicsProvider)2 IsotropicRadiationClassicalConvention (org.orekit.forces.radiation.IsotropicRadiationClassicalConvention)2 Orbit (org.orekit.orbits.Orbit)2 SpacecraftState (org.orekit.propagation.SpacecraftState)2 FieldAbsoluteDate (org.orekit.time.FieldAbsoluteDate)2 TimeScale (org.orekit.time.TimeScale)2 UT1Scale (org.orekit.time.UT1Scale)2 ArrayList (java.util.ArrayList)1