Search in sources :

Example 61 with AbsoluteDate

use of org.orekit.time.AbsoluteDate in project Orekit by CS-SI.

the class SP3ParserTest method testParseSP3d1.

@Test
public void testParseSP3d1() throws OrekitException, IOException {
    // simple test for version sp3-d, contains p entries
    final String ex = "/sp3/example-d-1.sp3";
    final SP3Parser parser = new SP3Parser();
    final InputStream inEntry = getClass().getResourceAsStream(ex);
    final SP3File file = parser.parse(inEntry);
    Assert.assertEquals(SP3OrbitType.BCT, file.getOrbitType());
    Assert.assertEquals(TimeSystem.GPS, file.getTimeSystem());
    Assert.assertEquals(140, file.getSatelliteCount());
    final List<SP3Coordinate> coords = file.getSatellites().get("S37").getCoordinates();
    Assert.assertEquals(2, coords.size());
    final SP3Coordinate coord = coords.get(0);
    // 2013  4  3  0  0  0.00000000
    Assert.assertEquals(new AbsoluteDate(2013, 4, 3, 0, 0, 0, TimeScalesFactory.getGPS()), coord.getDate());
    // PS37 -34534.904566  24164.610955     29.812840      0.299420
    checkPVEntry(new PVCoordinates(new Vector3D(-34534904.566, 24164610.955, 29812.840), Vector3D.ZERO), coord);
}
Also used : SP3Coordinate(org.orekit.files.sp3.SP3File.SP3Coordinate) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) InputStream(java.io.InputStream) PVCoordinates(org.orekit.utils.PVCoordinates) AbsoluteDate(org.orekit.time.AbsoluteDate) Test(org.junit.Test)

Example 62 with AbsoluteDate

use of org.orekit.time.AbsoluteDate in project Orekit by CS-SI.

the class SP3ParserTest method testParseSP3d2.

@Test
public void testParseSP3d2() throws OrekitException, IOException {
    // simple test for version sp3-c, contains p/v entries and correlations
    final String ex = "/sp3/example-d-2.sp3";
    final SP3Parser parser = new SP3Parser();
    final InputStream inEntry = getClass().getResourceAsStream(ex);
    final SP3File file = parser.parse(inEntry);
    Assert.assertEquals(SP3OrbitType.HLM, file.getOrbitType());
    Assert.assertEquals(TimeSystem.GPS, file.getTimeSystem());
    Assert.assertEquals(26, file.getSatelliteCount());
    final List<SP3Coordinate> coords = file.getSatellites().get("G01").getCoordinates();
    Assert.assertEquals(2, coords.size());
    final SP3Coordinate coord = coords.get(0);
    // 2001  8  8  0  0  0.00000000
    Assert.assertEquals(new AbsoluteDate(2001, 8, 8, 0, 0, 0, TimeScalesFactory.getGPS()), coord.getDate());
    // PG01 -11044.805800 -10475.672350  21929.418200    189.163300 18 18 18 219
    // VG01  20298.880364 -18462.044804   1381.387685     -4.534317 14 14 14 191
    checkPVEntry(new PVCoordinates(new Vector3D(-11044805.8, -10475672.35, 21929418.2), new Vector3D(2029.8880364, -1846.2044804, 138.1387685)), coord);
}
Also used : SP3Coordinate(org.orekit.files.sp3.SP3File.SP3Coordinate) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) InputStream(java.io.InputStream) PVCoordinates(org.orekit.utils.PVCoordinates) AbsoluteDate(org.orekit.time.AbsoluteDate) Test(org.junit.Test)

Example 63 with AbsoluteDate

use of org.orekit.time.AbsoluteDate in project Orekit by CS-SI.

the class BoxAndSolarArraySpacecraftTest method setUp.

