Search in sources :

Example 31 with TopocentricFrame

use of org.orekit.frames.TopocentricFrame in project Orekit by CS-SI.

the class EcksteinHechlerPropagatorTest method setting.

@Test
public void setting() throws OrekitException {
    final KeplerianOrbit orbit = new KeplerianOrbit(7.8e6, 0.032, 0.4, 0.1, 0.2, 0.3, PositionAngle.TRUE, FramesFactory.getEME2000(), AbsoluteDate.J2000_EPOCH, 3.986004415e14);
    EcksteinHechlerPropagator propagator = new EcksteinHechlerPropagator(orbit, provider);
    final OneAxisEllipsoid earthShape = new OneAxisEllipsoid(6378136.460, 1 / 298.257222101, FramesFactory.getITRF(IERSConventions.IERS_2010, true));
    final TopocentricFrame topo = new TopocentricFrame(earthShape, new GeodeticPoint(0.389, -2.962, 0), null);
    ElevationDetector detector = new ElevationDetector(60, 1.0e-9, topo).withConstantElevation(0.09);
    Assert.assertEquals(0.09, detector.getMinElevation(), 1.0e-12);
    Assert.assertTrue(topo == detector.getTopocentricFrame());
    propagator.addEventDetector(detector);
    AbsoluteDate farTarget = AbsoluteDate.J2000_EPOCH.shiftedBy(10000.0);
    SpacecraftState propagated = propagator.propagate(farTarget);
    final double elevation = topo.getElevation(propagated.getPVCoordinates().getPosition(), propagated.getFrame(), propagated.getDate());
    final double zVelocity = propagated.getPVCoordinates(topo).getVelocity().getZ();
    Assert.assertTrue(farTarget.durationFrom(propagated.getDate()) > 7800.0);
    Assert.assertTrue("Incorrect value " + farTarget.durationFrom(propagated.getDate()) + " !< 7900", farTarget.durationFrom(propagated.getDate()) < 7900.0);
    Assert.assertEquals(0.09, elevation, 1.0e-11);
    Assert.assertTrue(zVelocity < 0);
}
Also used : SpacecraftState(org.orekit.propagation.SpacecraftState) OneAxisEllipsoid(org.orekit.bodies.OneAxisEllipsoid) ElevationDetector(org.orekit.propagation.events.ElevationDetector) TopocentricFrame(org.orekit.frames.TopocentricFrame) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) GeodeticPoint(org.orekit.bodies.GeodeticPoint) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate) AbsoluteDate(org.orekit.time.AbsoluteDate) Test(org.junit.Test)

Example 32 with TopocentricFrame

use of org.orekit.frames.TopocentricFrame in project Orekit by CS-SI.

the class FieldEcksteinHechlerPropagatorTest method doSetting.

