use of org.orekit.estimation.measurements.GroundStation in project Orekit by CS-SI.
the class TropoModifierTest method testRangeTropoModifier.
@Test
public void testRangeTropoModifier() throws OrekitException {
Context context = EstimationTestUtils.eccentricContext("regular-data:potential:tides");
final NumericalPropagatorBuilder propagatorBuilder = context.createBuilder(OrbitType.KEPLERIAN, PositionAngle.TRUE, true, 1.0e-6, 60.0, 0.001);
// create perfect range measurements
for (final GroundStation station : context.stations) {
station.getEastOffsetDriver().setSelected(true);
station.getNorthOffsetDriver().setSelected(true);
station.getZenithOffsetDriver().setSelected(true);
}
final Propagator propagator = EstimationTestUtils.createPropagator(context.initialOrbit, propagatorBuilder);
final List<ObservedMeasurement<?>> measurements = EstimationTestUtils.createMeasurements(propagator, new RangeMeasurementCreator(context), 1.0, 3.0, 300.0);
propagator.setSlaveMode();
final RangeTroposphericDelayModifier modifier = new RangeTroposphericDelayModifier(SaastamoinenModel.getStandardModel());
for (final ObservedMeasurement<?> measurement : measurements) {
final AbsoluteDate date = measurement.getDate();
final SpacecraftState refState = propagator.propagate(date);
Range range = (Range) measurement;
EstimatedMeasurement<Range> evalNoMod = range.estimate(0, 0, new SpacecraftState[] { refState });
// add modifier
range.addModifier(modifier);
EstimatedMeasurement<Range> eval = range.estimate(0, 0, new SpacecraftState[] { refState });
final double diffMeters = eval.getEstimatedValue()[0] - evalNoMod.getEstimatedValue()[0];
final double epsilon = 1e-6;
Assert.assertTrue(Precision.compareTo(diffMeters, 12., epsilon) < 0);
Assert.assertTrue(Precision.compareTo(diffMeters, 0., epsilon) > 0);
}
}
use of org.orekit.estimation.measurements.GroundStation in project Orekit by CS-SI.
the class RangeRateTroposphericDelayModifier method modify.
/**
* {@inheritDoc}
*/
@Override
public void modify(final EstimatedMeasurement<RangeRate> estimated) throws OrekitException {
final RangeRate measurement = estimated.getObservedMeasurement();
final GroundStation station = measurement.getStation();
final SpacecraftState state = estimated.getStates()[0];
final double[] oldValue = estimated.getEstimatedValue();
final double delay = rangeRateErrorTroposphericModel(station, state);
// update estimated value taking into account the tropospheric delay.
// The tropospheric delay is directly added to the range.
final double[] newValue = oldValue.clone();
newValue[0] = newValue[0] + delay;
estimated.setEstimatedValue(newValue);
// update estimated derivatives with Jacobian of the measure wrt state
final double[][] djac = rangeRateErrorJacobianState(station, state, delay);
final double[][] stateDerivatives = estimated.getStateDerivatives(0);
for (int irow = 0; irow < stateDerivatives.length; ++irow) {
for (int jcol = 0; jcol < stateDerivatives[0].length; ++jcol) {
stateDerivatives[irow][jcol] += djac[irow][jcol];
}
}
estimated.setStateDerivatives(0, stateDerivatives);
for (final ParameterDriver driver : Arrays.asList(station.getEastOffsetDriver(), station.getNorthOffsetDriver(), station.getZenithOffsetDriver())) {
if (driver.isSelected()) {
// update estimated derivatives with derivative of the modification wrt station parameters
double parameterDerivative = estimated.getParameterDerivatives(driver)[0];
parameterDerivative += rangeRateErrorParameterDerivative(station, driver, state, delay);
estimated.setParameterDerivatives(driver, parameterDerivative);
}
}
}
use of org.orekit.estimation.measurements.GroundStation in project Orekit by CS-SI.
the class RangeRateIonosphericDelayModifier method modify.
/**
* {@inheritDoc}
*/
@Override
public void modify(final EstimatedMeasurement<RangeRate> estimated) throws OrekitException {
final RangeRate measurement = estimated.getObservedMeasurement();
final GroundStation station = measurement.getStation();
final SpacecraftState state = estimated.getStates()[0];
final double[] oldValue = estimated.getEstimatedValue();
final double delay = rangeRateErrorIonosphericModel(station, state);
// update estimated value taking into account the ionospheric delay.
// The ionospheric delay is directly added to the range.
final double[] newValue = oldValue.clone();
newValue[0] = newValue[0] + delay;
estimated.setEstimatedValue(newValue);
// update estimated derivatives with Jacobian of the measure wrt state
final double[][] djac = rangeErrorJacobianState(station, state);
final double[][] stateDerivatives = estimated.getStateDerivatives(0);
for (int irow = 0; irow < stateDerivatives.length; ++irow) {
for (int jcol = 0; jcol < stateDerivatives[0].length; ++jcol) {
stateDerivatives[irow][jcol] += djac[irow][jcol];
}
}
estimated.setStateDerivatives(0, stateDerivatives);
for (final ParameterDriver driver : Arrays.asList(station.getEastOffsetDriver(), station.getNorthOffsetDriver(), station.getZenithOffsetDriver())) {
if (driver.isSelected()) {
// update estimated derivatives with derivative of the modification wrt station parameters
double parameterDerivative = estimated.getParameterDerivatives(driver)[0];
parameterDerivative += rangeRateErrorParameterDerivative(station, driver, state, delay);
estimated.setParameterDerivatives(driver, parameterDerivative);
}
}
}
use of org.orekit.estimation.measurements.GroundStation in project Orekit by CS-SI.
the class TurnAroundRangeTroposphericDelayModifier method modify.
/**
* {@inheritDoc}
*/
@Override
public void modify(final EstimatedMeasurement<TurnAroundRange> estimated) throws OrekitException {
final TurnAroundRange measurement = estimated.getObservedMeasurement();
final GroundStation masterStation = measurement.getMasterStation();
final GroundStation slaveStation = measurement.getSlaveStation();
final SpacecraftState state = estimated.getStates()[0];
final double[] oldValue = estimated.getEstimatedValue();
// Update estimated value taking into account the tropospheric delay.
// The tropospheric delay is directly added to the TurnAroundRange.
final double masterDelay = rangeErrorTroposphericModel(masterStation, state);
final double slaveDelay = rangeErrorTroposphericModel(slaveStation, state);
final double[] newValue = oldValue.clone();
newValue[0] = newValue[0] + masterDelay + slaveDelay;
estimated.setEstimatedValue(newValue);
// Update estimated derivatives with Jacobian of the measure wrt state
final double[][] masterDjac = rangeErrorJacobianState(masterStation, state);
final double[][] slaveDjac = rangeErrorJacobianState(slaveStation, state);
final double[][] stateDerivatives = estimated.getStateDerivatives(0);
for (int irow = 0; irow < stateDerivatives.length; ++irow) {
for (int jcol = 0; jcol < stateDerivatives[0].length; ++jcol) {
stateDerivatives[irow][jcol] += masterDjac[irow][jcol] + slaveDjac[irow][jcol];
}
}
estimated.setStateDerivatives(0, stateDerivatives);
// Update derivatives with respect to master station position
for (final ParameterDriver driver : Arrays.asList(masterStation.getEastOffsetDriver(), masterStation.getNorthOffsetDriver(), masterStation.getZenithOffsetDriver())) {
if (driver.isSelected()) {
double parameterDerivative = estimated.getParameterDerivatives(driver)[0];
parameterDerivative += rangeErrorParameterDerivative(masterStation, driver, state);
estimated.setParameterDerivatives(driver, parameterDerivative);
}
}
// Update derivatives with respect to slave station position
for (final ParameterDriver driver : Arrays.asList(slaveStation.getEastOffsetDriver(), slaveStation.getNorthOffsetDriver(), slaveStation.getZenithOffsetDriver())) {
if (driver.isSelected()) {
double parameterDerivative = estimated.getParameterDerivatives(driver)[0];
parameterDerivative += rangeErrorParameterDerivative(slaveStation, driver, state);
estimated.setParameterDerivatives(driver, parameterDerivative);
}
}
}
Aggregations