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 java.util.Collections;
20 import java.util.List;
21
22 import org.hipparchus.geometry.euclidean.threed.Vector3D;
23 import org.orekit.estimation.measurements.EstimatedMeasurement;
24 import org.orekit.estimation.measurements.EstimationModifier;
25 import org.orekit.estimation.measurements.gnss.InterSatellitesPhase;
26 import org.orekit.frames.Transform;
27 import org.orekit.propagation.SpacecraftState;
28 import org.orekit.time.AbsoluteDate;
29 import org.orekit.utils.ParameterDriver;
30 import org.orekit.utils.TimeStampedPVCoordinates;
31
32
33
34
35
36 public class OnBoardAntennaInterSatellitesPhaseModifier implements EstimationModifier<InterSatellitesPhase> {
37
38
39 private final Vector3D antennaPhaseCenter1;
40
41
42 private final Vector3D antennaPhaseCenter2;
43
44
45
46
47
48
49
50
51 public OnBoardAntennaInterSatellitesPhaseModifier(final Vector3D antennaPhaseCenter1,
52 final Vector3D antennaPhaseCenter2) {
53 this.antennaPhaseCenter1 = antennaPhaseCenter1;
54 this.antennaPhaseCenter2 = antennaPhaseCenter2;
55 }
56
57
58 @Override
59 public List<ParameterDriver> getParametersDrivers() {
60 return Collections.emptyList();
61 }
62
63 @Override
64 public void modify(final EstimatedMeasurement<InterSatellitesPhase> estimated) {
65
66
67 final TimeStampedPVCoordinates[] participants = estimated.getParticipants();
68 final AbsoluteDate emissionDate = participants[0].getDate();
69 final AbsoluteDate receptionDate = participants[1].getDate();
70
71
72 final SpacecraftState localState = estimated.getStates()[0];
73 final SpacecraftState receptionState = localState.shiftedBy(receptionDate.durationFrom(localState.getDate()));
74 final Transform receptionSpacecraftToInert = receptionState.toTransform().getInverse();
75 final SpacecraftState remoteState = estimated.getStates()[1];
76 final SpacecraftState emissionState = remoteState.shiftedBy(emissionDate.durationFrom(remoteState.getDate()));
77 final Transform emissionSpacecraftToInert = emissionState.toTransform().getInverse();
78
79
80 final Vector3D pSpacecraftReception = receptionSpacecraftToInert.transformPosition(Vector3D.ZERO);
81 final Vector3D pSpacecraftEmission = emissionSpacecraftToInert.transformPosition(Vector3D.ZERO);
82 final double interSatellitesRangeUsingSpacecraftCenter = Vector3D.distance(pSpacecraftEmission, pSpacecraftReception);
83
84
85
86 final Vector3D pAPCReception = receptionSpacecraftToInert.transformPosition(antennaPhaseCenter1);
87 final Vector3D pAPCEmission = emissionSpacecraftToInert.transformPosition(antennaPhaseCenter2);
88 final double interSatellitesRangeUsingAntennaPhaseCenter = Vector3D.distance(pAPCEmission, pAPCReception);
89
90
91 final double[] value = estimated.getEstimatedValue();
92
93
94 final double wavelength = estimated.getObservedMeasurement().getWavelength();
95 value[0] += (interSatellitesRangeUsingAntennaPhaseCenter - interSatellitesRangeUsingSpacecraftCenter) / wavelength;
96 estimated.setEstimatedValue(value);
97
98 }
99
100
101 }