Commit f3e62472 authored by mvanel's avatar mvanel
Browse files

Issue time span driver #958

Commit to update branch with last develop commits and resolve merge
conflicts and to remove the call to getValue function with argument null
as it is possible to use directly getValue() for driver with 1 span
parent 27ef131f
......@@ -80,7 +80,7 @@ public class AmbiguitySolver {
// in order to make the code generic and compatible with pDriver having
// 1 or several values driven getValue is called with a "random date"
// it should be OK as we take the near number
final double near = FastMath.rint(d.getValue(new AbsoluteDate()));
final double near = FastMath.rint(d.getValue());
final double gapMin = near - d.getMinValue();
final double gapMax = d.getMaxValue() - near;
return FastMath.max(FastMath.abs(gapMin), FastMath.abs(gapMax)) > 1.0e-15;
......
......@@ -308,7 +308,7 @@ public interface ForceModel extends ParametersDriversProvider {
// Initialize the date detector
final DateDetector datesDetector = new DateDetector(transitionDates.get(0)).
withMaxCheck(60.).
withHandler((SpacecraftState state, DateDetector d, boolean increasing) -> {
withHandler(( state, d, increasing) -> {
return Action.RESET_DERIVATIVES;
});
// Add all transitions' dates to the date detector
......@@ -344,7 +344,7 @@ public interface ForceModel extends ParametersDriversProvider {
final FieldDateDetector<T> datesDetector =
new FieldDateDetector<>(new FieldAbsoluteDate<>(field, transitionDates.get(0))).
withMaxCheck(field.getZero().add(60.)).
withHandler((FieldSpacecraftState<T> state, FieldDateDetector<T> d, boolean increasing) -> {
withHandler(( state, d, increasing) -> {
return Action.RESET_DERIVATIVES;
});
// Add all transitions' dates to the date detector
......
......@@ -20,7 +20,6 @@ import java.util.Collections;
import java.util.List;
import org.hipparchus.CalculusFieldElement;
import org.hipparchus.Field;
import org.hipparchus.geometry.euclidean.threed.FieldVector3D;
import org.hipparchus.geometry.euclidean.threed.Vector3D;
import org.hipparchus.util.FastMath;
......
......@@ -377,7 +377,7 @@ public interface DSSTForceModel extends ParametersDriversProvider {
// Initialize the date detector
final DateDetector datesDetector = new DateDetector(transitionDates.get(0)).
withMaxCheck(60.).
withHandler((SpacecraftState state, DateDetector d, boolean increasing) -> {
withHandler(( state, d, increasing) -> {
return Action.RESET_DERIVATIVES;
});
// Add all transitions' dates to the date detector
......
......@@ -126,7 +126,7 @@ public class BrouwerLyddaneEstimationTestUtils {
propagatorBuilder.getPositionAngle(),
orbitArray, null);
for (int i = 0; i < orbitArray.length; ++i) {
propagatorBuilder.getOrbitalParametersDrivers().getDrivers().get(i).setValue(orbitArray[i], null);
propagatorBuilder.getOrbitalParametersDrivers().getDrivers().get(i).setValue(orbitArray[i], initialOrbit.getDate());
}
return propagatorBuilder.buildPropagator(propagatorBuilder.getSelectedNormalizedParameters());
......
......@@ -230,7 +230,7 @@ public class DSSTEstimationTestUtils {
orbitArray, null);
for (int i = 0; i < orbitArray.length; ++i) {
// here orbital paramaters drivers have only 1 estimated values on the all time period for orbit determination
propagatorBuilder.getOrbitalParametersDrivers().getDrivers().get(i).setValue(orbitArray[i], null);
propagatorBuilder.getOrbitalParametersDrivers().getDrivers().get(i).setValue(orbitArray[i], initialOrbit.getDate());
}
return propagatorBuilder.buildPropagator(propagatorBuilder.getSelectedNormalizedParameters());
......
......@@ -126,7 +126,7 @@ public class EcksteinHechlerEstimationTestUtils {
orbitArray, null);
for (int i = 0; i < orbitArray.length; ++i) {
// here orbital paramaters drivers have only 1 estimated values on the all time period for orbit determination
propagatorBuilder.getOrbitalParametersDrivers().getDrivers().get(i).setValue(orbitArray[i], null);
propagatorBuilder.getOrbitalParametersDrivers().getDrivers().get(i).setValue(orbitArray[i], initialOrbit.getDate());
}
return propagatorBuilder.buildPropagator(propagatorBuilder.getSelectedNormalizedParameters());
......
......@@ -113,7 +113,7 @@ public class KeplerianEstimationTestUtils {
orbitArray, null);
for (int i = 0; i < orbitArray.length; ++i) {
// here orbital paramaters drivers have only 1 estimated values on the all time period for orbit determination
propagatorBuilder.getOrbitalParametersDrivers().getDrivers().get(i).setValue(orbitArray[i], null);
propagatorBuilder.getOrbitalParametersDrivers().getDrivers().get(i).setValue(orbitArray[i], initialOrbit.getDate());
}
return propagatorBuilder.buildPropagator(propagatorBuilder.getSelectedNormalizedParameters());
......
......@@ -188,7 +188,7 @@ public class TLEEstimationTestUtils {
initialOrbit.getType().mapOrbitToArray(initialOrbit, PositionAngle.MEAN, orbitArray, null);
for (int i = 0; i < orbitArray.length; ++i) {
// here orbital paramaters drivers have only 1 estimated values on the all time period for orbit determination
propagatorBuilder.getOrbitalParametersDrivers().getDrivers().get(i).setValue(orbitArray[i], null);
propagatorBuilder.getOrbitalParametersDrivers().getDrivers().get(i).setValue(orbitArray[i], initialOrbit.getDate());
}
return propagatorBuilder.buildPropagator(propagatorBuilder.getSelectedNormalizedParameters());
......
......@@ -1141,7 +1141,7 @@ public abstract class AbstractOrbitDetermination<T extends PropagatorBuilder> {
final String coefficientName = names[i] + "[" + k + "]";
for (final ParameterDriver driver : drivers) {
if (driver.getName().equals(coefficientName)) {
driver.setValue(Double.parseDouble(coefficients[i].get(k)), new AbsoluteDate());
driver.setValue(Double.parseDouble(coefficients[i].get(k)));
driver.setSelected(estimated[i]);
}
}
......
......@@ -283,7 +283,7 @@ public class BatchLSEstimatorTest {
ParameterDriver aDriver = estimator.getOrbitalParametersDrivers(true).getDrivers().get(0);
Assertions.assertEquals("a", aDriver.getName());
aDriver.setValue(aDriver.getValue(null) + 1.2, null);
aDriver.setValue(aDriver.getValue() + 1.2);
aDriver.setReferenceDate(AbsoluteDate.GALILEO_EPOCH);
EstimationTestUtils.checkFit(context, estimator, 2, 3,
......@@ -382,7 +382,7 @@ public class BatchLSEstimatorTest {
ParameterDriver aDriver = estimator.getOrbitalParametersDrivers(true).getDrivers().get(0);
Assertions.assertEquals("a", aDriver.getName());
aDriver.setValue(aDriver.getValue(null) + 1.2, null);
aDriver.setValue(aDriver.getValue() + 1.2);
aDriver.setReferenceDate(AbsoluteDate.GALILEO_EPOCH);
EstimationTestUtils.checkFit(context, estimator, 2, 3,
......@@ -506,20 +506,20 @@ public class BatchLSEstimatorTest {
List<DelegatingDriver> parameters = estimator.getOrbitalParametersDrivers(true).getDrivers();
ParameterDriver a0Driver = parameters.get(0);
Assertions.assertEquals("a[0]", a0Driver.getName());
a0Driver.setValue(a0Driver.getValue(null) + 1.2, null);
a0Driver.setValue(a0Driver.getValue() + 1.2);
a0Driver.setReferenceDate(AbsoluteDate.GALILEO_EPOCH);
ParameterDriver a1Driver = parameters.get(6);
Assertions.assertEquals("a[1]", a1Driver.getName());
a1Driver.setValue(a1Driver.getValue(null) - 5.4, null);
a1Driver.setValue(a1Driver.getValue() - 5.4);
a1Driver.setReferenceDate(AbsoluteDate.GALILEO_EPOCH);
final Orbit before = new KeplerianOrbit(parameters.get( 6).getValue(null),
parameters.get( 7).getValue(null),
parameters.get( 8).getValue(null),
parameters.get( 9).getValue(null),
parameters.get(10).getValue(null),
parameters.get(11).getValue(null),
final Orbit before = new KeplerianOrbit(parameters.get( 6).getValue(),
parameters.get( 7).getValue(),
parameters.get( 8).getValue(),
parameters.get( 9).getValue(),
parameters.get(10).getValue(),
parameters.get(11).getValue(),
PositionAngle.TRUE,
closeOrbit.getFrame(),
closeOrbit.getDate(),
......@@ -534,12 +534,12 @@ public class BatchLSEstimatorTest {
0.0, 8.3e-07,
0.0, 3.7e-10);
final Orbit determined = new KeplerianOrbit(parameters.get( 6).getValue(null),
parameters.get( 7).getValue(null),
parameters.get( 8).getValue(null),
parameters.get( 9).getValue(null),
parameters.get(10).getValue(null),
parameters.get(11).getValue(null),
final Orbit determined = new KeplerianOrbit(parameters.get( 6).getValue(),
parameters.get( 7).getValue(),
parameters.get( 8).getValue(),
parameters.get( 9).getValue(),
parameters.get(10).getValue(),
parameters.get(11).getValue(),
PositionAngle.TRUE,
closeOrbit.getFrame(),
closeOrbit.getDate(),
......@@ -706,7 +706,7 @@ public class BatchLSEstimatorTest {
List<DelegatingDriver> parameters = estimator.getOrbitalParametersDrivers(true).getDrivers();
ParameterDriver a0Driver = parameters.get(0);
Assertions.assertEquals("a[0]", a0Driver.getName());
a0Driver.setValue(a0Driver.getValue() + 1.2, null);
a0Driver.setValue(a0Driver.getValue() + 1.2);
a0Driver.setReferenceDate(AbsoluteDate.GALILEO_EPOCH);
ParameterDriver a1Driver = parameters.get(6);
......@@ -873,20 +873,20 @@ public class BatchLSEstimatorTest {
List<DelegatingDriver> parameters = estimator.getOrbitalParametersDrivers(true).getDrivers();
ParameterDriver a0Driver = parameters.get(0);
Assertions.assertEquals("a[0]", a0Driver.getName());
a0Driver.setValue(a0Driver.getValue(null) + 1.2, null);
a0Driver.setValue(a0Driver.getValue() + 1.2);
a0Driver.setReferenceDate(AbsoluteDate.GALILEO_EPOCH);
ParameterDriver a1Driver = parameters.get(6);
Assertions.assertEquals("a[1]", a1Driver.getName());
a1Driver.setValue(a1Driver.getValue(null) - 5.4, null);
a1Driver.setValue(a1Driver.getValue() - 5.4);
a1Driver.setReferenceDate(AbsoluteDate.GALILEO_EPOCH);
final Orbit before = new KeplerianOrbit(parameters.get( 6).getValue(null),
parameters.get( 7).getValue(null),
parameters.get( 8).getValue(null),
parameters.get( 9).getValue(null),
parameters.get(10).getValue(null),
parameters.get(11).getValue(null),
final Orbit before = new KeplerianOrbit(parameters.get( 6).getValue(),
parameters.get( 7).getValue(),
parameters.get( 8).getValue(),
parameters.get( 9).getValue(),
parameters.get(10).getValue(),
parameters.get(11).getValue(),
PositionAngle.TRUE,
closeOrbit.getFrame(),
closeOrbit.getDate(),
......@@ -901,12 +901,12 @@ public class BatchLSEstimatorTest {
0.0, 7.1e-07,
0.0, 3.2e-10);
final Orbit determined = new KeplerianOrbit(parameters.get( 6).getValue(null),
parameters.get( 7).getValue(null),
parameters.get( 8).getValue(null),
parameters.get( 9).getValue(null),
parameters.get(10).getValue(null),
parameters.get(11).getValue(null),
final Orbit determined = new KeplerianOrbit(parameters.get( 6).getValue(),
parameters.get( 7).getValue(),
parameters.get( 8).getValue(),
parameters.get( 9).getValue(),
parameters.get(10).getValue(),
parameters.get(11).getValue(),
PositionAngle.TRUE,
closeOrbit.getFrame(),
closeOrbit.getDate(),
......@@ -1007,7 +1007,7 @@ public class BatchLSEstimatorTest {
propagatorBuilder);
final double groundClockDrift = 4.8e-9;
for (final GroundStation station : context.stations) {
station.getClockDriftDriver().setValue(groundClockDrift, null);
station.getClockDriftDriver().setValue(groundClockDrift);
}
final double satClkDrift = 3.2e-10;
final List<ObservedMeasurement<?>> measurements1 =
......@@ -1057,7 +1057,7 @@ public class BatchLSEstimatorTest {
1.0, 3.0, 300.0);
final double groundClockDrift = 4.8e-9;
for (final GroundStation station : context.stations) {
station.getClockDriftDriver().setValue(groundClockDrift, null);
station.getClockDriftDriver().setValue(groundClockDrift);
}
final double satClkDrift = 3.2e-10;
final List<ObservedMeasurement<?>> measurementsRangeRate =
......
......@@ -228,7 +228,7 @@ public class BrouwerLyddaneBatchLSEstimatorTest {
propagatorBuilder);
final double groundClockDrift = 4.8e-9;
for (final GroundStation station : context.stations) {
station.getClockDriftDriver().setValue(groundClockDrift, null);
station.getClockDriftDriver().setValue(groundClockDrift);
}
final double satClkDrift = 3.2e-10;
final List<ObservedMeasurement<?>> measurements1 =
......
......@@ -226,7 +226,7 @@ public class EcksteinHechlerBatchLSEstimatorTest {
propagatorBuilder);
final double groundClockDrift = 4.8e-9;
for (final GroundStation station : context.stations) {
station.getClockDriftDriver().setValue(groundClockDrift, null);
station.getClockDriftDriver().setValue(groundClockDrift);
}
final double satClkDrift = 3.2e-10;
final List<ObservedMeasurement<?>> measurements1 =
......
......@@ -227,7 +227,7 @@ public class KeplerianBatchLSEstimatorTest {
propagatorBuilder);
final double groundClockDrift = 4.8e-9;
for (final GroundStation station : context.stations) {
station.getClockDriftDriver().setValue(groundClockDrift, null);
station.getClockDriftDriver().setValue(groundClockDrift);
}
final double satClkDrift = 3.2e-10;
final List<ObservedMeasurement<?>> measurements1 =
......
......@@ -50,9 +50,9 @@ public class InterSatellitesRangeMeasurementCreator extends MeasurementCreator {
this.antennaPhaseCenter1 = antennaPhaseCenter1;
this.antennaPhaseCenter2 = antennaPhaseCenter2;
this.local = new ObservableSatellite(0);
this.local.getClockOffsetDriver().setValue(localClockOffset, null);
this.local.getClockOffsetDriver().setValue(localClockOffset);
this.remote = new ObservableSatellite(1);
this.remote.getClockOffsetDriver().setValue(remoteClockOffset, null);
this.remote.getClockOffsetDriver().setValue(remoteClockOffset);
}
public ObservableSatellite getLocalSatellite() {
......
......@@ -43,7 +43,7 @@ public class RangeRateMeasurementCreator extends MeasurementCreator {
this.context = context;
this.twoWay = twoWay;
this.satellite = new ObservableSatellite(0);
this.satellite.getClockDriftDriver().setValue(satClockDrift, null);
this.satellite.getClockDriftDriver().setValue(satClockDrift);
}
public ObservableSatellite getSatellite() {
......
......@@ -61,9 +61,9 @@ public class InterSatellitesPhaseMeasurementCreator extends MeasurementCreator {
this.antennaPhaseCenter1 = antennaPhaseCenter1;
this.antennaPhaseCenter2 = antennaPhaseCenter2;
this.local = new ObservableSatellite(0);
this.local.getClockOffsetDriver().setValue(localClockOffset, null);
this.local.getClockOffsetDriver().setValue(localClockOffset);
this.remote = new ObservableSatellite(1);
this.remote.getClockOffsetDriver().setValue(remoteClockOffset, null);
this.remote.getClockOffsetDriver().setValue(remoteClockOffset);
}
public ObservableSatellite getLocalSatellite() {
......@@ -85,7 +85,7 @@ public class InterSatellitesPhaseMeasurementCreator extends MeasurementCreator {
public void handleStep(final SpacecraftState currentState) {
try {
final double n = ambiguity.getParametersDrivers().get(0).getValue(null);
final double n = ambiguity.getParametersDrivers().get(0).getValue();
final AbsoluteDate date = currentState.getDate();
final Vector3D position = currentState.toTransform().getInverse().transformPosition(antennaPhaseCenter1);
final double remoteClk = remote.getClockOffsetDriver().getValue(date);
......
......@@ -62,7 +62,7 @@ public class OneWayGNSSPhaseCreator extends MeasurementCreator {
this.wavelength = frequency.getWavelength();
this.ambiguity = new OneWayGNSSPhaseAmbiguityModifier(0, ambiguity);
this.local = new ObservableSatellite(0);
this.local.getClockOffsetDriver().setValue(localClockOffset, null);
this.local.getClockOffsetDriver().setValue(localClockOffset);
}
public ObservableSatellite getLocalSatellite() {
......
......@@ -558,7 +558,7 @@ public class OneWayGNSSPhaseTest {
Assertions.assertFalse(phase.getAmbiguityDriver().isSelected());
// Perform some changes in ambiguity driver
phase.getAmbiguityDriver().setValue(1234.0, null);
phase.getAmbiguityDriver().setValue(1234.0);
phase.getAmbiguityDriver().setSelected(true);
// Second check
......
......@@ -52,7 +52,7 @@ public class OneWayGNSSRangeCreator extends MeasurementCreator {
this.antennaPhaseCenter1 = antennaPhaseCenter1;
this.antennaPhaseCenter2 = antennaPhaseCenter2;
this.local = new ObservableSatellite(0);
this.local.getClockOffsetDriver().setValue(localClockOffset, null);
this.local.getClockOffsetDriver().setValue(localClockOffset);
}
public ObservableSatellite getLocalSatellite() {
......
Supports Markdown
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