Commit a23478fa authored by Bryan Cazabonne's avatar Bryan Cazabonne

Changed Parameter Driver names.

parent b83c2fba
......@@ -63,41 +63,41 @@ public class EstimatedTroposphericModel implements DiscreteTroposphericModel {
private final MappingFunction model;
/** Driver for hydrostatic tropospheric delay parameter. */
private final ParameterDriver initDateDHZParameterDriver;
private final ParameterDriver startDHZParameterDriver;
/** Driver for hydrostatic tropospheric delay parameter. */
private final ParameterDriver endDateDHZParameterDriver;
private final ParameterDriver endDHZParameterDriver;
/** Driver for wet tropospheric delay parameter. */
private final ParameterDriver initDateDWZParameterDriver;
private final ParameterDriver startDWZParameterDriver;
/** Driver for wet tropospheric delay parameter. */
private final ParameterDriver endDateDWZParameterDriver;
private final ParameterDriver endDWZParameterDriver;
/** Build a new instance.
* @param model mapping function model.
* @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)
* @param startHydroDelay initial value for the start hydrostatic zenith delay
* @param endHydroDelay initial value for the end hydrostatic zenith delay
* @param startWetDelay initial value for the start wet zenith delay
* @param endWetDelay initial value for the end wet zenith delay
*/
public EstimatedTroposphericModel(final MappingFunction model,
final double hydroDelayInitDate,
final double hydroDelayEndDate,
final double wetDelayInitDate,
final double wetDelayEndDate) {
final double startHydroDelay,
final double endHydroDelay,
final double startWetDelay,
final double endWetDelay) {
initDateDHZParameterDriver = new ParameterDriver(EstimatedTroposphericModel.START_HYDROSTATIC_ZENITH_DELAY,
hydroDelayInitDate, FastMath.scalb(1.0, -2), 0.0, 10.0);
startDHZParameterDriver = new ParameterDriver(EstimatedTroposphericModel.START_HYDROSTATIC_ZENITH_DELAY,
startHydroDelay, FastMath.scalb(1.0, -2), 0.0, 10.0);
endDateDHZParameterDriver = new ParameterDriver(EstimatedTroposphericModel.END_HYDROSTATIC_ZENITH_DELAY,
hydroDelayEndDate, FastMath.scalb(1.0, -2), 0.0, 10.0);
endDHZParameterDriver = new ParameterDriver(EstimatedTroposphericModel.END_HYDROSTATIC_ZENITH_DELAY,
endHydroDelay, FastMath.scalb(1.0, -2), 0.0, 10.0);
initDateDWZParameterDriver = new ParameterDriver(EstimatedTroposphericModel.START_WET_ZENITH_DELAY,
wetDelayInitDate, FastMath.scalb(1.0, -3), 0.0, 1.0);
startDWZParameterDriver = new ParameterDriver(EstimatedTroposphericModel.START_WET_ZENITH_DELAY,
startWetDelay, FastMath.scalb(1.0, -5), 0.0, 1.0);
endDateDWZParameterDriver = new ParameterDriver(EstimatedTroposphericModel.END_WET_ZENITH_DELAY,
wetDelayEndDate, FastMath.scalb(1.0, -3), 0.0, 1.0);
endDWZParameterDriver = new ParameterDriver(EstimatedTroposphericModel.END_WET_ZENITH_DELAY,
endWetDelay, FastMath.scalb(1.0, -5), 0.0, 1.0);
this.model = model;
}
......@@ -144,8 +144,8 @@ public class EstimatedTroposphericModel implements DiscreteTroposphericModel {
@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 dt1 = endDHZParameterDriver.getReferenceDate().durationFrom(date);
final double dt0 = date.durationFrom(startDHZParameterDriver.getReferenceDate());
final double dt = dt1 + dt0;
// Zenith delay
......@@ -172,8 +172,8 @@ public class EstimatedTroposphericModel implements DiscreteTroposphericModel {
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 dt1 = date.durationFrom(endDHZParameterDriver.getReferenceDate()).negate();
final T dt0 = date.durationFrom(startDHZParameterDriver.getReferenceDate());
final T dt = dt1.add(dt0);
// Zenith delay
......@@ -196,10 +196,10 @@ public class EstimatedTroposphericModel implements DiscreteTroposphericModel {
@Override
public List<ParameterDriver> getParametersDrivers() {
final List<ParameterDriver> list = new ArrayList<ParameterDriver>(4);
list.add(0, initDateDHZParameterDriver);
list.add(1, endDateDHZParameterDriver);
list.add(2, initDateDWZParameterDriver);
list.add(3, endDateDWZParameterDriver);
list.add(0, startDHZParameterDriver);
list.add(1, endDHZParameterDriver);
list.add(2, startDWZParameterDriver);
list.add(3, endDWZParameterDriver);
return Collections.unmodifiableList(list);
}
......
......@@ -66,23 +66,43 @@ public class EstimatedViennaOneModelTest {
}
@Test
public void testZHDParameterDerivative() {
doTestParametersDerivatives(EstimatedViennaOneModel.HYDROSTATIC_ZENITH_DELAY, 1.0e-16);
public void testZHDStartParameterDerivative() {
doTestParametersDerivatives(EstimatedViennaOneModel.START_HYDROSTATIC_ZENITH_DELAY, 1.0e-16);
}
@Test
public void testZWDParameterDerivative() {
doTestParametersDerivatives(EstimatedViennaOneModel.WET_ZENITH_DELAY, 8.7e-15);
public void testZHDEndParameterDerivative() {
doTestParametersDerivatives(EstimatedViennaOneModel.END_HYDROSTATIC_ZENITH_DELAY, 7.3e-16);
}
@Test
public void testAHParameterDerivative() {
doTestParametersDerivatives(EstimatedViennaOneModel.AH_COEFFICIENT, 2.3e-12);
public void testZWDStartParameterDerivative() {
doTestParametersDerivatives(EstimatedViennaOneModel.START_WET_ZENITH_DELAY, 4.5e-15);
}
@Test
public void testAWParameterDerivative() {
doTestParametersDerivatives(EstimatedViennaOneModel.AW_COEFFICIENT, 1.5e-13);
public void testZWDEndParameterDerivative() {
doTestParametersDerivatives(EstimatedViennaOneModel.END_WET_ZENITH_DELAY, 4.9e-15);
}
@Test
public void testAHStartParameterDerivative() {
doTestParametersDerivatives(EstimatedViennaOneModel.START_AH_COEFFICIENT, 7.7e-13);
}
@Test
public void testAHEndParameterDerivative() {
doTestParametersDerivatives(EstimatedViennaOneModel.END_AH_COEFFICIENT, 8.1e-13);
}
@Test
public void testAWStartParameterDerivative() {
doTestParametersDerivatives(EstimatedViennaOneModel.START_AW_COEFFICIENT, 4.7e-13);
}
@Test
public void testAWEndParameterDerivative() {
doTestParametersDerivatives(EstimatedViennaOneModel.END_AW_COEFFICIENT, 6.3e-12);
}
private void doTestParametersDerivatives(String parameterName, double tolerance) {
......@@ -100,7 +120,9 @@ public class EstimatedViennaOneModelTest {
final TopocentricFrame baseFrame = new TopocentricFrame(earth, point, "topo");
// Tropospheric model
final DiscreteTroposphericModel model = new EstimatedViennaOneModel(2.0966, 0.2140, 0.00127683, 0.00060955, latitude);
final DiscreteTroposphericModel model = new EstimatedViennaOneModel(2.0966, 2.0, 0.2140, 0.2,
0.00127683, 0.001, 0.00060955, 0.0006,
latitude);
// Set Parameter Driver
for (final ParameterDriver driver : model.getParametersDrivers()) {
......@@ -138,15 +160,20 @@ public class EstimatedViennaOneModelTest {
// Field State
final FieldSpacecraftState<DerivativeStructure> dsState = new FieldSpacecraftState<>(dsOrbit);
// Change drivers reference date
model.getParametersDrivers().get(0).setReferenceDate(dsDate.toAbsoluteDate().shiftedBy(-89.0));
model.getParametersDrivers().get(1).setReferenceDate(dsDate.toAbsoluteDate().shiftedBy(+438.0));
model.getParametersDrivers().get(2).setReferenceDate(dsDate.toAbsoluteDate().shiftedBy(-89.0));
model.getParametersDrivers().get(3).setReferenceDate(dsDate.toAbsoluteDate().shiftedBy(+438.0));
model.getParametersDrivers().get(4).setReferenceDate(dsDate.toAbsoluteDate().shiftedBy(-89.0));
model.getParametersDrivers().get(5).setReferenceDate(dsDate.toAbsoluteDate().shiftedBy(+438.0));
model.getParametersDrivers().get(6).setReferenceDate(dsDate.toAbsoluteDate().shiftedBy(-89.0));
model.getParametersDrivers().get(7).setReferenceDate(dsDate.toAbsoluteDate().shiftedBy(+438.0));
// Initial satellite elevation
final FieldVector3D<DerivativeStructure> position = dsState.getPVCoordinates().getPosition();
final DerivativeStructure dsElevation = baseFrame.getElevation(position, frame, dsDate);
// Set drivers reference date
for (final ParameterDriver driver : model.getParametersDrivers()) {
driver.setReferenceDate(dsDate.toAbsoluteDate());
}
// Add parameter as a variable
final List<ParameterDriver> drivers = model.getParametersDrivers();
final DerivativeStructure[] parameters = new DerivativeStructure[drivers.size()];
......@@ -250,7 +277,9 @@ public class EstimatedViennaOneModelTest {
final GroundStation station = new GroundStation(baseFrame);
// Tropospheric model
final DiscreteTroposphericModel model = new EstimatedViennaOneModel(2.0966, 0.2140, 0.00127683, 0.00060955, latitude);
final DiscreteTroposphericModel model = new EstimatedViennaOneModel(2.0966, 2.0, 0.2140, 0.2,
0.00127683, 0.001, 0.00060955, 0.0006,
latitude);
// Derivative Structure
final DSFactory factory = new DSFactory(6, 1);
......
......@@ -66,23 +66,43 @@ public class EstimatedViennaThreeTest {
}
@Test
public void testZHDParameterDerivative() {
doTestParametersDerivatives(EstimatedViennaThreeModel.HYDROSTATIC_ZENITH_DELAY, 2.3e-16);
public void testZHDStartParameterDerivative() {
doTestParametersDerivatives(EstimatedViennaThreeModel.START_HYDROSTATIC_ZENITH_DELAY, 6.7e-16);
}
@Test
public void testZWDParameterDerivative() {
doTestParametersDerivatives(EstimatedViennaThreeModel.WET_ZENITH_DELAY, 5.4e-15);
public void testZHDEndParameterDerivative() {
doTestParametersDerivatives(EstimatedViennaThreeModel.END_HYDROSTATIC_ZENITH_DELAY, 1.7e-16);
}
@Test
public void testAHParameterDerivative() {
doTestParametersDerivatives(EstimatedViennaThreeModel.AH_COEFFICIENT, 3.7e-13);
public void testZWDStartParameterDerivative() {
doTestParametersDerivatives(EstimatedViennaThreeModel.START_WET_ZENITH_DELAY, 2.3e-16);
}
@Test
public void testAWParameterDerivative() {
doTestParametersDerivatives(EstimatedViennaThreeModel.AW_COEFFICIENT, 2.3e-12);
public void testZWDEndParameterDerivative() {
doTestParametersDerivatives(EstimatedViennaThreeModel.END_WET_ZENITH_DELAY, 5.6e-17);
}
@Test
public void testAHStartParameterDerivative() {
doTestParametersDerivatives(EstimatedViennaThreeModel.START_AH_COEFFICIENT, 1.3e-14);
}
@Test
public void testAHEndParameterDerivative() {
doTestParametersDerivatives(EstimatedViennaThreeModel.END_AH_COEFFICIENT, 1.6e-12);
}
@Test
public void testAWStartParameterDerivative() {
doTestParametersDerivatives(EstimatedViennaThreeModel.START_AW_COEFFICIENT, 9.7e-12);
}
@Test
public void testAWEndParameterDerivative() {
doTestParametersDerivatives(EstimatedViennaThreeModel.END_AW_COEFFICIENT, 8.5e-12);
}
private void doTestParametersDerivatives(String parameterName, double tolerance) {
......@@ -100,7 +120,9 @@ public class EstimatedViennaThreeTest {
final TopocentricFrame baseFrame = new TopocentricFrame(earth, point, "topo");
// Tropospheric model
final DiscreteTroposphericModel model = new EstimatedViennaThreeModel(2.0966, 0.2140, 0.00127683, 0.00060955, latitude, longitude);
final DiscreteTroposphericModel model = new EstimatedViennaThreeModel(2.0966, 2.0, 0.2140, 0.2,
0.00127683, 0.001, 0.00060955, 0.0006,
latitude, longitude);
// Set Parameter Driver
for (final ParameterDriver driver : model.getParametersDrivers()) {
......@@ -135,15 +157,20 @@ public class EstimatedViennaThreeTest {
final FieldOrbit<DerivativeStructure> dsOrbit = new FieldKeplerianOrbit<>(a0, e0, i0, pa0, raan0, anomaly0,
PositionAngle.MEAN, frame,
dsDate, 3.9860047e14);
// Set drivers reference date
for (final ParameterDriver driver : model.getParametersDrivers()) {
driver.setReferenceDate(dsDate.toAbsoluteDate());
}
// Field State
final FieldSpacecraftState<DerivativeStructure> dsState = new FieldSpacecraftState<>(dsOrbit);
// Change drivers reference date
model.getParametersDrivers().get(0).setReferenceDate(dsDate.toAbsoluteDate().shiftedBy(-89.0));
model.getParametersDrivers().get(1).setReferenceDate(dsDate.toAbsoluteDate().shiftedBy(+438.0));
model.getParametersDrivers().get(2).setReferenceDate(dsDate.toAbsoluteDate().shiftedBy(-89.0));
model.getParametersDrivers().get(3).setReferenceDate(dsDate.toAbsoluteDate().shiftedBy(+438.0));
model.getParametersDrivers().get(4).setReferenceDate(dsDate.toAbsoluteDate().shiftedBy(-89.0));
model.getParametersDrivers().get(5).setReferenceDate(dsDate.toAbsoluteDate().shiftedBy(+438.0));
model.getParametersDrivers().get(6).setReferenceDate(dsDate.toAbsoluteDate().shiftedBy(-89.0));
model.getParametersDrivers().get(7).setReferenceDate(dsDate.toAbsoluteDate().shiftedBy(+438.0));
// Initial satellite elevation
final FieldVector3D<DerivativeStructure> position = dsState.getPVCoordinates().getPosition();
final DerivativeStructure dsElevation = baseFrame.getElevation(position, frame, dsDate);
......@@ -250,7 +277,8 @@ public class EstimatedViennaThreeTest {
final GroundStation station = new GroundStation(baseFrame);
// Tropospheric model
final DiscreteTroposphericModel model = new EstimatedViennaThreeModel(2.0966, 0.2140, 0.00127683, 0.00060955,
final DiscreteTroposphericModel model = new EstimatedViennaThreeModel(2.0966, 2.0, 0.2140, 0.2,
0.00127683, 0.001, 0.00060955, 0.0006,
latitude, longitude);
// Derivative Structure
......
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