Search in sources :

Example 36 with GeodeticPoint

use of org.orekit.bodies.GeodeticPoint in project Orekit by CS-SI.

the class TopocentricFrameTest method testDoppler.

@Test
public void testDoppler() throws OrekitException {
    // Surface point at latitude 45, longitude 5
    final GeodeticPoint point = new GeodeticPoint(FastMath.toRadians(45.), FastMath.toRadians(5.), 0.);
    final TopocentricFrame topoFrame = new TopocentricFrame(earthSpheric, point, "lon 5 lat 45");
    // Point at 30 deg longitude
    // ***************************
    final CircularOrbit orbit = new CircularOrbit(7178000.0, 0.5e-8, -0.5e-8, FastMath.toRadians(50.), FastMath.toRadians(120.), FastMath.toRadians(90.), PositionAngle.MEAN, FramesFactory.getEME2000(), date, mu);
    // Transform satellite position to position/velocity parameters in body frame
    final Transform eme2000ToItrf = FramesFactory.getEME2000().getTransformTo(earthSpheric.getBodyFrame(), date);
    final PVCoordinates pvSatItrf = eme2000ToItrf.transformPVCoordinates(orbit.getPVCoordinates());
    // Compute range rate directly
    // ********************************************
    final double dop = topoFrame.getRangeRate(pvSatItrf, earthSpheric.getBodyFrame(), date);
    // Compare to finite difference computation (2 points)
    // *****************************************************
    final double dt = 0.1;
    KeplerianPropagator extrapolator = new KeplerianPropagator(orbit);
    // Extrapolate satellite position a short while after reference date
    AbsoluteDate dateP = date.shiftedBy(dt);
    Transform j2000ToItrfP = FramesFactory.getEME2000().getTransformTo(earthSpheric.getBodyFrame(), dateP);
    SpacecraftState orbitP = extrapolator.propagate(dateP);
    Vector3D satPointGeoP = j2000ToItrfP.transformPVCoordinates(orbitP.getPVCoordinates()).getPosition();
    // Retropolate satellite position a short while before reference date
    AbsoluteDate dateM = date.shiftedBy(-dt);
    Transform j2000ToItrfM = FramesFactory.getEME2000().getTransformTo(earthSpheric.getBodyFrame(), dateM);
    SpacecraftState orbitM = extrapolator.propagate(dateM);
    Vector3D satPointGeoM = j2000ToItrfM.transformPVCoordinates(orbitM.getPVCoordinates()).getPosition();
    // Compute ranges at both instants
    double rangeP = topoFrame.getRange(satPointGeoP, earthSpheric.getBodyFrame(), dateP);
    double rangeM = topoFrame.getRange(satPointGeoM, earthSpheric.getBodyFrame(), dateM);
    final double dopRef2 = (rangeP - rangeM) / (2. * dt);
    Assert.assertEquals(dopRef2, dop, 1.e-3);
}
Also used : KeplerianPropagator(org.orekit.propagation.analytical.KeplerianPropagator) SpacecraftState(org.orekit.propagation.SpacecraftState) CircularOrbit(org.orekit.orbits.CircularOrbit) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) PVCoordinates(org.orekit.utils.PVCoordinates) GeodeticPoint(org.orekit.bodies.GeodeticPoint) AbsoluteDate(org.orekit.time.AbsoluteDate) Test(org.junit.Test)

Example 37 with GeodeticPoint

use of org.orekit.bodies.GeodeticPoint in project Orekit by CS-SI.

the class DOPComputerTest method setUpBeforeClass.

@BeforeClass
public static void setUpBeforeClass() throws OrekitException {
    // Sets the root of data to read
    Utils.setDataRoot("gnss");
    // Defines the Earth shape
    earth = new OneAxisEllipsoid(Constants.WGS84_EARTH_EQUATORIAL_RADIUS, Constants.WGS84_EARTH_FLATTENING, FramesFactory.getITRF(IERSConventions.IERS_2010, true));
    // Defines the location where to compute the DOP
    location = new GeodeticPoint(FastMath.toRadians(43.6), FastMath.toRadians(1.45), 0.);
}
Also used : OneAxisEllipsoid(org.orekit.bodies.OneAxisEllipsoid) GeodeticPoint(org.orekit.bodies.GeodeticPoint) BeforeClass(org.junit.BeforeClass)

Example 38 with GeodeticPoint

use of org.orekit.bodies.GeodeticPoint in project Orekit by CS-SI.

the class KlobucharModelTest method compareExpectedValue.