private <T extends RealFieldElement<T>> void doSetting(Field<T> field) throws OrekitException {
    T zero = field.getZero();
    FieldAbsoluteDate<T> date = new FieldAbsoluteDate<>(field);
    final FieldKeplerianOrbit<T> orbit = new FieldKeplerianOrbit<>(zero.add(7.8e6), zero.add(0.032), zero.add(0.4), zero.add(0.1), zero.add(0.2), zero.add(0.3), PositionAngle.TRUE, FramesFactory.getEME2000(), date, 3.986004415e14);
    FieldEcksteinHechlerPropagator<T> propagator = new FieldEcksteinHechlerPropagator<>(orbit, provider);
    final OneAxisEllipsoid earthShape = new OneAxisEllipsoid(6378136.460, 1 / 298.257222101, FramesFactory.getITRF(IERSConventions.IERS_2010, true));
    final TopocentricFrame topo = new TopocentricFrame(earthShape, new GeodeticPoint(0.389, -2.962, 0), null);
    FieldElevationDetector<T> detector = new FieldElevationDetector<>(zero.add(60), zero.add(1.0e-9), topo).withConstantElevation(0.09);
    Assert.assertEquals(0.09, detector.getMinElevation(), 1.0e-12);
    Assert.assertTrue(topo == detector.getTopocentricFrame());
    propagator.addEventDetector(detector);
    FieldAbsoluteDate<T> farTarget = date.shiftedBy(10000.0);
    FieldSpacecraftState<T> propagated = propagator.propagate(farTarget);
    final double elevation = topo.getElevation(propagated.getPVCoordinates().getPosition().toVector3D(), propagated.getFrame(), propagated.getDate().toAbsoluteDate());
    final double zVelocity = propagated.getPVCoordinates(topo).getVelocity().getZ().getReal();
    Assert.assertTrue(farTarget.durationFrom(propagated.getDate()).getReal() > 7800.0);
    Assert.assertTrue("Incorrect value " + farTarget.durationFrom(propagated.getDate()) + " !< 7900", farTarget.durationFrom(propagated.getDate()).getReal() < 7900.0);
    Assert.assertEquals(0.09, elevation, 1.0e-11);
    Assert.assertTrue(zVelocity < 0);
}
Also used : OneAxisEllipsoid(org.orekit.bodies.OneAxisEllipsoid) TopocentricFrame(org.orekit.frames.TopocentricFrame) FieldKeplerianOrbit(org.orekit.orbits.FieldKeplerianOrbit) GeodeticPoint(org.orekit.bodies.GeodeticPoint) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate)

Example 33 with TopocentricFrame

use of org.orekit.frames.TopocentricFrame in project Orekit by CS-SI.

the class FieldKeplerianPropagatorTest method doTestSetting.

private <T extends RealFieldElement<T>> void doTestSetting(Field<T> field) throws OrekitException {
    T zero = field.getZero();
    final FieldKeplerianOrbit<T> orbit = new FieldKeplerianOrbit<>(zero.add(7.8e6), zero.add(0.032), zero.add(0.4), zero.add(0.1), zero.add(0.2), zero.add(0.3), PositionAngle.TRUE, FramesFactory.getEME2000(), new FieldAbsoluteDate<>(field), 3.986004415e14);
    FieldKeplerianPropagator<T> propagator = new FieldKeplerianPropagator<>(orbit);
    final OneAxisEllipsoid earthShape = new OneAxisEllipsoid(6378136.460, 1 / 298.257222101, FramesFactory.getITRF(IERSConventions.IERS_2010, true));
    final TopocentricFrame topo = new TopocentricFrame(earthShape, new GeodeticPoint(0.389, -2.962, 0), null);
    propagator.addEventDetector(new FieldElevationDetector<>(zero.add(60), zero.add(FieldAbstractDetector.DEFAULT_THRESHOLD), topo).withConstantElevation(0.09));
    FieldAbsoluteDate<T> farTarget = new FieldAbsoluteDate<>(field).shiftedBy(10000.0);
    FieldSpacecraftState<T> propagated = propagator.propagate(farTarget);
    final double elevation = topo.getElevation(propagated.getPVCoordinates().getPosition().toVector3D(), propagated.getFrame(), propagated.getDate().toAbsoluteDate());
    final T zVelocity = propagated.getPVCoordinates(topo).getVelocity().getZ();
    Assert.assertTrue(farTarget.durationFrom(propagated.getDate()).getReal() > 7800.0);
    Assert.assertTrue(farTarget.durationFrom(propagated.getDate()).getReal() < 7900.0);
    Assert.assertEquals(0.09, elevation, 1.0e-9);
    Assert.assertTrue(zVelocity.getReal() < 0);
}
Also used : OneAxisEllipsoid(org.orekit.bodies.OneAxisEllipsoid) FieldElevationDetector(org.orekit.propagation.events.FieldElevationDetector) TopocentricFrame(org.orekit.frames.TopocentricFrame) FieldKeplerianOrbit(org.orekit.orbits.FieldKeplerianOrbit) GeodeticPoint(org.orekit.bodies.GeodeticPoint) FieldGeodeticPoint(org.orekit.bodies.FieldGeodeticPoint)

Example 34 with TopocentricFrame

use of org.orekit.frames.TopocentricFrame in project Orekit by CS-SI.

