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.orekit.gnss.ObservationType;
20 import org.orekit.gnss.SatInSystem;
21 import org.orekit.gnss.SatelliteSystem;
22 import org.orekit.gnss.TimeSystem;
23 import org.orekit.time.TimeScales;
24
25 import java.util.HashMap;
26 import java.util.Map;
27 import java.util.function.BiFunction;
28
29
30
31
32
33 public class SinexBiasParseInfo extends ParseInfo<SinexBias> {
34
35
36 private final BiFunction<? super SatelliteSystem, ? super String, ? extends ObservationType> typeBuilder;
37
38
39 private final BiasDescription description;
40
41
42 private final Map<String, StationDifferentialSignalBias> stationsDsb;
43
44
45 private final Map<SatInSystem, SatelliteDifferentialSignalBias> satellitesDsb;
46
47
48 private final Map<String, StationObservableSpecificSignalBias> stationsOsb;
49
50
51 private final Map<SatInSystem, SatelliteObservableSpecificSignalBias> satellitesOsb;
52
53
54
55
56
57 SinexBiasParseInfo(final TimeScales timeScales,
58 final BiFunction<? super SatelliteSystem, ? super String, ? extends ObservationType> typeBuilder) {
59 super(timeScales);
60 this.description = new BiasDescription();
61 this.stationsDsb = new HashMap<>();
62 this.satellitesDsb = new HashMap<>();
63 this.stationsOsb = new HashMap<>();
64 this.satellitesOsb = new HashMap<>();
65 this.typeBuilder = typeBuilder;
66 }
67
68
69
70
71 BiasDescription getDescription() {
72 return description;
73 }
74
75
76
77
78
79 SatelliteDifferentialSignalBias getSatelliteDsb(final SatInSystem satellite) {
80 return satellitesDsb.computeIfAbsent(satellite, SatelliteDifferentialSignalBias::new);
81 }
82
83
84
85
86
87 StationDifferentialSignalBias getStationDsb(final String siteCode) {
88 return stationsDsb.computeIfAbsent(siteCode, StationDifferentialSignalBias::new);
89 }
90
91
92
93
94
95 SatelliteObservableSpecificSignalBias getSatelliteOsb(final SatInSystem satellite) {
96 return satellitesOsb.computeIfAbsent(satellite, SatelliteObservableSpecificSignalBias::new);
97 }
98
99
100
101
102
103 StationObservableSpecificSignalBias getStationOsb(final String siteCode) {
104 return stationsOsb.computeIfAbsent(siteCode, StationObservableSpecificSignalBias::new);
105 }
106
107
108
109
110 void setTimeSystem(final TimeSystem timeSystem) {
111 getDescription().setTimeSystem(timeSystem);
112 setTimeScale(timeSystem.getTimeScale(getTimeScales()));
113 }
114
115
116
117
118
119
120
121 protected ObservationType parseObservationType(final SatelliteSystem system, final int start, final int length) {
122 final String type = parseString(start, length);
123 return type.isEmpty() ? null : typeBuilder.apply(system, type);
124 }
125
126
127 @Override
128 protected SinexBias build() {
129 return new SinexBias(getTimeScales(), getCreationDate(), getStartDate(), getEndDate(),
130 description, stationsDsb, satellitesDsb, stationsOsb, satellitesOsb);
131 }
132
133 }