@Test
public void compareExpectedValue() throws IllegalArgumentException, OrekitException {
    final double latitude = FastMath.toRadians(40);
    final double longitude = FastMath.toRadians(-100);
    final double altitude = 0.;
    final double elevation = 20.;
    final double azimuth = 210.;
    final AbsoluteDate date = new AbsoluteDate(new DateTimeComponents(2000, 1, 1, 20, 45, 0), utc);
    final GeodeticPoint geo = new GeodeticPoint(latitude, longitude, altitude);
    final double delayMeters = model.pathDelay(date, geo, FastMath.toRadians(elevation), FastMath.toRadians(azimuth));
    Assert.assertEquals(23.784, delayMeters, 0.001);
}
Also used : GeodeticPoint(org.orekit.bodies.GeodeticPoint) AbsoluteDate(org.orekit.time.AbsoluteDate) DateTimeComponents(org.orekit.time.DateTimeComponents) Test(org.junit.Test)

Example 39 with GeodeticPoint

use of org.orekit.bodies.GeodeticPoint in project Orekit by CS-SI.

the class AlongTrackAimingTest method testTooSouthernLatitude.

@Test
public void testTooSouthernLatitude() throws OrekitException {
    final AlongTrackAiming tileAiming = new AlongTrackAiming(ellipsoid, orbit, true);
    try {
        final GeodeticPoint gp = new GeodeticPoint(FastMath.toRadians(-51.0), 0.0, 0.0);
        tileAiming.alongTileDirection(ellipsoid.transform(gp), gp);
        Assert.fail("an exception should have been thrown");
    } catch (OrekitException oe) {
        Assert.assertEquals(OrekitMessages.OUT_OF_RANGE_LATITUDE, oe.getSpecifier());
        Assert.assertEquals(-51.0, (Double) (oe.getParts()[0]), 1.0e-10);
    }
}
Also used : OrekitException(org.orekit.errors.OrekitException) GeodeticPoint(org.orekit.bodies.GeodeticPoint) Test(org.junit.Test)

Example 40 with GeodeticPoint

use of org.orekit.bodies.GeodeticPoint in project Orekit by CS-SI.

the class AlongTrackAimingTest method testDescending.

@Test
public void testDescending() throws OrekitException {
    final AlongTrackAiming tileAiming = new AlongTrackAiming(ellipsoid, orbit, false);
    for (double latitude = FastMath.toRadians(-50.21); latitude < FastMath.toRadians(50.21); latitude += 0.001) {
        final GeodeticPoint gp = new GeodeticPoint(latitude, 0.0, 0.0);
        final Vector3D aiming = tileAiming.alongTileDirection(ellipsoid.transform(gp), gp);
        Assert.assertEquals(1.0, aiming.getNorm(), 1.0e-12);
        final double elevation = 0.5 * FastMath.PI - Vector3D.angle(aiming, gp.getZenith());
        final double azimuth = MathUtils.normalizeAngle(FastMath.atan2(Vector3D.dotProduct(aiming, gp.getEast()), Vector3D.dotProduct(aiming, gp.getNorth())), FastMath.PI);
        Assert.assertEquals(0.0, FastMath.toDegrees(elevation), 1.0e-6);
        if (FastMath.abs(FastMath.toDegrees(latitude)) > 49.7) {
            Assert.assertTrue(FastMath.toDegrees(azimuth) < 99.0);
        }
        if (FastMath.abs(FastMath.toDegrees(latitude)) < 5.0) {
            Assert.assertTrue(FastMath.toDegrees(azimuth) > 143);
        }
        Assert.assertTrue(FastMath.toDegrees(azimuth) < 143.3);
    }
}
Also used : Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) GeodeticPoint(org.orekit.bodies.GeodeticPoint) Test(org.junit.Test)

Aggregations

GeodeticPoint (org.orekit.bodies.GeodeticPoint)133 Test (org.junit.Test)78 Vector3D (org.hipparchus.geometry.euclidean.threed.Vector3D)67 OneAxisEllipsoid (org.orekit.bodies.OneAxisEllipsoid)61 AbsoluteDate (org.orekit.time.AbsoluteDate)45 TopocentricFrame (org.orekit.frames.TopocentricFrame)35 Frame (org.orekit.frames.Frame)34 KeplerianOrbit (org.orekit.orbits.KeplerianOrbit)27 SpacecraftState (org.orekit.propagation.SpacecraftState)26 Propagator (org.orekit.propagation.Propagator)24 OrekitException (org.orekit.errors.OrekitException)23 KeplerianPropagator (org.orekit.propagation.analytical.KeplerianPropagator)23 FieldVector3D (org.hipparchus.geometry.euclidean.threed.FieldVector3D)22 PVCoordinates (org.orekit.utils.PVCoordinates)20 FieldAbsoluteDate (org.orekit.time.FieldAbsoluteDate)19 BodyShape (org.orekit.bodies.BodyShape)17 Orbit (org.orekit.orbits.Orbit)15 Rotation (org.hipparchus.geometry.euclidean.threed.Rotation)13 ArrayList (java.util.ArrayList)12 FieldGeodeticPoint (org.orekit.bodies.FieldGeodeticPoint)12