Commit 44425e5f authored by Bryan Cazabonne's avatar Bryan Cazabonne

Merge branch 'develop' into tropo

Conflicts:
	src/main/java/org/orekit/models/earth/MariniMurrayModel.java
	src/test/java/org/orekit/estimation/leastsquares/OrbitDeterminationTest.java
	src/test/resources/orbit-determination/GNSS/od_test_GPS07.in
parents 52bc5e2e 0b386fbe
......@@ -68,9 +68,9 @@ public class FieldGeodeticPoint<T extends RealFieldElement<T>> implements Serial
* Build a new instance. The angular coordinates will be normalized so that
* the latitude is between ±π/2 and the longitude is between ±π.
*
* @param latitude latitude of the point
* @param longitude longitude of the point
* @param altitude altitude of the point
* @param latitude latitude of the point (rad)
* @param longitude longitude of the point (rad)
* @param altitude altitude of the point (m)
*/
public FieldGeodeticPoint(final T latitude, final T longitude,
final T altitude) {
......
......@@ -66,9 +66,9 @@ public class GeodeticPoint implements Serializable {
* Build a new instance. The angular coordinates will be normalized so that
* the latitude is between ±π/2 and the longitude is between ±π.
*
* @param latitude latitude of the point
* @param longitude longitude of the point
* @param altitude altitude of the point
* @param latitude latitude of the point (rad)
* @param longitude longitude of the point (rad)
* @param altitude altitude of the point (m)
*/
public GeodeticPoint(final double latitude, final double longitude,
final double altitude) {
......
......@@ -90,8 +90,7 @@ class MeasurementHandler implements MultiSatStepHandler {
final ObservedMeasurement<?> observed = next.getMeasurement();
// estimate the theoretical measurement
final List<Integer> indices = observed.getPropagatorsIndices();
final SpacecraftState[] states = new SpacecraftState[indices.size()];
final SpacecraftState[] states = new SpacecraftState[observed.getSatellites().size()];
for (int i = 0; i < states.length; ++i) {
states[i] = interpolators.get(i).getInterpolatedState(next.getDate());
}
......
......@@ -422,7 +422,7 @@ class Model implements MultivariateJacobianFunction {
for (int k = 0; k < evaluationStates.length; ++k) {
final int p = observedMeasurement.getPropagatorsIndices().get(k);
final int p = observedMeasurement.getSatellites().get(k).getPropagatorIndex();
// partial derivatives of the current Cartesian coordinates with respect to current orbital state
final double[][] aCY = new double[6][6];
......
......@@ -19,6 +19,7 @@ package org.orekit.estimation.measurements;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
import org.hipparchus.RealFieldElement;
import org.hipparchus.analysis.differentiation.DSFactory;
......@@ -45,10 +46,10 @@ public abstract class AbstractMeasurement<T extends ObservedMeasurement<T>>
/** List of the supported parameters. */
private final List<ParameterDriver> supportedParameters;
/** Indices of the propagators related to this measurement.
* @since 9.0
/** Satellites related to this measurement.
* @since 9.3
*/
private final List<Integer> propagatorsIndices;
private final List<ObservableSatellite> satellites;
/** Date of the measurement. */
private final AbsoluteDate date;
......@@ -78,13 +79,37 @@ public abstract class AbstractMeasurement<T extends ObservedMeasurement<T>>
* @param baseWeight base weight
* @param propagatorsIndices indices of the propagators related to this measurement
* @param supportedParameters supported parameters
* @deprecated since 9.3, replaced bew {@link #AbstractMeasurement(AbsoluteDate,
* double, double, double, List)} followed by {@link #addParameterDriver(ParameterDriver)}
*/
@Deprecated
protected AbstractMeasurement(final AbsoluteDate date, final double observed,
final double sigma, final double baseWeight,
final List<Integer> propagatorsIndices,
final ParameterDriver... supportedParameters) {
this(date, observed, sigma, baseWeight,
propagatorsIndices.stream().map(i -> new ObservableSatellite(i)).collect(Collectors.toList()));
for (final ParameterDriver parameterDriver : supportedParameters) {
this.supportedParameters.add(parameterDriver);
}
}
/** Simple constructor for mono-dimensional measurements.
* <p>
* At construction, a measurement is enabled.
* </p>
* @param date date of the measurement
* @param observed observed value
* @param sigma theoretical standard deviation
* @param baseWeight base weight
* @param satellites satellites related to this measurement
* @since 9.3
*/
protected AbstractMeasurement(final AbsoluteDate date, final double observed,
final double sigma, final double baseWeight,
final List<ObservableSatellite> satellites) {
this.supportedParameters = new ArrayList<ParameterDriver>(supportedParameters.length);
this.supportedParameters = new ArrayList<ParameterDriver>();
for (final ParameterDriver parameterDriver : supportedParameters) {
this.supportedParameters.add(parameterDriver);
}
......@@ -100,7 +125,7 @@ public abstract class AbstractMeasurement<T extends ObservedMeasurement<T>>
baseWeight
};
this.propagatorsIndices = propagatorsIndices;
this.satellites = satellites;
this.modifiers = new ArrayList<EstimationModifier<T>>();
setEnabled(true);
......@@ -117,28 +142,57 @@ public abstract class AbstractMeasurement<T extends ObservedMeasurement<T>>
* @param baseWeight base weight
* @param propagatorsIndices indices of the propagators related to this measurement
* @param supportedParameters supported parameters
* @deprecated since 9.3, replaced bew {@link #AbstractMeasurement(AbsoluteDate,
* double[], double[], double[], List)} followed by {@link #addParameterDriver(ParameterDriver)}
*/
@Deprecated
protected AbstractMeasurement(final AbsoluteDate date, final double[] observed,
final double[] sigma, final double[] baseWeight,
final List<Integer> propagatorsIndices,
final ParameterDriver... supportedParameters) {
this.supportedParameters = new ArrayList<ParameterDriver>(supportedParameters.length);
this(date, observed, sigma, baseWeight,
propagatorsIndices.stream().map(i -> new ObservableSatellite(i)).collect(Collectors.toList()));
for (final ParameterDriver parameterDriver : supportedParameters) {
this.supportedParameters.add(parameterDriver);
}
}
/** Simple constructor, for multi-dimensional measurements.
* <p>
* At construction, a measurement is enabled.
* </p>
* @param date date of the measurement
* @param observed observed value
* @param sigma theoretical standard deviation
* @param baseWeight base weight
* @param satellites satellites related to this measurement
* @since 9.3
*/
protected AbstractMeasurement(final AbsoluteDate date, final double[] observed,
final double[] sigma, final double[] baseWeight,
final List<ObservableSatellite> satellites) {
this.supportedParameters = new ArrayList<ParameterDriver>();
this.date = date;
this.observed = observed.clone();
this.sigma = sigma.clone();
this.baseWeight = baseWeight.clone();
this.propagatorsIndices = propagatorsIndices;
this.satellites = satellites;
this.modifiers = new ArrayList<EstimationModifier<T>>();
setEnabled(true);
}
/** Add a parameter driver.
* @param driver parameter driver to add
* @since 9.3
*/
protected void addParameterDriver(final ParameterDriver driver) {
supportedParameters.add(driver);
}
/** {@inheritDoc} */
@Override
public List<ParameterDriver> getParametersDrivers() {
......@@ -178,7 +232,13 @@ public abstract class AbstractMeasurement<T extends ObservedMeasurement<T>>
/** {@inheritDoc} */
@Override
public List<Integer> getPropagatorsIndices() {
return propagatorsIndices;
return satellites.stream().map(s -> s.getPropagatorIndex()).collect(Collectors.toList());
}
/** {@inheritDoc} */
@Override
public List<ObservableSatellite> getSatellites() {
return satellites;
}
/** Estimate the theoretical value.
......
......@@ -57,10 +57,13 @@ public class AngularAzEl extends AbstractMeasurement<AngularAzEl> {
* @param angular observed value
* @param sigma theoretical standard deviation
* @param baseWeight base weight
* @deprecated since 9.3, replaced by {@#AngularAzEl(GroundStation, AbsoluteDate,
* double[], double[], double[], ObservableSatellite)}
*/
@Deprecated
public AngularAzEl(final GroundStation station, final AbsoluteDate date,
final double[] angular, final double[] sigma, final double[] baseWeight) {
this(station, date, angular, sigma, baseWeight, 0);
this(station, date, angular, sigma, baseWeight, new ObservableSatellite(0));
}
/** Simple constructor.
......@@ -71,21 +74,39 @@ public class AngularAzEl extends AbstractMeasurement<AngularAzEl> {
* @param baseWeight base weight
* @param propagatorIndex index of the propagator related to this measurement
* @since 9.0
* @deprecated since 9.3, replaced by {@#AngularAzEl(GroundStation, AbsoluteDate,
* double[], double[], double[], ObservableSatellite)}
*/
@Deprecated
public AngularAzEl(final GroundStation station, final AbsoluteDate date,
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(),
station.getPrimeMeridianOffsetDriver(),
station.getPrimeMeridianDriftDriver(),
station.getPolarOffsetXDriver(),
station.getPolarDriftXDriver(),
station.getPolarOffsetYDriver(),
station.getPolarDriftYDriver());
this(station, date, angular, sigma, baseWeight, new ObservableSatellite(propagatorIndex));
}
/** Simple constructor.
* @param station ground station from which measurement is performed
* @param date date of the measurement
* @param angular observed value
* @param sigma theoretical standard deviation
* @param baseWeight base weight
* @param satellite satellite related to this measurement
* @since 9.3
*/
public AngularAzEl(final GroundStation station, final AbsoluteDate date,
final double[] angular, final double[] sigma, final double[] baseWeight,
final ObservableSatellite satellite) {
super(date, angular, sigma, baseWeight, Arrays.asList(satellite));
addParameterDriver(station.getClockOffsetDriver());
addParameterDriver(station.getEastOffsetDriver());
addParameterDriver(station.getNorthOffsetDriver());
addParameterDriver(station.getZenithOffsetDriver());
addParameterDriver(station.getPrimeMeridianOffsetDriver());
addParameterDriver(station.getPrimeMeridianDriftDriver());
addParameterDriver(station.getPolarOffsetXDriver());
addParameterDriver(station.getPolarDriftXDriver());
addParameterDriver(station.getPolarOffsetYDriver());
addParameterDriver(station.getPolarDriftYDriver());
this.station = station;
}
......@@ -101,7 +122,8 @@ public class AngularAzEl extends AbstractMeasurement<AngularAzEl> {
protected EstimatedMeasurement<AngularAzEl> theoreticalEvaluation(final int iteration, final int evaluation,
final SpacecraftState[] states) {
final SpacecraftState state = states[getPropagatorsIndices().get(0)];
final ObservableSatellite satellite = getSatellites().get(0);
final SpacecraftState state = states[satellite.getPropagatorIndex()];
// Azimuth/elevation derivatives are computed with respect to spacecraft state in inertial frame
// and station parameters
......
......@@ -64,10 +64,13 @@ public class AngularRaDec extends AbstractMeasurement<AngularRaDec> {
* @param angular observed value
* @param sigma theoretical standard deviation
* @param baseWeight base weight
* @deprecated since 9.3, replaced by {@#AngularRaDec(GroundStation, AbsoluteDate,
* double[], double[], double[], ObservableSatellite)}
*/
@Deprecated
public AngularRaDec(final GroundStation station, final Frame referenceFrame, final AbsoluteDate date,
final double[] angular, final double[] sigma, final double[] baseWeight) {
this(station, referenceFrame, date, angular, sigma, baseWeight, 0);
final double[] angular, final double[] sigma, final double[] baseWeight) {
this(station, referenceFrame, date, angular, sigma, baseWeight, new ObservableSatellite(0));
}
/** Simple constructor.
......@@ -78,21 +81,41 @@ public class AngularRaDec extends AbstractMeasurement<AngularRaDec> {
* @param sigma theoretical standard deviation
* @param baseWeight base weight
* @param propagatorIndex index of the propagator related to this measurement
* @since 9.0
* @deprecated since 9.3, replaced by {@#AngularRaDec(GroundStation, AbsoluteDate,
* double[], double[], double[], ObservableSatellite)}
*/
@Deprecated
public AngularRaDec(final GroundStation station, final Frame referenceFrame, final AbsoluteDate date,
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(),
station.getPrimeMeridianOffsetDriver(),
station.getPrimeMeridianDriftDriver(),
station.getPolarOffsetXDriver(),
station.getPolarDriftXDriver(),
station.getPolarOffsetYDriver(),
station.getPolarDriftYDriver());
this(station, referenceFrame, date, angular, sigma, baseWeight, new ObservableSatellite(propagatorIndex));
}
/** Simple constructor.
* @param station ground station from which measurement is performed
* @param referenceFrame Reference frame in which the right ascension - declination angles are given
* @param date date of the measurement
* @param angular observed value
* @param sigma theoretical standard deviation
* @param baseWeight base weight
* @param satellite satellite related to this measurement
* @since 9.3
*/
public AngularRaDec(final GroundStation station, final Frame referenceFrame, final AbsoluteDate date,
final double[] angular, final double[] sigma, final double[] baseWeight,
final ObservableSatellite satellite) {
super(date, angular, sigma, baseWeight, Arrays.asList(satellite));
addParameterDriver(station.getClockOffsetDriver());
addParameterDriver(station.getEastOffsetDriver());
addParameterDriver(station.getNorthOffsetDriver());
addParameterDriver(station.getZenithOffsetDriver());
addParameterDriver(station.getPrimeMeridianOffsetDriver());
addParameterDriver(station.getPrimeMeridianDriftDriver());
addParameterDriver(station.getPolarOffsetXDriver());
addParameterDriver(station.getPolarDriftXDriver());
addParameterDriver(station.getPolarOffsetYDriver());
addParameterDriver(station.getPolarDriftYDriver());
this.station = station;
this.referenceFrame = referenceFrame;
}
......@@ -116,7 +139,8 @@ public class AngularRaDec extends AbstractMeasurement<AngularRaDec> {
protected EstimatedMeasurement<AngularRaDec> theoreticalEvaluation(final int iteration, final int evaluation,
final SpacecraftState[] states) {
final SpacecraftState state = states[getPropagatorsIndices().get(0)];
final ObservableSatellite satellite = getSatellites().get(0);
final SpacecraftState state = states[satellite.getPropagatorIndex()];
// Right Ascension/elevation (in reference frame )derivatives are computed with respect to spacecraft state in inertial frame
// and station parameters
......
......@@ -219,7 +219,7 @@ public class EstimatedEarthFrameProvider implements TransformProvider {
// take parametric prime meridian shift into account
final double theta = linearModel(date, primeMeridianOffsetDriver, primeMeridianDriftDriver);
final double thetaDot = parametricModel(primeMeridianDriftDriver);
final double thetaDot = primeMeridianDriftDriver.getValue();
final Transform meridianShift =
new Transform(date,
new Rotation(Vector3D.PLUS_K, theta, RotationConvention.FRAME_TRANSFORM),
......@@ -228,8 +228,8 @@ public class EstimatedEarthFrameProvider implements TransformProvider {
// take parametric pole shift into account
final double xpNeg = -linearModel(date, polarOffsetXDriver, polarDriftXDriver);
final double ypNeg = -linearModel(date, polarOffsetYDriver, polarDriftYDriver);
final double xpNegDot = -parametricModel(polarDriftXDriver);
final double ypNegDot = -parametricModel(polarDriftYDriver);
final double xpNegDot = -polarDriftXDriver.getValue();
final double ypNegDot = -polarDriftYDriver.getValue();
final Transform poleShift =
new Transform(date,
new Transform(date,
......@@ -251,13 +251,13 @@ public class EstimatedEarthFrameProvider implements TransformProvider {
// prime meridian shift parameters
final T theta = linearModel(date, primeMeridianOffsetDriver, primeMeridianDriftDriver);
final T thetaDot = zero.add(parametricModel(primeMeridianDriftDriver));
final T thetaDot = zero.add(primeMeridianDriftDriver.getValue());
// pole shift parameters
final T xpNeg = linearModel(date, polarOffsetXDriver, polarDriftXDriver).negate();
final T ypNeg = linearModel(date, polarOffsetYDriver, polarDriftYDriver).negate();
final T xpNegDot = zero.subtract(parametricModel(polarDriftXDriver));
final T ypNegDot = zero.subtract(parametricModel(polarDriftYDriver));
final T xpNegDot = zero.subtract(polarDriftXDriver.getValue());
final T ypNegDot = zero.subtract(polarDriftYDriver.getValue());
return getTransform(date, theta, thetaDot, xpNeg, xpNegDot, ypNeg, ypNegDot);
......@@ -277,15 +277,15 @@ public class EstimatedEarthFrameProvider implements TransformProvider {
final DerivativeStructure theta = linearModel(factory, date,
primeMeridianOffsetDriver, primeMeridianDriftDriver,
indices);
final DerivativeStructure thetaDot = parametricModel(factory, primeMeridianDriftDriver, indices);
final DerivativeStructure thetaDot = primeMeridianDriftDriver.getValue(factory, indices);
// pole shift parameters
final DerivativeStructure xpNeg = linearModel(factory, date,
polarOffsetXDriver, polarDriftXDriver, indices).negate();
final DerivativeStructure ypNeg = linearModel(factory, date,
polarOffsetYDriver, polarDriftYDriver, indices).negate();
final DerivativeStructure xpNegDot = parametricModel(factory, polarDriftXDriver, indices).negate();
final DerivativeStructure ypNegDot = parametricModel(factory, polarDriftYDriver, indices).negate();
final DerivativeStructure xpNegDot = polarDriftXDriver.getValue(factory, indices).negate();
final DerivativeStructure ypNegDot = polarDriftYDriver.getValue(factory, indices).negate();
return getTransform(date, theta, thetaDot, xpNeg, xpNegDot, ypNeg, ypNegDot);
......@@ -345,8 +345,8 @@ public class EstimatedEarthFrameProvider implements TransformProvider {
offsetDriver.getName());
}
final double dt = date.durationFrom(offsetDriver.getReferenceDate());
final double offset = parametricModel(offsetDriver);
final double drift = parametricModel(driftDriver);
final double offset = offsetDriver.getValue();
final double drift = driftDriver.getValue();
return dt * drift + offset;
}
......@@ -365,8 +365,8 @@ public class EstimatedEarthFrameProvider implements TransformProvider {
offsetDriver.getName());
}
final T dt = date.durationFrom(offsetDriver.getReferenceDate());
final double offset = parametricModel(offsetDriver);
final double drift = parametricModel(driftDriver);
final double offset = offsetDriver.getValue();
final double drift = driftDriver.getValue();
return dt.multiply(drift).add(offset);
}
......@@ -386,33 +386,11 @@ public class EstimatedEarthFrameProvider implements TransformProvider {
offsetDriver.getName());
}
final DerivativeStructure dt = date.durationFrom(offsetDriver.getReferenceDate());
final DerivativeStructure offset = parametricModel(factory, offsetDriver, indices);
final DerivativeStructure drift = parametricModel(factory, driftDriver, indices);
final DerivativeStructure offset = offsetDriver.getValue(factory, indices);
final DerivativeStructure drift = driftDriver.getValue(factory, indices);
return dt.multiply(drift).add(offset);
}
/** Evaluate a parametric model.
* @param driver driver managing the parameter
* @return value of the parametric model
*/
private double parametricModel(final ParameterDriver driver) {
return driver.getValue();
}
/** Evaluate a parametric model.
* @param factory factory for the derivatives
* @param driver driver managing the parameter
* @param indices indices of the estimated parameters in derivatives computations
* @return value of the parametric model
*/
private DerivativeStructure parametricModel(final DSFactory factory, final ParameterDriver driver,
final Map<String, Integer> indices) {
final Integer index = indices.get(driver.getName());
return (index == null) ?
factory.constant(driver.getValue()) :
factory.variable(index, driver.getValue());
}
/** Replace the instance with a data transfer object for serialization.
* <p>
* This intermediate class serializes the files supported names, the ephemeris type
......
......@@ -66,8 +66,9 @@ import org.orekit.utils.ParameterDriver;
* </p>
* <p>
* Since 9.3, this class also adds a station clock offset parameter, which manages
* the value that must be added to the observed measurement date to get the real
* physical date at which the measurement was performed.
* the value that must be subtracted from the observed measurement date to get the real
* physical date at which the measurement was performed (i.e. the offset is negative
* if the ground station clock is slow and positive if it is fast).
* </p>
* <ol>
* <li>precession/nutation, as theoretical model plus celestial pole EOP parameters</li>
......@@ -396,9 +397,9 @@ public class GroundStation {
public GeodeticPoint getOffsetGeodeticPoint(final AbsoluteDate date) {
// take station offset into account
final double x = parametricModel(eastOffsetDriver);
final double y = parametricModel(northOffsetDriver);
final double z = parametricModel(zenithOffsetDriver);
final double x = eastOffsetDriver.getValue();
final double y = northOffsetDriver.getValue();
final double z = zenithOffsetDriver.getValue();
final BodyShape baseShape = baseFrame.getParentShape();
final Transform baseToBody = baseFrame.getTransformTo(baseShape.getBodyFrame(), date);
Vector3D origin = baseToBody.transformPosition(new Vector3D(x, y, z));
......@@ -428,16 +429,16 @@ public class GroundStation {
public Transform getOffsetToInertial(final Frame inertial, final AbsoluteDate clockDate) {
// take clock offset into account
final double offset = parametricModel(clockOffsetDriver);
final AbsoluteDate offsetCompensatedDate = new AbsoluteDate(clockDate, offset);
final double offset = clockOffsetDriver.getValue();
final AbsoluteDate offsetCompensatedDate = new AbsoluteDate(clockDate, -offset);
// take Earth offsets into account
final Transform intermediateToBody = estimatedEarthFrameProvider.getTransform(offsetCompensatedDate).getInverse();
// take station offsets into account
final double x = parametricModel(eastOffsetDriver);
final double y = parametricModel(northOffsetDriver);
final double z = parametricModel(zenithOffsetDriver);
final double x = eastOffsetDriver.getValue();
final double y = northOffsetDriver.getValue();
final double z = zenithOffsetDriver.getValue();
final BodyShape baseShape = baseFrame.getParentShape();
final Transform baseToBody = baseFrame.getTransformTo(baseShape.getBodyFrame(), offsetCompensatedDate);
Vector3D origin = baseToBody.transformPosition(new Vector3D(x, y, z));
......@@ -480,9 +481,9 @@ public class GroundStation {
final DSFactory factory,
final Map<String, Integer> indices) {
// take clock offset into account
final DerivativeStructure offset = parametricModel(factory, clockOffsetDriver, indices);
final DerivativeStructure offset = clockOffsetDriver.getValue(factory, indices);
final FieldAbsoluteDate<DerivativeStructure> offsetCompensatedDate =
new FieldAbsoluteDate<DerivativeStructure>(clockDate, offset);
new FieldAbsoluteDate<DerivativeStructure>(clockDate, offset.negate());
return getOffsetToInertial(inertial, offsetCompensatedDate, factory, indices);
}
......@@ -517,9 +518,9 @@ public class GroundStation {
estimatedEarthFrameProvider.getTransform(offsetCompensatedDate, factory, indices).getInverse();
// take station offsets into account
final DerivativeStructure x = parametricModel(factory, eastOffsetDriver, indices);
final DerivativeStructure y = parametricModel(factory, northOffsetDriver, indices);
final DerivativeStructure z = parametricModel(factory, zenithOffsetDriver, indices);
final DerivativeStructure x = eastOffsetDriver.getValue(factory, indices);
final DerivativeStructure y = northOffsetDriver.getValue(factory, indices);
final DerivativeStructure z = zenithOffsetDriver.getValue(factory, indices);
final BodyShape baseShape = baseFrame.getParentShape();
final Transform baseToBody = baseFrame.getTransformTo(baseShape.getBodyFrame(), (AbsoluteDate) null);
......@@ -543,26 +544,4 @@ public class GroundStation {
}
/** Evaluate a parametric model.
* @param driver driver managing the parameter
* @return value of the parametric model
*/
private double parametricModel(final ParameterDriver driver) {
return driver.getValue();
}
/** Evaluate a parametric model.
* @param factory factory for the derivatives
* @param driver driver managing the parameter
* @param indices indices of the estimated parameters in derivatives computations
* @return value of the parametric model
*/
private DerivativeStructure parametricModel(final DSFactory factory, final ParameterDriver driver,
final Map<String, Integer> indices) {
final Integer index = indices.get(driver.getName());
return (index == null) ?
factory.constant(driver.getValue()) :
factory.variable(index, driver.getValue());
}
}
/* Copyright 2002-2019 CS Systèmes d'Information
* Licensed to CS Systèmes d'Information (CS) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* CS licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.orekit.estimation.measurements;
import org.hipparchus.util.FastMath;
import org.orekit.utils.ParameterDriver;
/** Class modeling a satellite that can be observed.
*
* @author Luc Maisonobe
* @since 9.3
*/
public class ObservableSatellite {
/** Prefix for clock offset parameter driver, the propagator index will be appended to it. */
public static final String CLOCK_OFFSET_PREFIX = "clock-offset-satellite-";
/** Clock offset scaling factor.
* <p>
* We use a power of 2 to avoid numeric noise introduction
* in the multiplications/divisions sequences.
* </p>
*/
private static final double CLOCK_OFFSET_SCALE = FastMath.scalb(1.0, -10);
/** Index of the propagator related to this satellite. */
private final int propagatorIndex;
/** Parameter driver for satellite clock offset. */
private final ParameterDriver clockOffsetDriver;
/** Simple constructor.
* @param propagatorIndex index of the propagator related to this satellite
*/
public ObservableSatellite(final int propagatorIndex) {
this.propagatorIndex = propagatorIndex;
this.clockOffsetDriver = new ParameterDriver(CLOCK_OFFSET_PREFIX + propagatorIndex,
0.0, CLOCK_OFFSET_SCALE,
Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY);
}
/** Get the index of the propagator related to this satellite.
* @return index of the propagator related to this satellite
*/
public int getPropagatorIndex() {
return propagatorIndex;
}
/** Get the clock offset parameter driver.
* <p>
* The offset value is defined as the value in seconds that must be <em>subtracted</em> from
* the satellite clock reading of time to compute the real physical date. The offset
* is therefore negative if the satellite clock is slow and positive if it is fast.
* </p>
* @return clock offset parameter driver
*/
public ParameterDriver getClockOffsetDriver() {
return clockOffsetDriver;
}
}
......@@ -17,6 +17,7 @@
package org.orekit.estimation.measurements;
import java.util.List;
import java.util.stream.Collectors;