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.List;
20
21 import org.hipparchus.geometry.euclidean.threed.Vector3D;
22 import org.hipparchus.util.MathUtils;
23 import org.orekit.estimation.measurements.AngularAzEl;
24 import org.orekit.estimation.measurements.EstimatedMeasurement;
25 import org.orekit.estimation.measurements.EstimationModifier;
26 import org.orekit.estimation.measurements.GroundStation;
27 import org.orekit.frames.Frame;
28 import org.orekit.models.earth.troposphere.DiscreteTroposphericModel;
29 import org.orekit.propagation.SpacecraftState;
30 import org.orekit.time.AbsoluteDate;
31 import org.orekit.utils.Constants;
32 import org.orekit.utils.ParameterDriver;
33
34
35
36
37
38
39
40
41
42
43
44
45
46 public class AngularTroposphericDelayModifier implements EstimationModifier<AngularAzEl> {
47
48
49 private final DiscreteTroposphericModel tropoModel;
50
51
52
53
54
55 public AngularTroposphericDelayModifier(final DiscreteTroposphericModel model) {
56 tropoModel = model;
57 }
58
59
60
61
62
63
64 private double angularErrorTroposphericModel(final GroundStation station,
65 final SpacecraftState state) {
66
67 final Vector3D position = state.getPVCoordinates().getPosition();
68
69
70 final double elevation = station.getBaseFrame().getElevation(position,
71 state.getFrame(),
72 state.getDate());
73
74
75 if (elevation > 0.0) {
76
77 final double delay = tropoModel.pathDelay(elevation, station.getBaseFrame().getPoint(), tropoModel.getParameters(), state.getDate());
78
79
80 return delay;
81 }
82
83 return 0;
84 }
85
86
87 @Override
88 public List<ParameterDriver> getParametersDrivers() {
89 return tropoModel.getParametersDrivers();
90 }
91
92 @Override
93 public void modify(final EstimatedMeasurement<AngularAzEl> estimated) {
94 final AngularAzEl measure = estimated.getObservedMeasurement();
95 final GroundStation station = measure.getStation();
96 final SpacecraftState state = estimated.getStates()[0];
97
98 final double delay = angularErrorTroposphericModel(station, state);
99
100 final double dt = delay / Constants.SPEED_OF_LIGHT;
101
102
103 final SpacecraftState transitState = state.shiftedBy(-dt);
104
105
106 final AbsoluteDate date = transitState.getDate();
107 final Vector3D position = transitState.getPVCoordinates().getPosition();
108 final Frame inertial = transitState.getFrame();
109
110
111 final double elevation = station.getBaseFrame().getElevation(position, inertial, date);
112 final double baseAzimuth = station.getBaseFrame().getAzimuth(position, inertial, date);
113 final double twoPiWrap = MathUtils.normalizeAngle(baseAzimuth, measure.getObservedValue()[0]) - baseAzimuth;
114 final double azimuth = baseAzimuth + twoPiWrap;
115
116
117
118 estimated.setEstimatedValue(azimuth, elevation);
119 }
120 }