Search in sources :

Example 1 with EarthStandardAtmosphereRefraction

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

the class ElevationDetectorTest method testPresTemp.

public void testPresTemp() throws OrekitException {
    final TimeScale utc = TimeScalesFactory.getUTC();
    final Vector3D position = new Vector3D(-6142438.668, 3492467.56, -25767.257);
    final Vector3D velocity = new Vector3D(505.848, 942.781, 7435.922);
    final AbsoluteDate date = new AbsoluteDate(2003, 9, 16, utc);
    final Orbit orbit = new EquinoctialOrbit(new PVCoordinates(position, velocity), FramesFactory.getEME2000(), date, mu);
    Propagator propagator = new EcksteinHechlerPropagator(orbit, ae, mu, c20, c30, c40, c50, c60);
    // Earth and frame
    // equatorial radius in meter
    double ae = 6378137.0;
    // flattening
    double f = 1.0 / 298.257223563;
    // terrestrial frame at an arbitrary date
    Frame itrf = FramesFactory.getITRF(IERSConventions.IERS_2010, true);
    BodyShape earth = new OneAxisEllipsoid(ae, f, itrf);
    GeodeticPoint point = new GeodeticPoint(FastMath.toRadians(48.833), FastMath.toRadians(2.333), 0.0);
    TopocentricFrame topo = new TopocentricFrame(earth, point, "Gstation");
    EarthStandardAtmosphereRefraction refractionModel = new EarthStandardAtmosphereRefraction();
    ElevationDetector detector = new ElevationDetector(topo).withRefraction(refractionModel).withHandler(new StopOnIncreasing<ElevationDetector>());
    refractionModel.setPressure(101325);
    refractionModel.setTemperature(290);
    AbsoluteDate startDate = new AbsoluteDate(2003, 9, 15, 20, 0, 0, utc);
    propagator.resetInitialState(propagator.propagate(startDate));
    propagator.addEventDetector(detector);
    final SpacecraftState fs = propagator.propagate(startDate.shiftedBy(Constants.JULIAN_DAY));
    double elevation = topo.getElevation(fs.getPVCoordinates().getPosition(), fs.getFrame(), fs.getDate());
    Assert.assertEquals(FastMath.toRadians(1.7026104902251749), elevation, 2.0e-5);
}
Also used : Frame(org.orekit.frames.Frame) TopocentricFrame(org.orekit.frames.TopocentricFrame) OneAxisEllipsoid(org.orekit.bodies.OneAxisEllipsoid) Orbit(org.orekit.orbits.Orbit) EquinoctialOrbit(org.orekit.orbits.EquinoctialOrbit) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) 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) EcksteinHechlerPropagator(org.orekit.propagation.analytical.EcksteinHechlerPropagator) SpacecraftState(org.orekit.propagation.SpacecraftState) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) EquinoctialOrbit(org.orekit.orbits.EquinoctialOrbit) EcksteinHechlerPropagator(org.orekit.propagation.analytical.EcksteinHechlerPropagator) Propagator(org.orekit.propagation.Propagator) KeplerianPropagator(org.orekit.propagation.analytical.KeplerianPropagator) GeodeticPoint(org.orekit.bodies.GeodeticPoint) EarthStandardAtmosphereRefraction(org.orekit.models.earth.EarthStandardAtmosphereRefraction)

Example 2 with EarthStandardAtmosphereRefraction

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

the class ElevationDetectorTest method testHorizon.

