1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.orekit.files.sinex;
18
19 import org.hipparchus.geometry.euclidean.threed.Vector3D;
20 import org.orekit.frames.EopHistoryLoader;
21 import org.orekit.frames.ITRFVersion;
22 import org.orekit.gnss.GnssSignal;
23 import org.orekit.gnss.SatInSystem;
24 import org.orekit.time.AbsoluteDate;
25 import org.orekit.time.ChronologicalComparator;
26 import org.orekit.time.TimeScales;
27
28 import java.util.Collections;
29 import java.util.Map;
30 import java.util.SortedSet;
31 import java.util.TreeSet;
32
33
34
35
36
37
38
39 public class Sinex extends AbstractSinex {
40
41
42 private final Map<SatInSystem, Map<GnssSignal, Vector3D>> satellitesPhaseCenters;
43
44
45 private final Map<String, Station> stations;
46
47
48 private final Map<AbsoluteDate, SinexEopEntry> eop;
49
50
51
52
53
54
55
56
57
58
59 public Sinex(final TimeScales timeScales,
60 final AbsoluteDate creationDate, final AbsoluteDate startDate, final AbsoluteDate endDate,
61 final Map<SatInSystem, Map<GnssSignal, Vector3D>> satellitesPhaseCenters,
62 final Map<String, Station> stations, final Map<AbsoluteDate, SinexEopEntry> eop) {
63 super(timeScales, creationDate, startDate, endDate);
64 this.satellitesPhaseCenters = satellitesPhaseCenters;
65 this.stations = stations;
66 this.eop = eop;
67 }
68
69
70
71
72 public Map<SatInSystem, Map<GnssSignal, Vector3D>> getSatellitesPhaseCenters() {
73 return Collections.unmodifiableMap(satellitesPhaseCenters);
74 }
75
76
77
78
79 public Map<String, Station> getStations() {
80 return Collections.unmodifiableMap(stations);
81 }
82
83
84
85
86
87 public EopHistoryLoader getEopLoader(final ITRFVersion itrfVersion) {
88 return (converter, history) -> {
89
90
91 final SortedSet<SinexEopEntry> sorted = new TreeSet<>(new ChronologicalComparator());
92 sorted.addAll(eop.values());
93
94
95 sorted.add(sorted.first().toNewEpoch(getFileEpochStartTime()));
96 sorted.add(sorted.last().toNewEpoch(getFileEpochEndTime()));
97
98 if (sorted.size() < 4) {
99
100 sorted.add(sorted.first().toNewEpoch(getFileEpochStartTime().shiftedBy(1.0)));
101 sorted.add(sorted.last().toNewEpoch(getFileEpochEndTime().shiftedBy(-1.0)));
102 }
103
104
105 sorted.forEach(e -> history.add(e.toEopEntry(converter, itrfVersion, getTimeScales().getUTC())));
106
107 };
108 }
109
110 }