the class EarthITU453AtmosphereRefractionTest method setUp.

@Before
public void setUp() throws Exception {
    Utils.setDataRoot("regular-data:potential:tides");
    IERSConventions conventions = IERSConventions.IERS_2010;
    OneAxisEllipsoid earth = new OneAxisEllipsoid(Constants.WGS84_EARTH_EQUATORIAL_RADIUS, Constants.WGS84_EARTH_FLATTENING, FramesFactory.getITRF(conventions, true));
    // Kiruna-2 (Sweden)
    final GeodeticPoint kir = new GeodeticPoint(FastMath.toRadians(67.858428), FastMath.toRadians(20.966880), 385.8);
    // Hartebeesthoek (South Africa)
    final GeodeticPoint har = new GeodeticPoint(FastMath.toRadians(-24.110243), FastMath.toRadians(27.685308), 1415.821);
    // Everest (fake station)
    final GeodeticPoint eve = new GeodeticPoint(FastMath.toRadians(27.988333), FastMath.toRadians(86.991944), 8848.0);
    // Dead Sea (fake station)
    final GeodeticPoint des = new GeodeticPoint(FastMath.toRadians(31.500000), FastMath.toRadians(35.500000), -422.0);
    // Alt0 (fake station)
    final GeodeticPoint alt = new GeodeticPoint(FastMath.toRadians(31.500000), FastMath.toRadians(35.500000), 0.0);
    stationk = new TopocentricFrame(earth, kir, namek);
    stationh = new TopocentricFrame(earth, har, nameh);
    statione = new TopocentricFrame(earth, eve, namee);
    stationd = new TopocentricFrame(earth, des, named);
    stationa = new TopocentricFrame(earth, alt, namea);
}
Also used : OneAxisEllipsoid(org.orekit.bodies.OneAxisEllipsoid) IERSConventions(org.orekit.utils.IERSConventions) TopocentricFrame(org.orekit.frames.TopocentricFrame) GeodeticPoint(org.orekit.bodies.GeodeticPoint) Before(org.junit.Before)

Example 35 with TopocentricFrame

use of org.orekit.frames.TopocentricFrame in project Orekit by CS-SI.

the class Frames1 method main.