@Before
public void setUp() {
    try {
        Utils.setDataRoot("regular-data");
        mu = 3.9860047e14;
        double ae = 6.378137e6;
        double c20 = -1.08263e-3;
        double c30 = 2.54e-6;
        double c40 = 1.62e-6;
        double c50 = 2.3e-7;
        double c60 = -5.5e-7;
        AbsoluteDate date = new AbsoluteDate(new DateComponents(1970, 7, 1), new TimeComponents(13, 59, 27.816), TimeScalesFactory.getUTC());
        // Satellite position as circular parameters, raan chosen to have sun elevation with
        // respect to orbit plane roughly evolving roughly from 15 to 15.2 degrees in the test range
        Orbit circ = new CircularOrbit(7178000.0, 0.5e-4, -0.5e-4, FastMath.toRadians(50.), FastMath.toRadians(280), FastMath.toRadians(10.0), PositionAngle.MEAN, FramesFactory.getEME2000(), date, mu);
        propagator = new EcksteinHechlerPropagator(circ, new LofOffset(circ.getFrame(), LOFType.VVLH), ae, mu, c20, c30, c40, c50, c60);
    } catch (OrekitException oe) {
        Assert.fail(oe.getLocalizedMessage());
    }
}
Also used : EcksteinHechlerPropagator(org.orekit.propagation.analytical.EcksteinHechlerPropagator) Orbit(org.orekit.orbits.Orbit) CircularOrbit(org.orekit.orbits.CircularOrbit) CircularOrbit(org.orekit.orbits.CircularOrbit) DateComponents(org.orekit.time.DateComponents) OrekitException(org.orekit.errors.OrekitException) TimeComponents(org.orekit.time.TimeComponents) LofOffset(org.orekit.attitudes.LofOffset) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate) AbsoluteDate(org.orekit.time.AbsoluteDate) Before(org.junit.Before)

Example 64 with AbsoluteDate

use of org.orekit.time.AbsoluteDate in project Orekit by CS-SI.

the class BoxAndSolarArraySpacecraftTest method testNormalOptimalRotationField.

@Test
public void testNormalOptimalRotationField() throws OrekitException {
    AbsoluteDate initialDate = propagator.getInitialState().getDate();
    CelestialBody sun = CelestialBodyFactory.getSun();
    BoxAndSolarArraySpacecraft s = new BoxAndSolarArraySpacecraft(0, 0, 0, sun, 20.0, Vector3D.PLUS_J, 0.0, 1.0, 0.0);
    Field<Decimal64> field = Decimal64Field.getInstance();
    for (double dt = 0; dt < 4000; dt += 60) {
        AbsoluteDate date = initialDate.shiftedBy(dt);
        SpacecraftState state = propagator.propagate(date);
        FieldVector3D<Decimal64> normal = s.getNormal(new FieldAbsoluteDate<>(field, state.getDate()), state.getFrame(), new FieldVector3D<>(field, state.getPVCoordinates().getPosition()), new FieldRotation<>(field, state.getAttitude().getRotation()));
        Assert.assertEquals(0, FieldVector3D.dotProduct(normal, Vector3D.PLUS_J).getReal(), 1.0e-16);
    }
}
Also used : SpacecraftState(org.orekit.propagation.SpacecraftState) CelestialBody(org.orekit.bodies.CelestialBody) Decimal64(org.hipparchus.util.Decimal64) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate) AbsoluteDate(org.orekit.time.AbsoluteDate) Test(org.junit.Test)

Example 65 with AbsoluteDate

use of org.orekit.time.AbsoluteDate 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)

Aggregations

AbsoluteDate (org.orekit.time.AbsoluteDate)840 Test (org.junit.Test)632 Vector3D (org.hipparchus.geometry.euclidean.threed.Vector3D)321 FieldAbsoluteDate (org.orekit.time.FieldAbsoluteDate)283 SpacecraftState (org.orekit.propagation.SpacecraftState)279 KeplerianOrbit (org.orekit.orbits.KeplerianOrbit)204 PVCoordinates (org.orekit.utils.PVCoordinates)193 Orbit (org.orekit.orbits.Orbit)157 Frame (org.orekit.frames.Frame)152 OrekitException (org.orekit.errors.OrekitException)141 DateComponents (org.orekit.time.DateComponents)134 TimeStampedPVCoordinates (org.orekit.utils.TimeStampedPVCoordinates)106 CartesianOrbit (org.orekit.orbits.CartesianOrbit)104 EquinoctialOrbit (org.orekit.orbits.EquinoctialOrbit)97 ArrayList (java.util.ArrayList)96 Propagator (org.orekit.propagation.Propagator)90 TimeScale (org.orekit.time.TimeScale)90 OneAxisEllipsoid (org.orekit.bodies.OneAxisEllipsoid)88 TimeComponents (org.orekit.time.TimeComponents)88 FieldVector3D (org.hipparchus.geometry.euclidean.threed.FieldVector3D)87