@Test
public void testHorizon() throws OrekitException {
    final TimeScale utc = TimeScalesFactory.getUTC();
    final Vector3D position = new Vector3D(-6142438.668, 3492467.56, -25767.257);
    final Vector3D velocity = new Vector3D(505.848, 942.781, 7435.922);
    final AbsoluteDate date = new AbsoluteDate(2003, 9, 16, utc);
    final Orbit orbit = new EquinoctialOrbit(new PVCoordinates(position, velocity), FramesFactory.getEME2000(), date, mu);
    Propagator propagator = new EcksteinHechlerPropagator(orbit, ae, mu, c20, c30, c40, c50, c60);
    // Earth and frame
    // equatorial radius in meter
    double ae = 6378137.0;
    // flattening
    double f = 1.0 / 298.257223563;
    // terrestrial frame at an arbitrary date
    Frame itrf = FramesFactory.getITRF(IERSConventions.IERS_2010, true);
    BodyShape earth = new OneAxisEllipsoid(ae, f, itrf);
    GeodeticPoint point = new GeodeticPoint(FastMath.toRadians(48.833), FastMath.toRadians(2.333), 0.0);
    TopocentricFrame topo = new TopocentricFrame(earth, point, "Gstation");
    AtmosphericRefractionModel refractionModel = new EarthStandardAtmosphereRefraction();
    ElevationDetector detector = new ElevationDetector(topo).withRefraction(refractionModel).withHandler(new StopOnIncreasing<ElevationDetector>());
    Assert.assertSame(refractionModel, detector.getRefractionModel());
    AbsoluteDate startDate = new AbsoluteDate(2003, 9, 15, 20, 0, 0, utc);
    propagator.resetInitialState(propagator.propagate(startDate));
    propagator.addEventDetector(detector);
    final SpacecraftState fs = propagator.propagate(startDate.shiftedBy(Constants.JULIAN_DAY));
    double elevation = topo.getElevation(fs.getPVCoordinates().getPosition(), fs.getFrame(), fs.getDate());
    Assert.assertEquals(FastMath.toRadians(-0.5746255623877098), elevation, 2.0e-5);
}
Also used : Frame(org.orekit.frames.Frame) TopocentricFrame(org.orekit.frames.TopocentricFrame) OneAxisEllipsoid(org.orekit.bodies.OneAxisEllipsoid) Orbit(org.orekit.orbits.Orbit) EquinoctialOrbit(org.orekit.orbits.EquinoctialOrbit) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) PVCoordinates(org.orekit.utils.PVCoordinates) TopocentricFrame(org.orekit.frames.TopocentricFrame) AtmosphericRefractionModel(org.orekit.models.AtmosphericRefractionModel) TimeScale(org.orekit.time.TimeScale) BodyShape(org.orekit.bodies.BodyShape) AbsoluteDate(org.orekit.time.AbsoluteDate) EcksteinHechlerPropagator(org.orekit.propagation.analytical.EcksteinHechlerPropagator) SpacecraftState(org.orekit.propagation.SpacecraftState) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) EquinoctialOrbit(org.orekit.orbits.EquinoctialOrbit) EcksteinHechlerPropagator(org.orekit.propagation.analytical.EcksteinHechlerPropagator) Propagator(org.orekit.propagation.Propagator) KeplerianPropagator(org.orekit.propagation.analytical.KeplerianPropagator) GeodeticPoint(org.orekit.bodies.GeodeticPoint) EarthStandardAtmosphereRefraction(org.orekit.models.earth.EarthStandardAtmosphereRefraction) Test(org.junit.Test)

Aggregations

Vector3D (org.hipparchus.geometry.euclidean.threed.Vector3D)2 BodyShape (org.orekit.bodies.BodyShape)2 GeodeticPoint (org.orekit.bodies.GeodeticPoint)2 OneAxisEllipsoid (org.orekit.bodies.OneAxisEllipsoid)2 Frame (org.orekit.frames.Frame)2 TopocentricFrame (org.orekit.frames.TopocentricFrame)2 EarthStandardAtmosphereRefraction (org.orekit.models.earth.EarthStandardAtmosphereRefraction)2 EquinoctialOrbit (org.orekit.orbits.EquinoctialOrbit)2 KeplerianOrbit (org.orekit.orbits.KeplerianOrbit)2 Orbit (org.orekit.orbits.Orbit)2 Propagator (org.orekit.propagation.Propagator)2 SpacecraftState (org.orekit.propagation.SpacecraftState)2 EcksteinHechlerPropagator (org.orekit.propagation.analytical.EcksteinHechlerPropagator)2 KeplerianPropagator (org.orekit.propagation.analytical.KeplerianPropagator)2 AbsoluteDate (org.orekit.time.AbsoluteDate)2 TimeScale (org.orekit.time.TimeScale)2 PVCoordinates (org.orekit.utils.PVCoordinates)2 Test (org.junit.Test)1 AtmosphericRefractionModel (org.orekit.models.AtmosphericRefractionModel)1