public static void main(String[] args) {
    try {
        // configure Orekit
        File home = new File(System.getProperty("user.home"));
        File orekitData = new File(home, "orekit-data");
        if (!orekitData.exists()) {
            System.err.format(Locale.US, "Failed to find %s folder%n", orekitData.getAbsolutePath());
            System.err.format(Locale.US, "You need to download %s from the %s page and unzip it in %s for this tutorial to work%n", "orekit-data.zip", "https://www.orekit.org/forge/projects/orekit/files", home.getAbsolutePath());
            System.exit(1);
        }
        DataProvidersManager manager = DataProvidersManager.getInstance();
        manager.addProvider(new DirectoryCrawler(orekitData));
        // Initial state definition : date, orbit
        TimeScale utc = TimeScalesFactory.getUTC();
        AbsoluteDate initialDate = new AbsoluteDate(2008, 10, 01, 0, 0, 00.000, utc);
        // gravitation coefficient
        double mu = 3.986004415e+14;
        // inertial frame for orbit definition
        Frame inertialFrame = FramesFactory.getEME2000();
        Vector3D posisat = new Vector3D(-6142438.668, 3492467.560, -25767.25680);
        Vector3D velosat = new Vector3D(505.8479685, 942.7809215, 7435.922231);
        PVCoordinates pvsat = new PVCoordinates(posisat, velosat);
        Orbit initialOrbit = new CartesianOrbit(pvsat, inertialFrame, initialDate, mu);
        // Propagator : consider a simple Keplerian motion
        Propagator kepler = new KeplerianPropagator(initialOrbit);
        // Earth and frame
        Frame earthFrame = FramesFactory.getITRF(IERSConventions.IERS_2010, true);
        BodyShape earth = new OneAxisEllipsoid(Constants.WGS84_EARTH_EQUATORIAL_RADIUS, Constants.WGS84_EARTH_FLATTENING, earthFrame);
        // Station
        final double longitude = FastMath.toRadians(45.);
        final double latitude = FastMath.toRadians(25.);
        final double altitude = 0.;
        final GeodeticPoint station = new GeodeticPoint(latitude, longitude, altitude);
        final TopocentricFrame staF = new TopocentricFrame(earth, station, "station");
        System.out.println("          time           doppler (m/s)");
        // Stop date
        final AbsoluteDate finalDate = new AbsoluteDate(initialDate, 6000, utc);
        // Loop
        AbsoluteDate extrapDate = initialDate;
        while (extrapDate.compareTo(finalDate) <= 0) {
            // We can simply get the position and velocity of spacecraft in station frame at any time
            PVCoordinates pvInert = kepler.propagate(extrapDate).getPVCoordinates();
            PVCoordinates pvStation = inertialFrame.getTransformTo(staF, extrapDate).transformPVCoordinates(pvInert);
            // And then calculate the doppler signal
            double doppler = Vector3D.dotProduct(pvStation.getPosition(), pvStation.getVelocity()) / pvStation.getPosition().getNorm();
            System.out.format(Locale.US, "%s   %9.3f%n", extrapDate, doppler);
            extrapDate = extrapDate.shiftedBy(600);
        }
    } catch (OrekitException oe) {
        System.err.println(oe.getMessage());
    }
}
Also used : Frame(org.orekit.frames.Frame) TopocentricFrame(org.orekit.frames.TopocentricFrame) CartesianOrbit(org.orekit.orbits.CartesianOrbit) OneAxisEllipsoid(org.orekit.bodies.OneAxisEllipsoid) CartesianOrbit(org.orekit.orbits.CartesianOrbit) Orbit(org.orekit.orbits.Orbit) PVCoordinates(org.orekit.utils.PVCoordinates) TopocentricFrame(org.orekit.frames.TopocentricFrame) TimeScale(org.orekit.time.TimeScale) BodyShape(org.orekit.bodies.BodyShape) AbsoluteDate(org.orekit.time.AbsoluteDate) KeplerianPropagator(org.orekit.propagation.analytical.KeplerianPropagator) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) Propagator(org.orekit.propagation.Propagator) KeplerianPropagator(org.orekit.propagation.analytical.KeplerianPropagator) DirectoryCrawler(org.orekit.data.DirectoryCrawler) DataProvidersManager(org.orekit.data.DataProvidersManager) OrekitException(org.orekit.errors.OrekitException) GeodeticPoint(org.orekit.bodies.GeodeticPoint) File(java.io.File)

Aggregations

TopocentricFrame (org.orekit.frames.TopocentricFrame)37 GeodeticPoint (org.orekit.bodies.GeodeticPoint)35 OneAxisEllipsoid (org.orekit.bodies.OneAxisEllipsoid)31 Test (org.junit.Test)23 AbsoluteDate (org.orekit.time.AbsoluteDate)23 KeplerianOrbit (org.orekit.orbits.KeplerianOrbit)22 Propagator (org.orekit.propagation.Propagator)19 KeplerianPropagator (org.orekit.propagation.analytical.KeplerianPropagator)19 Vector3D (org.hipparchus.geometry.euclidean.threed.Vector3D)17 SpacecraftState (org.orekit.propagation.SpacecraftState)16 Frame (org.orekit.frames.Frame)15 Orbit (org.orekit.orbits.Orbit)14 PVCoordinates (org.orekit.utils.PVCoordinates)14 BodyShape (org.orekit.bodies.BodyShape)13 FieldAbsoluteDate (org.orekit.time.FieldAbsoluteDate)9 EquinoctialOrbit (org.orekit.orbits.EquinoctialOrbit)8 EcksteinHechlerPropagator (org.orekit.propagation.analytical.EcksteinHechlerPropagator)8 ElevationDetector (org.orekit.propagation.events.ElevationDetector)8 HashMap (java.util.HashMap)6 LoggedEvent (org.orekit.propagation.events.EventsLogger.LoggedEvent)6