Commit f1aacd44 authored by Bryan Cazabonne's avatar Bryan Cazabonne

Work in progress.

parent 8ec4df0d
......@@ -16,7 +16,6 @@
*/
package org.orekit.estimation.measurements.modifiers;
import java.util.Collections;
import java.util.List;
import org.hipparchus.geometry.euclidean.threed.Vector3D;
......@@ -26,7 +25,7 @@ import org.orekit.estimation.measurements.EstimatedMeasurement;
import org.orekit.estimation.measurements.EstimationModifier;
import org.orekit.estimation.measurements.GroundStation;
import org.orekit.frames.Frame;
import org.orekit.models.earth.TroposphericModel;
import org.orekit.models.earth.DiscreteTroposphericModel;
import org.orekit.propagation.SpacecraftState;
import org.orekit.time.AbsoluteDate;
import org.orekit.utils.Constants;
......@@ -47,13 +46,13 @@ import org.orekit.utils.ParameterDriver;
public class AngularTroposphericDelayModifier implements EstimationModifier<AngularAzEl> {
/** Tropospheric delay model. */
private final TroposphericModel tropoModel;
private final DiscreteTroposphericModel tropoModel;
/** Constructor.
*
* @param model Tropospheric delay model appropriate for the current angular measurement method.
*/
public AngularTroposphericDelayModifier(final TroposphericModel model) {
public AngularTroposphericDelayModifier(final DiscreteTroposphericModel model) {
tropoModel = model;
}
......@@ -89,7 +88,7 @@ public class AngularTroposphericDelayModifier implements EstimationModifier<Angu
final double height = getStationHeightAMSL(station);
// delay in meters
final double delay = tropoModel.pathDelay(elevation, height);
final double delay = tropoModel.pathDelay(elevation, height, tropoModel.getParameters(), state.getDate());
// one-way measurement.
return delay;
......@@ -101,7 +100,7 @@ public class AngularTroposphericDelayModifier implements EstimationModifier<Angu
/** {@inheritDoc} */
@Override
public List<ParameterDriver> getParametersDrivers() {
return Collections.emptyList();
return tropoModel.getParametersDrivers();
}
@Override
......
......@@ -37,8 +37,8 @@ import org.orekit.utils.ParameterDriver;
* computed thanks to a {@link #model} initialized by the user.
* The user has the possiblility to use several mapping function models for the computations:
* the {@link GlobalMappingFunctionModel Global Mapping Function},
* the {@link NiellMappingFunctionModel Niell Mapping Function}
* or the {@link MendesPavlisModel Mendes & Pavlis} model for the optical wavelenghts.
* the {@link NiellMappingFunctionModel Niell Mapping Function} for the radio wavelengths
* or the {@link MendesPavlisModel Mendes & Pavlis} model for the optical wavelengths.
* </p>
* @author Bryan Cazabonne
* */
......@@ -47,15 +47,9 @@ public class EstimatedTroposphericModel implements DiscreteTroposphericModel {
/** Name of one of the parameters of this model: the hydrostatic zenith delay. */
public static final String HYDROSTATIC_ZENITH_DELAY = "hydrostatic zenith delay";
/** Name of one of the parameters of this model: the slope hydrostatic zenith delay. */
public static final String SLOPE_HYDROSTATIC_ZENITH_DELAY = "slope hydrostatic zenith delay";
/** Name of one of the parameters of this model: the wet zenith delay. */
public static final String WET_ZENITH_DELAY = "wet zenith delay";
/** Name of one of the parameters of this model: the slope wet zenith delay. */
public static final String SLOPE_WET_ZENITH_DELAY = "slope wet zenith delay";
/** Serializable UID. */
private static final long serialVersionUID = -2348714833140436533L;
......@@ -63,36 +57,45 @@ public class EstimatedTroposphericModel implements DiscreteTroposphericModel {
private final MappingFunction model;
/** Driver for hydrostatic tropospheric delay parameter. */
private final ParameterDriver dhzParameterDriver;
private final ParameterDriver initDateDHZParameterDriver;
/** Driver for slope hydrostatic tropospheric delay parameter. */
private final ParameterDriver dhzSlopeParameterDriver;
/** Driver for hydrostatic tropospheric delay parameter. */
private final ParameterDriver endDateDHZParameterDriver;
/** Driver for wet tropospheric delay parameter. */
private final ParameterDriver dwzParameterDriver;
private final ParameterDriver initDateDWZParameterDriver;
/** Driver for wet tropospheric delay parameter. */
private final ParameterDriver dwzSlopeParameterDriver;
private final ParameterDriver endDateDWZParameterDriver;
/** Build a new instance.
* <p>
* By definition, init date and end date parameters have the same name.
* It is recommended to change the name of the parameters by adding a prefix with the reference date.
* </p>
* @param model mapping function model.
* @param dhz initial value for the hydrostatic zenith delay
* @param dwz initial value for the wet zenith delay
* @param hydroDelayInitDate initial value for the hydrostatic zenith delay (first date)
* @param hydroDelayEndDate initial value for the slope hydrostatic zenith delay (end date)
* @param wetDelayInitDate initial value for the wet zenith delay (first date)
* @param wetDelayEndDate initial value for the slope wet zenith delay (end date)
*/
public EstimatedTroposphericModel(final MappingFunction model,
final double dhz,
final double dwz) {
dhzParameterDriver = new ParameterDriver(EstimatedTroposphericModel.HYDROSTATIC_ZENITH_DELAY,
dhz, FastMath.scalb(1.0, -2), 0.0, Double.POSITIVE_INFINITY);
final double hydroDelayInitDate,
final double hydroDelayEndDate,
final double wetDelayInitDate,
final double wetDelayEndDate) {
dhzSlopeParameterDriver = new ParameterDriver(EstimatedTroposphericModel.SLOPE_HYDROSTATIC_ZENITH_DELAY,
0.0, FastMath.scalb(1.0, -20), Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY);
initDateDHZParameterDriver = new ParameterDriver(EstimatedTroposphericModel.HYDROSTATIC_ZENITH_DELAY,
hydroDelayInitDate, FastMath.scalb(1.0, -2), 0.0, 10.0);
dwzParameterDriver = new ParameterDriver(EstimatedTroposphericModel.WET_ZENITH_DELAY,
dwz, FastMath.scalb(1.0, -5), 0.0, Double.POSITIVE_INFINITY);
endDateDHZParameterDriver = new ParameterDriver(EstimatedTroposphericModel.HYDROSTATIC_ZENITH_DELAY,
hydroDelayEndDate, FastMath.scalb(1.0, -2), 0.0, 10.0);
dwzSlopeParameterDriver = new ParameterDriver(EstimatedTroposphericModel.SLOPE_WET_ZENITH_DELAY,
0.0, FastMath.scalb(1.0, -20), Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY);
initDateDWZParameterDriver = new ParameterDriver(EstimatedTroposphericModel.WET_ZENITH_DELAY,
wetDelayInitDate, FastMath.scalb(1.0, -3), 0.0, 1.0);
endDateDWZParameterDriver = new ParameterDriver(EstimatedTroposphericModel.WET_ZENITH_DELAY,
wetDelayEndDate, FastMath.scalb(1.0, -3), 0.0, 1.0);
this.model = model;
}
......@@ -138,10 +141,24 @@ public class EstimatedTroposphericModel implements DiscreteTroposphericModel {
/** {@inheritDoc} */
@Override
public double[] computeZenithDelay(final double height, final double[] parameters, final AbsoluteDate date) {
// Time intervals
final double dt1 = endDateDHZParameterDriver.getReferenceDate().durationFrom(date);
final double dt0 = date.durationFrom(initDateDHZParameterDriver.getReferenceDate());
final double dt = dt1 + dt0;
// Zenith delay
final double[] delays = new double[2];
final double dt = date.durationFrom(getParametersDrivers().get(0).getReferenceDate());
delays[0] = parameters[1] * dt + parameters[0];
delays[1] = parameters[3] * dt + parameters[2];
if (FastMath.abs(dt) < 0.001) {
// Constant model
delays[0] = parameters[0];
delays[1] = parameters[2];
} else {
// Linear model
delays[0] = (parameters[0] * dt1 + parameters[1] * dt0) / dt;
delays[1] = (parameters[2] * dt1 + parameters[3] * dt0) / dt;
}
return delays;
}
......@@ -149,22 +166,38 @@ public class EstimatedTroposphericModel implements DiscreteTroposphericModel {
@Override
public <T extends RealFieldElement<T>> T[] computeZenithDelay(final T height, final T[] parameters,
final FieldAbsoluteDate<T> date) {
// Field
final Field<T> field = date.getField();
// Time intervals
final T dt1 = date.durationFrom(endDateDHZParameterDriver.getReferenceDate()).negate();
final T dt0 = date.durationFrom(initDateDHZParameterDriver.getReferenceDate());
final T dt = dt1.add(dt0);
// Zenith delay
final T[] delays = MathArrays.buildArray(field, 2);
final T dt = date.durationFrom(getParametersDrivers().get(0).getReferenceDate());
delays[0] = parameters[1].multiply(dt).add(parameters[0]);
delays[1] = parameters[3].multiply(dt).add(parameters[2]);
if (FastMath.abs(dt).getReal() < 0.001) {
// Constant model
delays[0] = parameters[0];
delays[1] = parameters[2];
} else {
// Linear model
delays[0] = (parameters[0].multiply(dt1).add(parameters[1].multiply(dt0))).divide(dt);
delays[1] = (parameters[2].multiply(dt1).add(parameters[3].multiply(dt0))).divide(dt);
}
return delays;
}
/** {@inheritDoc} */
@Override
public List<ParameterDriver> getParametersDrivers() {
final List<ParameterDriver> list = new ArrayList<>(4);
list.add(0, dhzParameterDriver);
list.add(1, dhzSlopeParameterDriver);
list.add(2, dwzParameterDriver);
list.add(3, dwzSlopeParameterDriver);
final List<ParameterDriver> list = new ArrayList<ParameterDriver>(4);
list.add(0, initDateDHZParameterDriver);
list.add(1, endDateDHZParameterDriver);
list.add(2, initDateDWZParameterDriver);
list.add(3, endDateDWZParameterDriver);
return Collections.unmodifiableList(list);
}
......
......@@ -130,7 +130,7 @@ public class TurnAroundRangeAnalyticTest {
boolean isModifier = true;
boolean isFiniteDifferences = true;
genericTestStateDerivatives(isModifier, isFiniteDifferences, printResults,
6.2e-9, 1.9e-8, 3.5e-7, 7.3e-5, 3.4e-4, 1.2e-2);
6.4e-9, 2.8e-8, 7.6e-7, 7.5e-5, 2.6e-4, 0.5e-2);
}
/**
......
......@@ -156,7 +156,18 @@ ground.station.elevation.bias.min [0] = -0.50
ground.station.elevation.bias.max [0] = +0.50
ground.station.az.el.biases.estimated [0] = true
ground.station.elevation.refraction.correction [0] = true
ground.station.tropospheric.model.estimated [0] = false
ground.station.global.mapping.function [0] = false
ground.station.niell.mapping.function [0] = false
ground.station.hydrostatic.delay.value [0] = 2.25
ground.station.wet.delay.value [0] = 0.138
ground.station.slope.hydrostatic.delay.value [0] = 0.0
ground.station.slope.wet.delay.value [0] = 0.0
ground.station.range.tropospheric.correction [0] = true
ground.station.hydrostatic.delay [0] = false
ground.station.wet.delay [0] = false
ground.station.slope.hydrostatic.delay [0] = false
ground.station.slope.wet.delay [0] = false
ground.station.name [1] = GODL
ground.station.latitude [1] = 39.020605
......@@ -183,7 +194,18 @@ ground.station.elevation.bias.min [1] = -0.50
ground.station.elevation.bias.max [1] = +0.50
ground.station.az.el.biases.estimated [1] = false
ground.station.elevation.refraction.correction [1] = true
ground.station.tropospheric.model.estimated [1] = false
ground.station.global.mapping.function [1] = false
ground.station.niell.mapping.function [1] = false
ground.station.hydrostatic.delay.value [1] = 2.33
ground.station.wet.delay.value [1] = 0.011
ground.station.slope.hydrostatic.delay.value [1] = 0.0
ground.station.slope.wet.delay.value [1] = 0.0
ground.station.range.tropospheric.correction [1] = true
ground.station.hydrostatic.delay [1] = false
ground.station.wet.delay [1] = false
ground.station.slope.hydrostatic.delay [1] = false
ground.station.slope.wet.delay [1] = false
ground.station.name [2] = HA4T
......@@ -211,7 +233,18 @@ ground.station.elevation.bias.min [2] = -0.50
ground.station.elevation.bias.max [2] = +0.50
ground.station.az.el.biases.estimated [2] = false
ground.station.elevation.refraction.correction [2] = true
ground.station.tropospheric.model.estimated [2] = false
ground.station.global.mapping.function [2] = false
ground.station.niell.mapping.function [2] = false
ground.station.hydrostatic.delay.value [2] = 2.31
ground.station.wet.delay.value [2] = 0.137
ground.station.slope.hydrostatic.delay.value [2] = 0.0
ground.station.slope.wet.delay.value [2] = 0.0
ground.station.range.tropospheric.correction [2] = true
ground.station.hydrostatic.delay [2] = false
ground.station.wet.delay [2] = false
ground.station.slope.hydrostatic.delay [2] = false
ground.station.slope.wet.delay [2] = false
ground.station.name [3] = SISL
ground.station.latitude [3] = 33.577694
......@@ -238,7 +271,18 @@ ground.station.elevation.bias.min [3] = -0.50
ground.station.elevation.bias.max [3] = +0.50
ground.station.az.el.biases.estimated [3] = false
ground.station.elevation.refraction.correction [3] = true
ground.station.tropospheric.model.estimated [3] = false
ground.station.global.mapping.function [3] = false
ground.station.niell.mapping.function [3] = false
ground.station.hydrostatic.delay.value [3] = 2.25
ground.station.wet.delay.value [3] = 0.149
ground.station.slope.hydrostatic.delay.value [3] = 0.0
ground.station.slope.wet.delay.value [3] = 0.0
ground.station.range.tropospheric.correction [3] = true
ground.station.hydrostatic.delay [3] = false
ground.station.wet.delay [3] = false
ground.station.slope.hydrostatic.delay [3] = false
ground.station.slope.wet.delay [3] = false
......
......@@ -212,7 +212,18 @@ ground.station.elevation.bias.min [0] = -0.50
ground.station.elevation.bias.max [0] = +0.50
ground.station.az.el.biases.estimated [0] = true
ground.station.elevation.refraction.correction [0] = true
ground.station.tropospheric.model.estimated [0] = false
ground.station.global.mapping.function [0] = false
ground.station.niell.mapping.function [0] = false
ground.station.hydrostatic.delay.value [0] = 2.14
ground.station.wet.delay.value [0] = 0.127
ground.station.slope.hydrostatic.delay.value [0] = 0.0
ground.station.slope.wet.delay.value [0] = 0.0
ground.station.range.tropospheric.correction [0] = true
ground.station.hydrostatic.delay [0] = false
ground.station.wet.delay [0] = false
ground.station.slope.hydrostatic.delay [0] = false
ground.station.slope.wet.delay [0] = false
ground.station.name [1] = Kumsan
ground.station.latitude [1] = 36.1247623774
......@@ -239,7 +250,18 @@ ground.station.elevation.bias.min [1] = -0.50
ground.station.elevation.bias.max [1] = +0.50
ground.station.az.el.biases.estimated [1] = true
ground.station.elevation.refraction.correction [1] = true
ground.station.tropospheric.model.estimated [1] = false
ground.station.global.mapping.function [1] = false
ground.station.niell.mapping.function [1] = false
ground.station.hydrostatic.delay.value [1] = 2.27
ground.station.wet.delay.value [1] = 0.021
ground.station.slope.hydrostatic.delay.value [1] = 0.0
ground.station.slope.wet.delay.value [1] = 0.0
ground.station.range.tropospheric.correction [1] = true
ground.station.hydrostatic.delay [1] = false
ground.station.wet.delay [1] = false
ground.station.slope.hydrostatic.delay [1] = false
ground.station.slope.wet.delay [1] = false
ground.station.name [2] = Uralla
ground.station.latitude [2] = -30.632947613
......@@ -266,7 +288,18 @@ ground.station.elevation.bias.min [2] = -0.50
ground.station.elevation.bias.max [2] = +0.50
ground.station.az.el.biases.estimated [2] = true
ground.station.elevation.refraction.correction [2] = true
ground.station.tropospheric.model.estimated [2] = false
ground.station.global.mapping.function [2] = false
ground.station.niell.mapping.function [2] = false
ground.station.hydrostatic.delay.value [2] = 2.07
ground.station.wet.delay.value [2] = 0.056
ground.station.slope.hydrostatic.delay.value [2] = 0.0
ground.station.slope.wet.delay.value [2] = 0.0
ground.station.range.tropospheric.correction [2] = true
ground.station.hydrostatic.delay [2] = false
ground.station.wet.delay [2] = false
ground.station.slope.hydrostatic.delay [2] = false
ground.station.slope.wet.delay [2] = false
ground.station.name [3] = Pretoria
ground.station.latitude [3] = -25.8854896226
......@@ -293,7 +326,18 @@ ground.station.elevation.bias.min [3] = -0.50
ground.station.elevation.bias.max [3] = +0.50
ground.station.az.el.biases.estimated [3] = true
ground.station.elevation.refraction.correction [3] = true
ground.station.tropospheric.model.estimated [3] = false
ground.station.global.mapping.function [3] = false
ground.station.niell.mapping.function [3] = false
ground.station.hydrostatic.delay.value [3] = 1.99
ground.station.wet.delay.value [3] = 0.146
ground.station.slope.hydrostatic.delay.value [3] = 0.0
ground.station.slope.wet.delay.value [3] = 0.0
ground.station.range.tropospheric.correction [3] = true
ground.station.hydrostatic.delay [3] = false
ground.station.wet.delay [3] = false
ground.station.slope.hydrostatic.delay [3] = false
ground.station.slope.wet.delay [3] = false
ground.station.name [4] = CastleRock
ground.station.latitude [4] = 39.2764477379
......@@ -320,7 +364,18 @@ ground.station.elevation.bias.min [4] = -0.50
ground.station.elevation.bias.max [4] = +0.50
ground.station.az.el.biases.estimated [4] = true
ground.station.elevation.refraction.correction [4] = true
ground.station.tropospheric.model.estimated [4] = false
ground.station.global.mapping.function [4] = false
ground.station.niell.mapping.function [4] = false
ground.station.hydrostatic.delay.value [4] = 1.91
ground.station.wet.delay.value [4] = 0.048
ground.station.slope.hydrostatic.delay.value [4] = 0.0
ground.station.slope.wet.delay.value [4] = 0.0
ground.station.range.tropospheric.correction [4] = true
ground.station.hydrostatic.delay [4] = false
ground.station.wet.delay [4] = false
ground.station.slope.hydrostatic.delay [4] = false
ground.station.slope.wet.delay [4] = false
### Measurements parameters
range.outlier.rejection.multiplier = 6
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment