Commit f91722fb authored by Luc Maisonobe's avatar Luc Maisonobe

Added clock offset to ground station based measurements.

Fixes #513
parent 6d60e87f
......@@ -76,6 +76,7 @@ public class AngularAzEl extends AbstractMeasurement<AngularAzEl> {
final double[] angular, final double[] sigma, final double[] baseWeight,
final int propagatorIndex) {
super(date, angular, sigma, baseWeight, Arrays.asList(propagatorIndex),
station.getClockOffsetDriver(),
station.getEastOffsetDriver(),
station.getNorthOffsetDriver(),
station.getZenithOffsetDriver(),
......@@ -109,7 +110,7 @@ public class AngularAzEl extends AbstractMeasurement<AngularAzEl> {
// Parameters:
// - 0..2 - Position of the spacecraft in inertial frame
// - 3..5 - Velocity of the spacecraft in inertial frame
// - 6..n - station parameters (station offsets, pole, prime meridian...)
// - 6..n - station parameters (clock offset, station offsets, pole, prime meridian...)
// Get the number of parameters used for derivation
// Place the selected drivers into a map
......@@ -129,11 +130,10 @@ public class AngularAzEl extends AbstractMeasurement<AngularAzEl> {
// Transform between station and inertial frame, expressed as a derivative structure
// The components of station's position in offset frame are the 3 last derivative parameters
final AbsoluteDate downlinkDate = getDate();
final FieldAbsoluteDate<DerivativeStructure> downlinkDateDS =
new FieldAbsoluteDate<>(field, downlinkDate);
final FieldTransform<DerivativeStructure> offsetToInertialDownlink =
station.getOffsetToInertial(state.getFrame(), downlinkDateDS, factory, indices);
station.getOffsetToInertial(state.getFrame(), getDate(), factory, indices);
final FieldAbsoluteDate<DerivativeStructure> downlinkDateDS =
offsetToInertialDownlink.getFieldDate();
// Station position/velocity in inertial frame at end of the downlink leg
final TimeStampedFieldPVCoordinates<DerivativeStructure> stationDownlink =
......@@ -152,7 +152,7 @@ public class AngularAzEl extends AbstractMeasurement<AngularAzEl> {
final DerivativeStructure tauD = signalTimeOfFlight(pvaDS, stationDownlink.getPosition(), downlinkDateDS);
// Transit state
final double delta = downlinkDate.durationFrom(state.getDate());
final DerivativeStructure delta = downlinkDateDS.durationFrom(state.getDate());
final DerivativeStructure deltaMTauD = tauD.negate().add(delta);
final SpacecraftState transitState = state.shiftedBy(deltaMTauD.getValue());
......
......@@ -83,6 +83,7 @@ public class AngularRaDec extends AbstractMeasurement<AngularRaDec> {
final double[] angular, final double[] sigma, final double[] baseWeight,
final int propagatorIndex) {
super(date, angular, sigma, baseWeight, Arrays.asList(propagatorIndex),
station.getClockOffsetDriver(),
station.getEastOffsetDriver(),
station.getNorthOffsetDriver(),
station.getZenithOffsetDriver(),
......@@ -124,7 +125,7 @@ public class AngularRaDec extends AbstractMeasurement<AngularRaDec> {
// Parameters:
// - 0..2 - Position of the spacecraft in inertial frame
// - 3..5 - Velocity of the spacecraft in inertial frame
// - 6..n - station parameters (station offsets, pole, prime meridian...)
// - 6..n - station parameters (clock offset, station offsets, pole, prime meridian...)
// Get the number of parameters used for derivation
// Place the selected drivers into a map
......@@ -144,11 +145,10 @@ public class AngularRaDec extends AbstractMeasurement<AngularRaDec> {
// Transform between station and inertial frame, expressed as a derivative structure
// The components of station's position in offset frame are the 3 last derivative parameters
final AbsoluteDate downlinkDate = getDate();
final FieldAbsoluteDate<DerivativeStructure> downlinkDateDS =
new FieldAbsoluteDate<>(field, downlinkDate);
final FieldTransform<DerivativeStructure> offsetToInertialDownlink =
station.getOffsetToInertial(state.getFrame(), downlinkDateDS, factory, indices);
station.getOffsetToInertial(state.getFrame(), getDate(), factory, indices);
final FieldAbsoluteDate<DerivativeStructure> downlinkDateDS =
offsetToInertialDownlink.getFieldDate();
// Station position/velocity in inertial frame at end of the downlink leg
final TimeStampedFieldPVCoordinates<DerivativeStructure> stationDownlink =
......@@ -163,7 +163,7 @@ public class AngularRaDec extends AbstractMeasurement<AngularRaDec> {
final DerivativeStructure tauD = signalTimeOfFlight(pvaDS, stationDownlink.getPosition(), downlinkDateDS);
// Transit state
final double delta = downlinkDate.durationFrom(state.getDate());
final DerivativeStructure delta = downlinkDateDS.durationFrom(state.getDate());
final DerivativeStructure deltaMTauD = tauD.negate().add(delta);
final SpacecraftState transitState = state.shiftedBy(deltaMTauD.getValue());
......
......@@ -88,6 +88,7 @@ public class Phase extends AbstractMeasurement<Phase> {
final double phase, final double wavelength, final double sigma,
final double baseWeight, final int propagatorIndex) {
super(date, phase, sigma, baseWeight, Arrays.asList(propagatorIndex),
station.getClockOffsetDriver(),
station.getEastOffsetDriver(),
station.getNorthOffsetDriver(),
station.getZenithOffsetDriver(),
......@@ -123,7 +124,7 @@ public class Phase extends AbstractMeasurement<Phase> {
// Parameters:
// - 0..2 - Position of the spacecraft in inertial frame
// - 3..5 - Velocity of the spacecraft in inertial frame
// - 6..n - station parameters (station offsets, pole, prime meridian...)
// - 6..n - station parameters (clock offset, station offsets, pole, prime meridian...)
int nbParams = 6;
final Map<String, Integer> indices = new HashMap<>();
for (ParameterDriver driver : getParametersDrivers()) {
......@@ -140,11 +141,10 @@ public class Phase extends AbstractMeasurement<Phase> {
// transform between station and inertial frame, expressed as a derivative structure
// The components of station's position in offset frame are the 3 last derivative parameters
final AbsoluteDate downlinkDate = getDate();
final FieldAbsoluteDate<DerivativeStructure> downlinkDateDS =
new FieldAbsoluteDate<>(field, downlinkDate);
final FieldTransform<DerivativeStructure> offsetToInertialDownlink =
station.getOffsetToInertial(state.getFrame(), downlinkDateDS, factory, indices);
station.getOffsetToInertial(state.getFrame(), getDate(), factory, indices);
final FieldAbsoluteDate<DerivativeStructure> downlinkDateDS =
offsetToInertialDownlink.getFieldDate();
// Station position in inertial frame at end of the downlink leg
final TimeStampedFieldPVCoordinates<DerivativeStructure> stationDownlink =
......@@ -159,7 +159,7 @@ public class Phase extends AbstractMeasurement<Phase> {
final DerivativeStructure tauD = signalTimeOfFlight(pvaDS, stationDownlink.getPosition(), downlinkDateDS);
// Transit state & Transit state (re)computed with derivative structures
final double delta = downlinkDate.durationFrom(state.getDate());
final DerivativeStructure delta = downlinkDateDS.durationFrom(state.getDate());
final DerivativeStructure deltaMTauD = tauD.negate().add(delta);
final SpacecraftState transitState = state.shiftedBy(deltaMTauD.getValue());
final TimeStampedFieldPVCoordinates<DerivativeStructure> transitStateDS = pvaDS.shiftedBy(deltaMTauD);
......
......@@ -131,6 +131,7 @@ public class Range extends AbstractMeasurement<Range> {
final double range, final double sigma, final double baseWeight,
final int propagatorIndex) {
super(date, range, sigma, baseWeight, Arrays.asList(propagatorIndex),
station.getClockOffsetDriver(),
station.getEastOffsetDriver(),
station.getNorthOffsetDriver(),
station.getZenithOffsetDriver(),
......@@ -173,7 +174,7 @@ public class Range extends AbstractMeasurement<Range> {
// Parameters:
// - 0..2 - Position of the spacecraft in inertial frame
// - 3..5 - Velocity of the spacecraft in inertial frame
// - 6..n - station parameters (station offsets, pole, prime meridian...)
// - 6..n - measurements parameters (clock offset, station offsets, pole, prime meridian...)
int nbParams = 6;
final Map<String, Integer> indices = new HashMap<>();
for (ParameterDriver driver : getParametersDrivers()) {
......@@ -190,11 +191,9 @@ public class Range extends AbstractMeasurement<Range> {
// transform between station and inertial frame, expressed as a derivative structure
// The components of station's position in offset frame are the 3 last derivative parameters
final AbsoluteDate downlinkDate = getDate();
final FieldAbsoluteDate<DerivativeStructure> downlinkDateDS =
new FieldAbsoluteDate<>(field, downlinkDate);
final FieldTransform<DerivativeStructure> offsetToInertialDownlink =
station.getOffsetToInertial(state.getFrame(), downlinkDateDS, factory, indices);
station.getOffsetToInertial(state.getFrame(), getDate(), factory, indices);
final FieldAbsoluteDate<DerivativeStructure> downlinkDateDS = offsetToInertialDownlink.getFieldDate();
// Station position in inertial frame at end of the downlink leg
final TimeStampedFieldPVCoordinates<DerivativeStructure> stationDownlink =
......@@ -209,7 +208,7 @@ public class Range extends AbstractMeasurement<Range> {
final DerivativeStructure tauD = signalTimeOfFlight(pvaDS, stationDownlink.getPosition(), downlinkDateDS);
// Transit state & Transit state (re)computed with derivative structures
final double delta = downlinkDate.durationFrom(state.getDate());
final DerivativeStructure delta = downlinkDateDS.durationFrom(state.getDate());
final DerivativeStructure deltaMTauD = tauD.negate().add(delta);
final SpacecraftState transitState = state.shiftedBy(deltaMTauD.getValue());
final TimeStampedFieldPVCoordinates<DerivativeStructure> transitStateDS = pvaDS.shiftedBy(deltaMTauD);
......
......@@ -92,6 +92,7 @@ public class RangeRate extends AbstractMeasurement<RangeRate> {
final boolean twoway,
final int propagatorIndex) {
super(date, rangeRate, sigma, baseWeight, Arrays.asList(propagatorIndex),
station.getClockOffsetDriver(),
station.getEastOffsetDriver(),
station.getNorthOffsetDriver(),
station.getZenithOffsetDriver(),
......@@ -133,7 +134,7 @@ public class RangeRate extends AbstractMeasurement<RangeRate> {
// Parameters:
// - 0..2 - Position of the spacecraft in inertial frame
// - 3..5 - Velocity of the spacecraft in inertial frame
// - 6..n - station parameters (station offsets, pole, prime meridian...)
// - 6..n - station parameters (clock offset, station offsets, pole, prime meridian...)
int nbParams = 6;
final Map<String, Integer> indices = new HashMap<>();
for (ParameterDriver driver : getParametersDrivers()) {
......@@ -150,11 +151,10 @@ public class RangeRate extends AbstractMeasurement<RangeRate> {
// transform between station and inertial frame, expressed as a derivative structure
// The components of station's position in offset frame are the 3 last derivative parameters
final AbsoluteDate downlinkDate = getDate();
final FieldAbsoluteDate<DerivativeStructure> downlinkDateDS =
new FieldAbsoluteDate<>(field, downlinkDate);
final FieldTransform<DerivativeStructure> offsetToInertialDownlink =
station.getOffsetToInertial(state.getFrame(), downlinkDateDS, factory, indices);
station.getOffsetToInertial(state.getFrame(), getDate(), factory, indices);
final FieldAbsoluteDate<DerivativeStructure> downlinkDateDS =
offsetToInertialDownlink.getFieldDate();
// Station position in inertial frame at end of the downlink leg
final TimeStampedFieldPVCoordinates<DerivativeStructure> stationDownlink =
......@@ -169,7 +169,7 @@ public class RangeRate extends AbstractMeasurement<RangeRate> {
final DerivativeStructure tauD = signalTimeOfFlight(pvaDS, stationDownlink.getPosition(), downlinkDateDS);
// Transit state
final double delta = downlinkDate.durationFrom(state.getDate());
final DerivativeStructure delta = downlinkDateDS.durationFrom(state.getDate());
final DerivativeStructure deltaMTauD = tauD.negate().add(delta);
final SpacecraftState transitState = state.shiftedBy(deltaMTauD.getValue());
......@@ -183,10 +183,11 @@ public class RangeRate extends AbstractMeasurement<RangeRate> {
final EstimatedMeasurement<RangeRate> estimated;
if (twoway) {
// one-way (uplink) light time correction
final AbsoluteDate approxUplinkDate = downlinkDate.shiftedBy(-2 * tauD.getValue());
final FieldAbsoluteDate<DerivativeStructure> approxUplinkDateDS = new FieldAbsoluteDate<>(field, approxUplinkDate);
final FieldTransform<DerivativeStructure> offsetToInertialApproxUplink =
station.getOffsetToInertial(state.getFrame(), approxUplinkDateDS, factory, indices);
station.getOffsetToInertial(state.getFrame(),
downlinkDateDS.shiftedBy(tauD.multiply(-2)), factory, indices);
final FieldAbsoluteDate<DerivativeStructure> approxUplinkDateDS =
offsetToInertialApproxUplink.getFieldDate();
final TimeStampedFieldPVCoordinates<DerivativeStructure> stationApproxUplink =
offsetToInertialApproxUplink.transformPVCoordinates(new TimeStampedFieldPVCoordinates<>(approxUplinkDateDS,
......
......@@ -98,6 +98,7 @@ public class TurnAroundRange extends AbstractMeasurement<TurnAroundRange> {
final double sigma, final double baseWeight,
final int propagatorIndex) {
super(date, turnAroundRange, sigma, baseWeight, Arrays.asList(propagatorIndex),
masterStation.getClockOffsetDriver(),
masterStation.getEastOffsetDriver(),
masterStation.getNorthOffsetDriver(),
masterStation.getZenithOffsetDriver(),
......@@ -107,6 +108,7 @@ public class TurnAroundRange extends AbstractMeasurement<TurnAroundRange> {
masterStation.getPolarDriftXDriver(),
masterStation.getPolarOffsetYDriver(),
masterStation.getPolarDriftYDriver(),
// the slave station clock is not used at all, we ignore the corresponding parameter driver
slaveStation.getEastOffsetDriver(),
slaveStation.getNorthOffsetDriver(),
slaveStation.getZenithOffsetDriver(),
......@@ -149,7 +151,7 @@ public class TurnAroundRange extends AbstractMeasurement<TurnAroundRange> {
//
// - 0..2 - Position of the spacecraft in inertial frame
// - 3..5 - Velocity of the spacecraft in inertial frame
// - 6..n - stations' parameters (stations' offsets, pole, prime meridian...)
// - 6..n - stations' parameters (clock offset, station offsets, pole, prime meridian...)
int nbParams = 6;
final Map<String, Integer> indices = new HashMap<>();
for (ParameterDriver driver : getParametersDrivers()) {
......@@ -188,18 +190,18 @@ public class TurnAroundRange extends AbstractMeasurement<TurnAroundRange> {
// Time difference between t (date of the measurement) and t' (date tagged in spacecraft state)
// (if state has already been set up to pre-compensate propagation delay,
// we will have delta = masterTauD + slaveTauU)
final AbsoluteDate measurementDate = getDate();
final FieldAbsoluteDate<DerivativeStructure> measurementDateDS = new FieldAbsoluteDate<>(field, measurementDate);
final double delta = measurementDate.durationFrom(state.getDate());
final double delta = getDate().durationFrom(state.getDate());
// transform between master station topocentric frame (east-north-zenith) and inertial frame expressed as DerivativeStructures
final FieldTransform<DerivativeStructure> masterToInert =
masterStation.getOffsetToInertial(state.getFrame(), measurementDateDS, factory, indices);
masterStation.getOffsetToInertial(state.getFrame(), getDate(), factory, indices);
final FieldAbsoluteDate<DerivativeStructure> measurementDateDS =
masterToInert.getFieldDate();
// Master station PV in inertial frame at measurement date
final TimeStampedFieldPVCoordinates<DerivativeStructure> masterArrival =
masterToInert.transformPVCoordinates(new TimeStampedPVCoordinates(measurementDate,
PVCoordinates.ZERO));
masterToInert.transformPVCoordinates(new TimeStampedFieldPVCoordinates<>(measurementDateDS,
zero, zero, zero));
// Compute propagation times
final DerivativeStructure masterTauD = signalTimeOfFlight(pvaDS, masterArrival.getPosition(), measurementDateDS);
......
......@@ -178,7 +178,8 @@ public class RangeIonosphericDelayModifier implements EstimationModifier<Range>
}
estimated.setStateDerivatives(0, stateDerivatives);
for (final ParameterDriver driver : Arrays.asList(station.getEastOffsetDriver(),
for (final ParameterDriver driver : Arrays.asList(station.getClockOffsetDriver(),
station.getEastOffsetDriver(),
station.getNorthOffsetDriver(),
station.getZenithOffsetDriver())) {
if (driver.isSelected()) {
......
......@@ -216,7 +216,8 @@ public class RangeRateIonosphericDelayModifier implements EstimationModifier<Ran
}
estimated.setStateDerivatives(0, stateDerivatives);
for (final ParameterDriver driver : Arrays.asList(station.getEastOffsetDriver(),
for (final ParameterDriver driver : Arrays.asList(station.getClockOffsetDriver(),
station.getEastOffsetDriver(),
station.getNorthOffsetDriver(),
station.getZenithOffsetDriver())) {
if (driver.isSelected()) {
......
......@@ -215,7 +215,8 @@ public class RangeRateTroposphericDelayModifier implements EstimationModifier<Ra
}
estimated.setStateDerivatives(0, stateDerivatives);
for (final ParameterDriver driver : Arrays.asList(station.getEastOffsetDriver(),
for (final ParameterDriver driver : Arrays.asList(station.getClockOffsetDriver(),
station.getEastOffsetDriver(),
station.getNorthOffsetDriver(),
station.getZenithOffsetDriver())) {
if (driver.isSelected()) {
......
......@@ -183,7 +183,8 @@ public class RangeTroposphericDelayModifier implements EstimationModifier<Range>
}
estimated.setStateDerivatives(0, stateDerivatives);
for (final ParameterDriver driver : Arrays.asList(station.getEastOffsetDriver(),
for (final ParameterDriver driver : Arrays.asList(station.getClockOffsetDriver(),
station.getEastOffsetDriver(),
station.getNorthOffsetDriver(),
station.getZenithOffsetDriver())) {
if (driver.isSelected()) {
......
......@@ -179,7 +179,8 @@ public class TurnAroundRangeIonosphericDelayModifier implements EstimationModifi
estimated.setStateDerivatives(0, stateDerivatives);
// Update derivatives with respect to master station position
for (final ParameterDriver driver : Arrays.asList(masterStation.getEastOffsetDriver(),
for (final ParameterDriver driver : Arrays.asList(masterStation.getClockOffsetDriver(),
masterStation.getEastOffsetDriver(),
masterStation.getNorthOffsetDriver(),
masterStation.getZenithOffsetDriver())) {
if (driver.isSelected()) {
......
......@@ -181,7 +181,8 @@ public class TurnAroundRangeTroposphericDelayModifier implements EstimationModif
estimated.setStateDerivatives(0, stateDerivatives);
// Update derivatives with respect to master station position
for (final ParameterDriver driver : Arrays.asList(masterStation.getEastOffsetDriver(),
for (final ParameterDriver driver : Arrays.asList(masterStation.getClockOffsetDriver(),
masterStation.getEastOffsetDriver(),
masterStation.getNorthOffsetDriver(),
masterStation.getZenithOffsetDriver())) {
if (driver.isSelected()) {
......
......@@ -208,7 +208,7 @@ discrete events. Here is a short list of the features offered by the library:</p
<li>orbital parameters estimation (or only a subset if desired)</li>
<li>force model parameters estimation (drag coefficients, radiation pressure coefficients,
central attraction, maneuver thrust or flow rate)</li>
<li>measurements parameters estimation (biases, station position, pole motion and rate,
<li>measurements parameters estimation (biases, station clock offset, station position, pole motion and rate,
prime meridian correction and rate)</li>
</ul>
</li>
......
......@@ -185,7 +185,7 @@
* orbital parameters estimation (or only a subset if desired)
* force model parameters estimation (drag coefficients, radiation pressure coefficients,
central attraction, maneuver thrust or flow rate)
* measurements parameters estimation (biases, station position, pole motion and rate,
* measurements parameters estimation (biases, station clock offset, station position, pole motion and rate,
prime meridian correction and rate)
* multi-satellites orbit determination
......
......@@ -21,6 +21,9 @@
</properties>
<body>
<release version="TBD" date="TBD" description="TBD">
<action dev="luc" type="add" issue="513">
Added clock offset parameter at ground stations level for orbit determination.
</action>
<action dev="luc" type="fix" issue="510">
Fixed dropped derivatives in TimeStampedFieldPVCoordinates.shiftedBy(dt).
</action>
......
......@@ -295,8 +295,7 @@ public class EstimationTestUtils {
final double expectedRMS, final double rmsEps,
final double expectedMax, final double maxEps,
final double expectedDeltaPos, final double posEps,
final double expectedDeltaVel, final double velEps)
{
final double expectedDeltaVel, final double velEps) {
final Orbit estimatedOrbit = estimator.estimate()[0].getInitialState().getOrbit();
final Vector3D estimatedPosition = estimatedOrbit.getPVCoordinates().getPosition();
......
......@@ -187,8 +187,7 @@ public class BatchLSEstimatorTest {
ParameterDriversList estimatedOrbitalParameters,
ParameterDriversList estimatedPropagatorParameters,
ParameterDriversList estimatedMeasurementsParameters,
EstimationsProvider evaluationsProvider, Evaluation lspEvaluation)
{
EstimationsProvider evaluationsProvider, Evaluation lspEvaluation) {
if (iterationsCount == lastIter) {
Assert.assertEquals(lastEval + 1, evaluationscount);
} else {
......@@ -262,7 +261,7 @@ public class BatchLSEstimatorTest {
propagatorBuilder);
final List<ObservedMeasurement<?>> measurements =
EstimationTestUtils.createMeasurements(propagator,
new RangeMeasurementCreator(context, antennaPhaseCenter),
new RangeMeasurementCreator(context, antennaPhaseCenter, 0.0),
1.0, 3.0, 300.0);
// create orbit estimator
......@@ -286,8 +285,7 @@ public class BatchLSEstimatorTest {
ParameterDriversList estimatedOrbitalParameters,
ParameterDriversList estimatedPropagatorParameters,
ParameterDriversList estimatedMeasurementsParameters,
EstimationsProvider evaluationsProvider, Evaluation lspEvaluation)
{
EstimationsProvider evaluationsProvider, Evaluation lspEvaluation) {
if (iterationsCount == lastIter) {
Assert.assertEquals(lastEval + 1, evaluationscount);
} else {
......@@ -404,8 +402,7 @@ public class BatchLSEstimatorTest {
ParameterDriversList estimatedOrbitalParameters,
ParameterDriversList estimatedPropagatorParameters,
ParameterDriversList estimatedMeasurementsParameters,
EstimationsProvider evaluationsProvider, Evaluation lspEvaluation)
{
EstimationsProvider evaluationsProvider, Evaluation lspEvaluation) {
if (iterationsCount == lastIter) {
Assert.assertEquals(lastEval + 1, evaluationscount);
} else {
......@@ -468,7 +465,7 @@ public class BatchLSEstimatorTest {
0.0, 2.3e-06,
0.0, 6.6e-06,
0.0, 6.4e-07,
0.0, 2.8e-10);
0.0, 2.9e-10);
final Orbit determined = new KeplerianOrbit(parameters.get( 6).getValue(),
parameters.get( 7).getValue(),
......@@ -613,8 +610,7 @@ public class BatchLSEstimatorTest {
ParameterDriversList estimatedOrbitalParameters,
ParameterDriversList estimatedPropagatorParameters,
ParameterDriversList estimatedMeasurementsParameters,
EstimationsProvider evaluationsProvider, Evaluation lspEvaluation)
{
EstimationsProvider evaluationsProvider, Evaluation lspEvaluation) {
if (iterationsCount == lastIter) {
Assert.assertEquals(lastEval + 1, evaluationscount);
} else {
......@@ -734,7 +730,7 @@ public class BatchLSEstimatorTest {
ParameterDriversList estimatedOrbitalParameters,
ParameterDriversList estimatedPropagatorParameters,
ParameterDriversList estimatedMeasurementsParameters,
EstimationsProvider evaluationsProvider, Evaluation lspEvaluation) throws DummyException {
EstimationsProvider evaluationsProvider, Evaluation lspEvaluation) {
throw new DummyException();
}
});
......
......@@ -1067,6 +1067,10 @@ public class OrbitDeterminationTest {
final double[] stationLatitudes = parser.getAngleArray(ParameterKey.GROUND_STATION_LATITUDE);
final double[] stationLongitudes = parser.getAngleArray(ParameterKey.GROUND_STATION_LONGITUDE);
final double[] stationAltitudes = parser.getDoubleArray(ParameterKey.GROUND_STATION_ALTITUDE);
final double[] stationClockOffsets = parser.getDoubleArray(ParameterKey.GROUND_STATION_CLOCK_OFFSET);
final double[] stationClockOffsetsMin = parser.getDoubleArray(ParameterKey.GROUND_STATION_CLOCK_OFFSET_MIN);
final double[] stationClockOffsetsMax = parser.getDoubleArray(ParameterKey.GROUND_STATION_CLOCK_OFFSET_MAX);
final boolean[] stationClockOffsetEstimated = parser.getBooleanArray(ParameterKey.GROUND_STATION_CLOCK_OFFSET_ESTIMATED);
final boolean[] stationPositionEstimated = parser.getBooleanArray(ParameterKey.GROUND_STATION_POSITION_ESTIMATED);
final double[] stationRangeSigma = parser.getDoubleArray(ParameterKey.GROUND_STATION_RANGE_SIGMA);
final double[] stationRangeBias = parser.getDoubleArray(ParameterKey.GROUND_STATION_RANGE_BIAS);
......@@ -1150,6 +1154,10 @@ public class OrbitDeterminationTest {
stationAltitudes[i]);
final TopocentricFrame topo = new TopocentricFrame(body, position, stationNames[i]);
final GroundStation station = new GroundStation(topo, eopHistory, displacements);
station.getClockOffsetDriver().setValue(stationClockOffsets[i]);
station.getClockOffsetDriver().setMinValue(stationClockOffsetsMin[i]);
station.getClockOffsetDriver().setMaxValue(stationClockOffsetsMax[i]);
station.getClockOffsetDriver().setSelected(stationClockOffsetEstimated[i]);
station.getEastOffsetDriver().setSelected(stationPositionEstimated[i]);
station.getNorthOffsetDriver().setSelected(stationPositionEstimated[i]);
station.getZenithOffsetDriver().setSelected(stationPositionEstimated[i]);
......@@ -2380,6 +2388,10 @@ public class OrbitDeterminationTest {
GROUND_STATION_LATITUDE,
GROUND_STATION_LONGITUDE,
GROUND_STATION_ALTITUDE,
GROUND_STATION_CLOCK_OFFSET,
GROUND_STATION_CLOCK_OFFSET_MIN,
GROUND_STATION_CLOCK_OFFSET_MAX,
GROUND_STATION_CLOCK_OFFSET_ESTIMATED,
GROUND_STATION_POSITION_ESTIMATED,
GROUND_STATION_RANGE_SIGMA,
GROUND_STATION_RANGE_BIAS,
......
......@@ -41,7 +41,8 @@ public class AngularAzElMeasurementCreator extends MeasurementCreator {
public void init(SpacecraftState s0, AbsoluteDate t, double step) {
for (final GroundStation station : context.stations) {
for (ParameterDriver driver : Arrays.asList(station.getEastOffsetDriver(),
for (ParameterDriver driver : Arrays.asList(station.getClockOffsetDriver(),
station.getEastOffsetDriver(),
station.getNorthOffsetDriver(),
station.getZenithOffsetDriver(),
station.getPrimeMeridianOffsetDriver(),
......
......@@ -205,6 +205,7 @@ public class AngularAzElTest {
// create perfect azimuth-elevation measurements
for (final GroundStation station : context.stations) {
station.getClockOffsetDriver().setSelected(true);
station.getEastOffsetDriver().setSelected(true);
station.getNorthOffsetDriver().setSelected(true);
station.getZenithOffsetDriver().setSelected(true);
......
......@@ -42,7 +42,8 @@ public class AngularRaDecMeasurementCreator extends MeasurementCreator {
public void init(SpacecraftState s0, AbsoluteDate t, double step) {
for (final GroundStation station : context.stations) {
for (ParameterDriver driver : Arrays.asList(station.getEastOffsetDriver(),
for (ParameterDriver driver : Arrays.asList(station.getClockOffsetDriver(),
station.getEastOffsetDriver(),
station.getNorthOffsetDriver(),
station.getZenithOffsetDriver(),
station.getPrimeMeridianOffsetDriver(),
......
......@@ -205,6 +205,7 @@ public class AngularRaDecTest {
// create perfect right-ascension/declination measurements
for (final GroundStation station : context.stations) {
station.getClockOffsetDriver().setSelected(true);
station.getEastOffsetDriver().setSelected(true);
station.getNorthOffsetDriver().setSelected(true);
station.getZenithOffsetDriver().setSelected(true);
......
......@@ -57,7 +57,8 @@ public class PhaseMeasurementCreator extends MeasurementCreator {
public void init(SpacecraftState s0, AbsoluteDate t, double step) {
for (final GroundStation station : context.stations) {
for (ParameterDriver driver : Arrays.asList(station.getEastOffsetDriver(),
for (ParameterDriver driver : Arrays.asList(station.getClockOffsetDriver(),
station.getEastOffsetDriver(),
station.getNorthOffsetDriver(),
station.getZenithOffsetDriver(),
station.getPrimeMeridianOffsetDriver(),
......
......@@ -121,8 +121,8 @@ public class PhaseTest {
System.out.println("\nTest Phase Parameter Derivatives - Finite Differences Comparison\n");
}
// Run test
double refErrorsMedian = 1.1e-8;
double refErrorsMean = 8.2e-8;
double refErrorsMedian = 5.9e-9;
double refErrorsMean = 6.4e-8;
double refErrorsMax = 5.1e-6;
this.genericTestParameterDerivatives(printResults,
refErrorsMedian, refErrorsMean, refErrorsMax);
......@@ -133,8 +133,7 @@ public class PhaseTest {
* Generic test function for values of the phase
* @param printResults Print the results ?
*/
void genericTestValues(final boolean printResults)
{
void genericTestValues(final boolean printResults) {
Context context = EstimationTestUtils.eccentricContext("regular-data:potential:tides");
......@@ -166,8 +165,7 @@ public class PhaseTest {
// Play test if the measurement date is between interpolator previous and current date
if ((measurement.getDate().durationFrom(interpolator.getPreviousState().getDate()) > 0.) &&
(measurement.getDate().durationFrom(interpolator.getCurrentState().getDate()) <= 0.)
) {
(measurement.getDate().durationFrom(interpolator.getCurrentState().getDate()) <= 0.)) {
// We intentionally propagate to a date which is close to the
// real spacecraft state but is *not* the accurate date, by
// compensating only part of the downlink delay. This is done
......@@ -259,8 +257,7 @@ public class PhaseTest {
void genericTestStateDerivatives(final boolean printResults,
final double refErrorsPMedian, final double refErrorsPMean, final double refErrorsPMax,
final double refErrorsVMedian, final double refErrorsVMean, final double refErrorsVMax)
{
final double refErrorsVMedian, final double refErrorsVMean, final double refErrorsVMax) {
Context context = EstimationTestUtils.eccentricContext("regular-data:potential:tides");
......@@ -292,8 +289,7 @@ public class PhaseTest {
// Play test if the measurement date is between interpolator previous and current date
if ((measurement.getDate().durationFrom(interpolator.getPreviousState().getDate()) > 0.) &&
(measurement.getDate().durationFrom(interpolator.getCurrentState().getDate()) <= 0.)
) {
(measurement.getDate().durationFrom(interpolator.getCurrentState().getDate()) <= 0.)) {
// We intentionally propagate to a date which is close to the
// real spacecraft state but is *not* the accurate date, by
......@@ -337,15 +333,15 @@ public class PhaseTest {
if (printResults) {
String stationName = ((Phase) measurement).getStation().getBaseFrame().getName();
System.out.format(Locale.US, "%-15s %-23s %-23s " +
"%10.3e %10.3e %10.3e " +
"%10.3e %10.3e %10.3e " +
"%10.3e %10.3e %10.3e " +
"%10.3e %10.3e %10.3e%n",
stationName, measurement.getDate(), date,
dJacobian[0][0], dJacobian[0][1], dJacobian[0][2],
dJacobian[0][3], dJacobian[0][4], dJacobian[0][5],
dJacobianRelative[0][0], dJacobianRelative[0][1], dJacobianRelative[0][2],
dJacobianRelative[0][3], dJacobianRelative[0][4], dJacobianRelative[0][5]);
"%10.3e %10.3e %10.3e " +
"%10.3e %10.3e %10.3e " +
"%10.3e %10.3e %10.3e " +
"%10.3e %10.3e %10.3e%n",
stationName, measurement.getDate(), date,
dJacobian[0][0], dJacobian[0][1], dJacobian[0][2],
dJacobian[0][3], dJacobian[0][4], dJacobian[0][5],
dJacobianRelative[0][0], dJacobianRelative[0][1], dJacobianRelative[0][2],
dJacobianRelative[0][3], dJacobianRelative[0][4], dJacobianRelative[0][5]);
}
} // End if measurement date between previous and current interpolator step
} // End for loop on the measurements
......@@ -402,8 +398,7 @@ public class PhaseTest {
}
void genericTestParameterDerivatives(final boolean printResults,
final double refErrorsMedian, final double refErrorsMean, final double refErrorsMax)
{
final double refErrorsMedian, final double refErrorsMean, final double refErrorsMax) {
Context context = EstimationTestUtils.eccentricContext("regular-data:potential:tides");
......@@ -413,6 +408,7 @@ public class PhaseTest {
// Create perfect range measurements
for (final GroundStation station : context.stations) {
station.getClockOffsetDriver().setSelected(true);
station.getEastOffsetDriver().setSelected(true);
station.getNorthOffsetDriver().setSelected(true);
station.getZenithOffsetDriver().setSelected(true);
......@@ -438,8 +434,7 @@ public class PhaseTest {
// Play test if the measurement date is between interpolator previous and current date
if ((measurement.getDate().durationFrom(interpolator.getPreviousState().getDate()) > 0.) &&
(measurement.getDate().durationFrom(interpolator.getCurrentState().getDate()) <= 0.)
) {
(measurement.getDate().durationFrom(interpolator.getCurrentState().getDate()) <= 0.)) {
// Parameter corresponding to station position offset
final GroundStation stationParameter = ((Phase) measurement).getStation();
......@@ -455,6 +450,7 @@ public class PhaseTest {
final AbsoluteDate date = measurement.getDate().shiftedBy(-0.75 * meanDelay);
final SpacecraftState state = interpolator.getInterpolatedState(date);
final ParameterDriver[] drivers = new ParameterDriver[] {
stationParameter.getClockOffsetDriver(),
stationParameter.getEastOffsetDriver(),
stationParameter.getNorthOffsetDriver(),
stationParameter.getZenithOffsetDriver()
......@@ -466,7 +462,7 @@ public class PhaseTest {
stationName, measurement.getDate(), date);
}
for (int i = 0; i < 3; ++i) {
for (int i = 0; i < drivers.length; ++i) {
final double[] gradient = measurement.estimate(0, 0, new SpacecraftState[] { state }).getParameterDerivatives(drivers[i]);
Assert.assertEquals(1, measurement.getDimension());
Assert.assertEquals(1, gradient.length);
......@@ -507,12 +503,12 @@ public class PhaseTest {
// Print results ? Header
if (printResults) {
System.out.format(Locale.US, "%-15s %-23s %-23s " +
"%10s %10s %10s " +
"%10s %10s %10s%n",
"Station", "Measurement Date", "State Date",
"ΔdQx", "rel ΔdQx",
"ΔdQy", "rel ΔdQy",
"ΔdQz", "rel ΔdQz");