1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.orekit.estimation;
18
19 import java.util.Arrays;
20 import java.util.List;
21
22 import org.hipparchus.util.FastMath;
23 import org.orekit.bodies.CelestialBody;
24 import org.orekit.bodies.CelestialBodyFactory;
25 import org.orekit.bodies.GeodeticPoint;
26 import org.orekit.bodies.OneAxisEllipsoid;
27 import org.orekit.estimation.measurements.GroundStation;
28 import org.orekit.forces.gravity.potential.UnnormalizedSphericalHarmonicsProvider;
29 import org.orekit.frames.EOPHistory;
30 import org.orekit.frames.FramesFactory;
31 import org.orekit.frames.TopocentricFrame;
32 import org.orekit.models.earth.displacement.StationDisplacement;
33 import org.orekit.models.earth.displacement.TidalDisplacement;
34 import org.orekit.orbits.Orbit;
35 import org.orekit.time.TimeScale;
36 import org.orekit.time.TimeScalesFactory;
37 import org.orekit.time.UT1Scale;
38 import org.orekit.utils.Constants;
39 import org.orekit.utils.IERSConventions;
40
41 public class EphemerisContext implements StationDataProvider {
42
43 public IERSConventions conventions;
44 public OneAxisEllipsoid earth;
45 public CelestialBody sun;
46 public CelestialBody moon;
47 public UnnormalizedSphericalHarmonicsProvider gravity;
48 public TimeScale utc;
49 public UT1Scale ut1;
50 public Orbit initialOrbit;
51 public StationDisplacement[] displacements;
52 public List<GroundStation> stations;
53
54 public EphemerisContext() {
55 this.conventions = IERSConventions.IERS_2010;
56 this.earth = new OneAxisEllipsoid(Constants.WGS84_EARTH_EQUATORIAL_RADIUS,
57 Constants.WGS84_EARTH_FLATTENING,
58 FramesFactory.getITRF(conventions, true));
59 final EOPHistory eopHistory = FramesFactory.getEOPHistory(conventions, true);
60 this.ut1 = TimeScalesFactory.getUT1(eopHistory);
61 this.displacements = new StationDisplacement[] {
62 new TidalDisplacement(Constants.EIGEN5C_EARTH_EQUATORIAL_RADIUS,
63 Constants.JPL_SSD_SUN_EARTH_PLUS_MOON_MASS_RATIO,
64 Constants.JPL_SSD_EARTH_MOON_MASS_RATIO,
65 CelestialBodyFactory.getSun(), CelestialBodyFactory.getMoon(),
66 conventions, false)
67 };
68 this.stations = Arrays.asList(createStation(-53.05388, -75.01551, 1750.0, "Isla Desolación"),
69 createStation( 62.29639, -7.01250, 880.0, "Slættaratindur"));
70
71 }
72
73 GroundStation createStation(double latitudeInDegrees, double longitudeInDegrees,
74 double altitude, String name) {
75 final GeodeticPoint gp = new GeodeticPoint(FastMath.toRadians(latitudeInDegrees),
76 FastMath.toRadians(longitudeInDegrees),
77 altitude);
78 return new GroundStation(new TopocentricFrame(earth, gp, name), ut1.getEOPHistory(), displacements);
79 }
80
81 @Override
82 public List<GroundStation> getStations() {
83 return stations;
84 }
85
86 }