1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.orekit.estimation.measurements.modifiers;
18
19 import org.orekit.estimation.measurements.AbstractMeasurement;
20 import org.orekit.estimation.measurements.EstimatedMeasurementBase;
21 import org.orekit.estimation.measurements.InterSatellitesRange;
22 import org.orekit.frames.StaticTransform;
23 import org.orekit.gnss.antenna.FrequencyPattern;
24 import org.orekit.propagation.SpacecraftState;
25 import org.orekit.time.AbsoluteDate;
26 import org.orekit.utils.TimeStampedPVCoordinates;
27
28
29
30
31
32
33 public class PhaseCentersInterSatellitesBaseModifier<T extends AbstractMeasurement<T>> {
34
35
36 private final PhaseCentersOffsetComputer uplink;
37
38
39 private final PhaseCentersOffsetComputer downlink;
40
41
42
43
44
45
46
47
48 public PhaseCentersInterSatellitesBaseModifier(final FrequencyPattern pattern1,
49 final FrequencyPattern pattern2) {
50 this.uplink = new PhaseCentersOffsetComputer(pattern1, pattern2);
51 this.downlink = new PhaseCentersOffsetComputer(pattern2, pattern1);
52 }
53
54
55
56
57
58 public String getEffectName() {
59 return "mean phase center";
60 }
61
62
63
64
65
66 public double oneWayDistanceModification(final EstimatedMeasurementBase<T> estimated) {
67
68
69 final TimeStampedPVCoordinates[] participants = estimated.getParticipants();
70 final AbsoluteDate emissionDate = participants[0].getDate();
71 final AbsoluteDate receptionDate = participants[1].getDate();
72
73
74 final SpacecraftState localState = estimated.getStates()[0];
75 final SpacecraftState receptionState = localState.shiftedBy(receptionDate.durationFrom(localState.getDate()));
76 final StaticTransform receptionSpacecraftToInert = receptionState.toStaticTransform().getInverse();
77 final SpacecraftState remoteState = estimated.getStates()[1];
78 final SpacecraftState emissionState = remoteState.shiftedBy(emissionDate.durationFrom(remoteState.getDate()));
79 final StaticTransform emissionSpacecraftToInert = emissionState.toStaticTransform().getInverse();
80
81
82 return downlink.offset(emissionSpacecraftToInert, receptionSpacecraftToInert);
83
84 }
85
86
87
88
89
90 public double twoWayDistanceModification(final EstimatedMeasurementBase<InterSatellitesRange> estimated) {
91
92
93 final TimeStampedPVCoordinates[] participants = estimated.getParticipants();
94 final AbsoluteDate emissionDate = participants[0].getDate();
95 final AbsoluteDate transitDate = participants[1].getDate();
96 final AbsoluteDate receptionDate = participants[2].getDate();
97
98
99 final SpacecraftState refState1 = estimated.getStates()[0];
100 final SpacecraftState receptionState = refState1.shiftedBy(receptionDate.durationFrom(refState1.getDate()));
101 final StaticTransform receptionSpacecraftToInert = receptionState.toStaticTransform().getInverse();
102 final SpacecraftState refState2 = estimated.getStates()[1];
103 final SpacecraftState transitState = refState2.shiftedBy(transitDate.durationFrom(refState2.getDate()));
104 final StaticTransform transitSpacecraftToInert = transitState.toStaticTransform().getInverse();
105 final SpacecraftState emissionState = refState1.shiftedBy(emissionDate.durationFrom(refState1.getDate()));
106 final StaticTransform emissionSpacecraftToInert = emissionState.toStaticTransform().getInverse();
107
108
109 final double uplinkOffset = uplink.offset(emissionSpacecraftToInert, transitSpacecraftToInert);
110 final double downlinkOffset = downlink.offset(transitSpacecraftToInert, receptionSpacecraftToInert);
111
112 return 0.5 * (uplinkOffset + downlinkOffset);
113
114 }
115
116 }