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);
}
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);
}
Aggregations