Commit 16cc2ddd authored by Luc Maisonobe's avatar Luc Maisonobe

Merge branch 'develop' into propagation-in-non-inertial-frame

parents 77596a5b 157fd83f
......@@ -535,21 +535,6 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>ru.concerteza.buildnumber</groupId>
<artifactId>maven-jgit-buildnumber-plugin</artifactId>
<version>${orekit.jgit.buildnumber.version}</version>
<executions>
<execution>
<phase>prepare-package</phase>
<goals>
<goal>extract-buildnumber</goal>
</goals>
</execution>
</executions>
<configuration>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
......@@ -558,7 +543,6 @@
<archive>
<manifestFile>${project.build.directory}/osgi/MANIFEST.MF</manifestFile>
<manifestEntries>
<Implementation-Build>${orekit.implementation.build}</Implementation-Build>
<X-Compile-Source-JDK>${orekit.compiler.source}</X-Compile-Source-JDK>
<X-Compile-Target-JDK>${orekit.compiler.target}</X-Compile-Target-JDK>
</manifestEntries>
......@@ -687,6 +671,46 @@
</reporting>
<profiles>
<profile>
<id>git</id>
<activation>
<file>
<exists>.git</exists>
</file>
</activation>
<build>
<plugins>
<plugin>
<groupId>ru.concerteza.buildnumber</groupId>
<artifactId>maven-jgit-buildnumber-plugin</artifactId>
<version>${orekit.jgit.buildnumber.version}</version>
<executions>
<execution>
<phase>prepare-package</phase>
<goals>
<goal>extract-buildnumber</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>${orekit.maven-jar-plugin.version}</version>
<configuration>
<archive>
<manifestFile>${project.build.directory}/osgi/MANIFEST.MF</manifestFile>
<manifestEntries>
<Implementation-Build>${orekit.implementation.build}</Implementation-Build>
<X-Compile-Source-JDK>${orekit.compiler.source}</X-Compile-Source-JDK>
<X-Compile-Target-JDK>${orekit.compiler.target}</X-Compile-Target-JDK>
</manifestEntries>
</archive>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>release</id>
<build>
......
......@@ -308,6 +308,13 @@ public class CelestialBodyFactory {
}
/** Get the solar system barycenter aggregated body.
* <p>
* Both the {@link CelestialBody#getInertiallyOrientedFrame() inertially
* oriented frame} and {@link CelestialBody#getBodyOrientedFrame() body
* oriented frame} for this aggregated body are aligned with
* {@link org.orekit.frames.FramesFactory#getICRF() ICRF} (and therefore also
* {@link org.orekit.frames.FramesFactory#getGCRF() GCRF})
* </p>
* @return solar system barycenter aggregated body
* @exception OrekitException if the celestial body cannot be built
*/
......@@ -340,6 +347,13 @@ public class CelestialBodyFactory {
}
/** Get the Earth-Moon barycenter singleton bodies pair.
* <p>
* Both the {@link CelestialBody#getInertiallyOrientedFrame() inertially
* oriented frame} and {@link CelestialBody#getBodyOrientedFrame() body
* oriented frame} for this bodies pair are aligned with
* {@link org.orekit.frames.FramesFactory#getICRF() ICRF} (and therefore also
* {@link org.orekit.frames.FramesFactory#getGCRF() GCRF})
* </p>
* @return Earth-Moon barycenter bodies pair
* @exception OrekitException if the celestial body cannot be built
*/
......
......@@ -543,7 +543,7 @@ public class FramesFactory {
/** Get the unique ICRF frame.
* <p>The ICRF frame is centered at solar system barycenter and aligned
* with EME2000.</p>
* with GCRF.</p>
* @return the unique instance of the ICRF frame
* @exception OrekitException if solar system ephemerides cannot be loaded
*/
......
......@@ -22,6 +22,7 @@ import org.hipparchus.analysis.differentiation.DSFactory;
import org.hipparchus.analysis.differentiation.DerivativeStructure;
import org.hipparchus.geometry.euclidean.threed.FieldVector3D;
import org.hipparchus.geometry.euclidean.threed.Vector3D;
import org.hipparchus.util.FastMath;
import org.orekit.errors.OrekitException;
import org.orekit.errors.OrekitMessages;
import org.orekit.time.TimeShiftable;
......@@ -238,6 +239,107 @@ public class PVCoordinates implements TimeShiftable<PVCoordinates>, Serializable
}
/** Transform the instance to a {@link FieldPVCoordinates}&lt;{@link DerivativeStructure}&gt;.
* <p>
* The {@link DerivativeStructure} coordinates correspond to time-derivatives up
* to the user-specified order. As both the instance components {@link #getPosition() position},
* {@link #getVelocity() velocity} and {@link #getAcceleration() acceleration} and the
* {@link DerivativeStructure#getPartialDerivative(int...) derivatives} of the components
* holds time-derivatives, there are several ways to retrieve these derivatives. If for example
* the {@code order} is set to 2, then both {@code pv.getPosition().getX().getPartialDerivative(2)},
* {@code pv.getVelocity().getX().getPartialDerivative(1)} and
* {@code pv.getAcceleration().getX().getValue()} return the exact same value.
* </p>
* <p>
* If derivation order is 1, the first derivative of acceleration will be computed as a
* Keplerian-only jerk. If derivation order is 2, the second derivative of velocity (which
* is also the first derivative of acceleration) will be computed as a Keplerian-only jerk,
* and the second derivative of acceleration will be computed as a Keplerian-only jounce.
* </p>
* @param order derivation order for the vector components (must be either 0, 1 or 2)
* @return pv coordinates with time-derivatives embedded within the coordinates
* @exception OrekitException if the user specified order is too large
* @since 9.2
*/
public FieldPVCoordinates<DerivativeStructure> toDerivativeStructurePV(final int order)
throws OrekitException {
final DSFactory factory;
final DerivativeStructure x0;
final DerivativeStructure y0;
final DerivativeStructure z0;
final DerivativeStructure x1;
final DerivativeStructure y1;
final DerivativeStructure z1;
final DerivativeStructure x2;
final DerivativeStructure y2;
final DerivativeStructure z2;
switch(order) {
case 0 :
factory = new DSFactory(1, order);
x0 = factory.build(position.getX());
y0 = factory.build(position.getY());
z0 = factory.build(position.getZ());
x1 = factory.build(velocity.getX());
y1 = factory.build(velocity.getY());
z1 = factory.build(velocity.getZ());
x2 = factory.build(acceleration.getX());
y2 = factory.build(acceleration.getY());
z2 = factory.build(acceleration.getZ());
break;
case 1 : {
factory = new DSFactory(1, order);
final double r2 = position.getNormSq();
final double r = FastMath.sqrt(r2);
final double pvOr2 = Vector3D.dotProduct(position, velocity) / r2;
final double a = acceleration.getNorm();
final double aOr = a / r;
final Vector3D keplerianJerk = new Vector3D(-3 * pvOr2, acceleration, -aOr, velocity);
x0 = factory.build(position.getX(), velocity.getX());
y0 = factory.build(position.getY(), velocity.getY());
z0 = factory.build(position.getZ(), velocity.getZ());
x1 = factory.build(velocity.getX(), acceleration.getX());
y1 = factory.build(velocity.getY(), acceleration.getY());
z1 = factory.build(velocity.getZ(), acceleration.getZ());
x2 = factory.build(acceleration.getX(), keplerianJerk.getX());
y2 = factory.build(acceleration.getY(), keplerianJerk.getY());
z2 = factory.build(acceleration.getZ(), keplerianJerk.getZ());
break;
}
case 2 : {
factory = new DSFactory(1, order);
final double r2 = position.getNormSq();
final double r = FastMath.sqrt(r2);
final double pvOr2 = Vector3D.dotProduct(position, velocity) / r2;
final double a = acceleration.getNorm();
final double aOr = a / r;
final Vector3D keplerianJerk = new Vector3D(-3 * pvOr2, acceleration, -aOr, velocity);
final double v2 = velocity.getNormSq();
final double pa = Vector3D.dotProduct(position, acceleration);
final double aj = Vector3D.dotProduct(acceleration, keplerianJerk);
final Vector3D keplerianJounce = new Vector3D(-3 * (v2 + pa) / r2 + 15 * pvOr2 * pvOr2 - aOr, acceleration,
4 * aOr * pvOr2 - aj / (a * r), velocity);
x0 = factory.build(position.getX(), velocity.getX(), acceleration.getX());
y0 = factory.build(position.getY(), velocity.getY(), acceleration.getY());
z0 = factory.build(position.getZ(), velocity.getZ(), acceleration.getZ());
x1 = factory.build(velocity.getX(), acceleration.getX(), keplerianJerk.getX());
y1 = factory.build(velocity.getY(), acceleration.getY(), keplerianJerk.getY());
z1 = factory.build(velocity.getZ(), acceleration.getZ(), keplerianJerk.getZ());
x2 = factory.build(acceleration.getX(), keplerianJerk.getX(), keplerianJounce.getX());
y2 = factory.build(acceleration.getY(), keplerianJerk.getY(), keplerianJounce.getY());
z2 = factory.build(acceleration.getZ(), keplerianJerk.getZ(), keplerianJounce.getZ());
break;
}
default :
throw new OrekitException(OrekitMessages.OUT_OF_RANGE_DERIVATION_ORDER, order);
}
return new FieldPVCoordinates<>(new FieldVector3D<>(x0, y0, z0),
new FieldVector3D<>(x1, y1, z1),
new FieldVector3D<>(x2, y2, z2));
}
/** Estimate velocity between two positions.
* <p>Estimation is based on a simple fixed velocity translation
* during the time interval between the two positions.</p>
......
......@@ -20,6 +20,7 @@ import java.util.Collection;
import java.util.stream.Stream;
import org.hipparchus.RealFieldElement;
import org.hipparchus.analysis.differentiation.FieldDerivativeStructure;
import org.hipparchus.analysis.interpolation.FieldHermiteInterpolator;
import org.hipparchus.geometry.euclidean.threed.FieldVector3D;
import org.orekit.errors.OrekitInternalError;
......@@ -567,6 +568,20 @@ public class TimeStampedFieldPVCoordinates<T extends RealFieldElement<T>>
this.date = date;
}
/** Builds a TimeStampedFieldPVCoordinates triplet from a {@link FieldVector3D}&lt;{@link FieldDerivativeStructure}&gt;.
* <p>
* The vector components must have time as their only derivation parameter and
* have consistent derivation orders.
* </p>
* @param date date of the built coordinates
* @param p vector with time-derivatives embedded within the coordinates
*/
public TimeStampedFieldPVCoordinates(final FieldAbsoluteDate<T> date,
final FieldVector3D<FieldDerivativeStructure<T>> p) {
super(p);
this.date = date;
}
/** Get the date.
* @return date
*/
......
......@@ -62,7 +62,7 @@ NO_EARTH_ORIENTATION_PARAMETERS_LOADED = ingen jordorienteringsparametre er indl
MISSING_EARTH_ORIENTATION_PARAMETERS_BETWEEN_DATES = manglende jordorienteringsparametre mellem {0} og {1}
# missing Earth Orientation Parameters
NO_EARTH_ORIENTATION_PARAMETERS = <MISSING TRANSLATION>
NO_EARTH_ORIENTATION_PARAMETERS = ingen jordorienteringsparametre
# file {0} is not a supported IERS data file
NOT_A_SUPPORTED_IERS_DATA_FILE = filen {0} er ikke en understøttet IERS datafil
......@@ -467,5 +467,5 @@ NO_KLOBUCHAR_ALPHA_BETA_IN_FILE = filen {0} indeholder ikke Klobuchar koefficien
NO_REFERENCE_DATE_FOR_PARAMETER = ingen referencedato angivet for parameteren {0}
# station {0} not found, known stations: {1}
STATION_NOT_FOUND = <MISSING TRANSLATION>
STATION_NOT_FOUND = station {0} blev ikke fundet, kendte stationer: {1}
......@@ -21,6 +21,18 @@
</properties>
<body>
<release version="9.2" date="TBD" description="TBD">
<action dev="luc" type="add" >
Added more conversions between PV coordinates and DerivativeStructure.
This simplifies for example getting the time derivative of the momentum.
</action>
<action dev="maxime" type="fix">
Fixed weights for angular measurements in W3B orbit determination.
Fixed in test and tutorial.
Fixes issue #370.
</action>
<action dev="luc" type="add" due-to="Julio Hernanz">
Added frames for L1 and L2 Lagrange points, for any pair of celestial bodies.
</action>
</release>
<release version="9.1" date="2017-11-26"
description="Version 9.1 is a minor release of Orekit. It introduces a few new
......
......@@ -40,6 +40,7 @@ import org.orekit.frames.Frame;
import org.orekit.frames.FramesFactory;
import org.orekit.time.AbsoluteDate;
import org.orekit.time.TimeScalesFactory;
import org.orekit.utils.Constants;
import org.orekit.utils.IERSConventions;
import org.orekit.utils.TimeStampedPVCoordinates;
......@@ -294,6 +295,26 @@ public class CelestialBodyFactoryTest {
}
}
@Test
public void testICRFAndGCRFAlignment() throws OrekitException {
Utils.setDataRoot("regular-data");
final CelestialBody earthMoonBarycenter = CelestialBodyFactory.getEarthMoonBarycenter();
final CelestialBody solarSystemBarycenter = CelestialBodyFactory.getSolarSystemBarycenter();
final List<Frame> frames = Arrays.asList(earthMoonBarycenter.getInertiallyOrientedFrame(),
earthMoonBarycenter.getBodyOrientedFrame(),
solarSystemBarycenter.getInertiallyOrientedFrame(),
solarSystemBarycenter.getBodyOrientedFrame());
final Frame icrf = FramesFactory.getICRF();
final Frame gcrf = FramesFactory.getGCRF();
for (double dt = 0; dt < Constants.JULIAN_DAY; dt += 60) {
final AbsoluteDate date = AbsoluteDate.J2000_EPOCH.shiftedBy(dt);
for (final Frame frame : frames) {
Assert.assertEquals(0.0, frame.getTransformTo(icrf, date).getRotation().getAngle(), 1.0e-15);
Assert.assertEquals(0.0, frame.getTransformTo(gcrf, date).getRotation().getAngle(), 1.0e-15);
}
}
}
@Test
public void testEarthInertialFrameAroundJ2000() throws OrekitException {
Utils.setDataRoot("regular-data");
......
......@@ -212,20 +212,26 @@ public class OrbitDeterminationTest {
//test on the estimated position and velocity
final Vector3D estimatedPos = odsatW3.getEstimatedPV().getPosition();
final Vector3D estimatedVel = odsatW3.getEstimatedPV().getVelocity();
final Vector3D refPos = new Vector3D(-40541629.7, -9904274.0, 207770.5);
final Vector3D refVel = new Vector3D(759.0343, -1476.5744, 54.7207);
final Vector3D refPos = new Vector3D(-40541446.255, -9905357.41, 206777.413);
final Vector3D refVel = new Vector3D(759.0685, -1476.5156, 54.793);
Assert.assertEquals(0.0, Vector3D.distance(refPos, estimatedPos), distanceAccuracy);
Assert.assertEquals(0.0, Vector3D.distance(refVel, estimatedVel), velocityAccuracy);
//test on propagator parameters
final double dragCoef = 0.408358;
final double dragCoef = -0.2154;
Assert.assertEquals(dragCoef, odsatW3.propagatorParameters.getDrivers().get(0).getValue(), 1e-3);
final Vector3D leakAcceleration =
final Vector3D leakAcceleration0 =
new Vector3D(odsatW3.propagatorParameters.getDrivers().get(1).getValue(),
odsatW3.propagatorParameters.getDrivers().get(3).getValue(),
odsatW3.propagatorParameters.getDrivers().get(4).getValue());
Assert.assertEquals(7.215e-6, leakAcceleration.getNorm(), 1.0e-8);
odsatW3.propagatorParameters.getDrivers().get(5).getValue());
//Assert.assertEquals(7.215e-6, leakAcceleration.getNorm(), 1.0e-8);
Assert.assertEquals(8.002e-6, leakAcceleration0.getNorm(), 1.0e-8);
final Vector3D leakAcceleration1 =
new Vector3D(odsatW3.propagatorParameters.getDrivers().get(2).getValue(),
odsatW3.propagatorParameters.getDrivers().get(4).getValue(),
odsatW3.propagatorParameters.getDrivers().get(6).getValue());
Assert.assertEquals(3.058e-10, leakAcceleration1.getNorm(), 1.0e-12);
//test on measurements parameters
final List<DelegatingDriver> list = new ArrayList<DelegatingDriver>();
......@@ -233,36 +239,36 @@ public class OrbitDeterminationTest {
sortParametersChanges(list);
//station CastleRock
final double[] CastleAzElBias = { 0.061472524615, -0.004761243392 };
final double CastleRangeBias = 11469.549393108811;
final double[] CastleAzElBias = { 0.062701342, -0.003613508 };
final double CastleRangeBias = 11274.4677;
Assert.assertEquals(CastleAzElBias[0], FastMath.toDegrees(list.get(0).getValue()), angleAccuracy);
Assert.assertEquals(CastleAzElBias[1], FastMath.toDegrees(list.get(1).getValue()), angleAccuracy);
Assert.assertEquals(CastleRangeBias, list.get(2).getValue(), distanceAccuracy);
//station Fucino
final double[] FucAzElBias = { -0.055300168766, 0.075768776364 };
final double FucRangeBias = 13457.554093564330;
final double[] FucAzElBias = { -0.053526137, 0.075483886 };
final double FucRangeBias = 13467.8256;
Assert.assertEquals(FucAzElBias[0], FastMath.toDegrees(list.get(3).getValue()), angleAccuracy);
Assert.assertEquals(FucAzElBias[1], FastMath.toDegrees(list.get(4).getValue()), angleAccuracy);
Assert.assertEquals(FucRangeBias, list.get(5).getValue(), distanceAccuracy);
//station Kumsan
final double[] KumAzElBias = { -0.024747914185, -0.054937823198 };
final double KumRangeBias = 13518.787261329808;
final double[] KumAzElBias = { -0.023574208, -0.054520756 };
final double KumRangeBias = 13512.57594;
Assert.assertEquals(KumAzElBias[0], FastMath.toDegrees(list.get(6).getValue()), angleAccuracy);
Assert.assertEquals(KumAzElBias[1], FastMath.toDegrees(list.get(7).getValue()), angleAccuracy);
Assert.assertEquals(KumRangeBias, list.get(8).getValue(), distanceAccuracy);
//station Pretoria
final double[] PreAzElBias = { 0.030017901957, 0.011381284221 };
final double PreRangeBias = 13422.150783526642;
final double[] PreAzElBias = { 0.030201539, 0.009747877 };
final double PreRangeBias = 13594.11889;
Assert.assertEquals(PreAzElBias[0], FastMath.toDegrees(list.get( 9).getValue()), angleAccuracy);
Assert.assertEquals(PreAzElBias[1], FastMath.toDegrees(list.get(10).getValue()), angleAccuracy);
Assert.assertEquals(PreRangeBias, list.get(11).getValue(), distanceAccuracy);
//station Uralla
final double[] UraAzElBias = { 0.168045618837, -0.121592982492 };
final double UraRangeBias = 13329.028440092245;
final double[] UraAzElBias = { 0.167814449, -0.12305252 };
final double UraRangeBias = 13450.26738;
Assert.assertEquals(UraAzElBias[0], FastMath.toDegrees(list.get(12).getValue()), angleAccuracy);
Assert.assertEquals(UraAzElBias[1], FastMath.toDegrees(list.get(13).getValue()), angleAccuracy);
Assert.assertEquals(UraRangeBias, list.get(14).getValue(), distanceAccuracy);
......@@ -270,7 +276,7 @@ public class OrbitDeterminationTest {
//test on statistic for the range residuals
final long nbRange = 182;
//statistics for the range residual (min, max, mean, std)
final double[] RefStatRange = { -13.193153858184814, 8.188527315855026, -4.0660929551995795E-7, 3.439086337255479 };
final double[] RefStatRange = { -18.39149369, 12.54165259, -4.32E-05, 4.374712716 };
Assert.assertEquals(nbRange, odsatW3.getRangeStat().getN());
Assert.assertEquals(RefStatRange[0], odsatW3.getRangeStat().getMin(), distanceAccuracy);
Assert.assertEquals(RefStatRange[1], odsatW3.getRangeStat().getMax(), distanceAccuracy);
......@@ -280,7 +286,7 @@ public class OrbitDeterminationTest {
//test on statistic for the azimuth residuals
final long nbAzi = 339;
//statistics for the azimuth residual (min, max, mean, std)
final double[] RefStatAzi = { -0.043318505013854106, 0.02526746996454656, 2.2139823069484976E-13, 0.010408428825158049 };
final double[] RefStatAzi = { -0.043033616, 0.025297558, -1.39E-10, 0.010063041 };
Assert.assertEquals(nbAzi, odsatW3.getAzimStat().getN());
Assert.assertEquals(RefStatAzi[0], odsatW3.getAzimStat().getMin(), angleAccuracy);
Assert.assertEquals(RefStatAzi[1], odsatW3.getAzimStat().getMax(), angleAccuracy);
......@@ -289,7 +295,7 @@ public class OrbitDeterminationTest {
//test on statistic for the elevation residuals
final long nbEle = 339;
final double[] RefStatEle = { -0.02486136476874614, 0.055464518813990386, -2.4339641630302666E-12, 0.011702113027469822 };
final double[] RefStatEle = { -0.025061971, 0.056294405, -4.10E-11, 0.011604931 };
Assert.assertEquals(nbEle, odsatW3.getElevStat().getN());
Assert.assertEquals(RefStatEle[0], odsatW3.getElevStat().getMin(), angleAccuracy);
Assert.assertEquals(RefStatEle[1], odsatW3.getElevStat().getMax(), angleAccuracy);
......@@ -301,17 +307,16 @@ public class OrbitDeterminationTest {
Assert.assertEquals(28, covariances.getColumnDimension());
// drag coefficient variance
Assert.assertEquals(0.77754, covariances.getEntry(6, 6), 1.0e-5);
Assert.assertEquals(0.687998, covariances.getEntry(6, 6), 1.0e-5);
// leak-X constant term variance
Assert.assertEquals(2.1016e-12, covariances.getEntry(7, 7), 1.0e-16);
Assert.assertEquals(2.0540e-12, covariances.getEntry(7, 7), 1.0e-16);
// leak-Y constant term variance
Assert.assertEquals(2.8869e-11, covariances.getEntry(9, 9), 1.0e-15);
Assert.assertEquals(2.4930e-11, covariances.getEntry(9, 9), 1.0e-15);
// leak-Z constant term variance
Assert.assertEquals(9.0489e-11, covariances.getEntry(11, 11), 1.0e-15);
Assert.assertEquals(7.6720e-11, covariances.getEntry(11, 11), 1.0e-15);
}
private class ResultOD {
......@@ -1111,8 +1116,8 @@ public class OrbitDeterminationTest {
return new Weights(parser.getDouble(ParameterKey.RANGE_MEASUREMENTS_BASE_WEIGHT),
parser.getDouble(ParameterKey.RANGE_RATE_MEASUREMENTS_BASE_WEIGHT),
new double[] {
parser.getAngle(ParameterKey.AZIMUTH_MEASUREMENTS_BASE_WEIGHT),
parser.getAngle(ParameterKey.ELEVATION_MEASUREMENTS_BASE_WEIGHT)
parser.getDouble(ParameterKey.AZIMUTH_MEASUREMENTS_BASE_WEIGHT),
parser.getDouble(ParameterKey.ELEVATION_MEASUREMENTS_BASE_WEIGHT)
},
parser.getDouble(ParameterKey.PV_MEASUREMENTS_BASE_WEIGHT));
}
......
......@@ -50,7 +50,6 @@ import org.orekit.frames.Transform;
import org.orekit.orbits.CartesianOrbit;
import org.orekit.propagation.BoundedPropagator;
import org.orekit.time.AbsoluteDate;
import org.orekit.time.TimeScale;
import org.orekit.time.TimeScalesFactory;
import org.orekit.utils.CartesianDerivativesFilter;
import org.orekit.utils.IERSConventions;
......@@ -480,9 +479,6 @@ public class OEMParserTest {
frames.add(new Pair<>("ITRF2005", Predefined.ITRF_2008_TO_ITRF_2005
.createTransformedITRF(itrf2008, "ITRF2005")));
frames.add(new Pair<>("ITRF2008", itrf2008));
// arbitrary date
TimeScale utc = TimeScalesFactory.getUTC();
AbsoluteDate date = new AbsoluteDate(2017, 11, 8, 15, 22, 23, utc);
for (Pair<String, Frame> frame : frames) {
final String frameName = frame.getFirst();
......
......@@ -22,14 +22,19 @@ import java.util.List;
import java.util.Random;
import org.hipparchus.Field;
import org.hipparchus.RealFieldElement;
import org.hipparchus.analysis.differentiation.DSFactory;
import org.hipparchus.analysis.differentiation.DerivativeStructure;
import org.hipparchus.analysis.differentiation.FieldDerivativeStructure;
import org.hipparchus.analysis.polynomials.PolynomialFunction;
import org.hipparchus.geometry.euclidean.threed.FieldVector3D;
import org.hipparchus.util.Decimal64;
import org.hipparchus.util.Decimal64Field;
import org.hipparchus.util.FastMath;
import org.junit.Assert;
import org.junit.Test;
import org.orekit.Utils;
import org.orekit.errors.OrekitException;
import org.orekit.time.AbsoluteDate;
import org.orekit.time.FieldAbsoluteDate;
......@@ -110,6 +115,42 @@ public class TimeStampedFieldPVCoordinatesTest {
1.0e-15);
}
@Test
public void testToDerivativeStructureVector2() throws OrekitException {
FieldVector3D<FieldDerivativeStructure<Decimal64>> fv =
new TimeStampedFieldPVCoordinates<>(FieldAbsoluteDate.getGalileoEpoch(Decimal64Field.getInstance()),
new FieldVector3D<>(new Decimal64( 1), new Decimal64( 0.1), new Decimal64( 10)),
new FieldVector3D<>(new Decimal64(-1), new Decimal64(-0.1), new Decimal64(-10)),
new FieldVector3D<>(new Decimal64(10), new Decimal64(-1.0), new Decimal64(-100))).
toDerivativeStructureVector(2);
Assert.assertEquals(1, fv.getX().getFreeParameters());
Assert.assertEquals(2, fv.getX().getOrder());
Assert.assertEquals( 1.0, fv.getX().getReal(), 1.0e-10);
Assert.assertEquals( 0.1, fv.getY().getReal(), 1.0e-10);
Assert.assertEquals( 10.0, fv.getZ().getReal(), 1.0e-10);
Assert.assertEquals( -1.0, fv.getX().getPartialDerivative(1).doubleValue(), 1.0e-15);
Assert.assertEquals( -0.1, fv.getY().getPartialDerivative(1).doubleValue(), 1.0e-15);
Assert.assertEquals( -10.0, fv.getZ().getPartialDerivative(1).doubleValue(), 1.0e-15);
Assert.assertEquals( 10.0, fv.getX().getPartialDerivative(2).doubleValue(), 1.0e-15);
Assert.assertEquals( -1.0, fv.getY().getPartialDerivative(2).doubleValue(), 1.0e-15);
Assert.assertEquals(-100.0, fv.getZ().getPartialDerivative(2).doubleValue(), 1.0e-15);
checkPV(new TimeStampedFieldPVCoordinates<>(FieldAbsoluteDate.getGalileoEpoch(Decimal64Field.getInstance()),
new FieldVector3D<>(new Decimal64( 1), new Decimal64( 0.1), new Decimal64( 10)),
new FieldVector3D<>(new Decimal64(-1), new Decimal64(-0.1), new Decimal64(-10)),
new FieldVector3D<>(new Decimal64(10), new Decimal64(-1.0), new Decimal64(-100))),
new TimeStampedFieldPVCoordinates<>(FieldAbsoluteDate.getGalileoEpoch(Decimal64Field.getInstance()), fv), 1.0e-15);
for (double dt = 0; dt < 10; dt += 0.125) {
FieldVector3D<Decimal64> p = new FieldPVCoordinates<>(new FieldVector3D<>(new Decimal64( 1), new Decimal64( 0.1), new Decimal64( 10)),
new FieldVector3D<>(new Decimal64(-1), new Decimal64(-0.1), new Decimal64(-10)),
new FieldVector3D<>(new Decimal64(10), new Decimal64(-1.0), new Decimal64(-100))).
shiftedBy(dt).getPosition();
Assert.assertEquals(p.getX().doubleValue(), fv.getX().taylor(dt).doubleValue(), 1.0e-14);
Assert.assertEquals(p.getY().doubleValue(), fv.getY().taylor(dt).doubleValue(), 1.0e-14);
Assert.assertEquals(p.getZ().doubleValue(), fv.getZ().taylor(dt).doubleValue(), 1.0e-14);
}
}
@Test
public void testShift() {
FieldVector3D<DerivativeStructure> p1 = createVector( 1, 0.1, 10, 4);
......@@ -325,8 +366,8 @@ public class TimeStampedFieldPVCoordinatesTest {
return new PolynomialFunction(coeff);
}
private void checkPV(TimeStampedFieldPVCoordinates<DerivativeStructure> expected,
TimeStampedFieldPVCoordinates<DerivativeStructure> real, double epsilon) {
private <T extends RealFieldElement<T>> void checkPV(TimeStampedFieldPVCoordinates<T> expected,
TimeStampedFieldPVCoordinates<T> real, double epsilon) {
Assert.assertEquals(expected.getDate(), real.getDate());
Assert.assertEquals(expected.getPosition().getX().getReal(), real.getPosition().getX().getReal(), epsilon);
Assert.assertEquals(expected.getPosition().getY().getReal(), real.getPosition().getY().getReal(), epsilon);
......
......@@ -1027,8 +1027,8 @@ public class OrbitDetermination {
return new Weights(parser.getDouble(ParameterKey.RANGE_MEASUREMENTS_BASE_WEIGHT),
parser.getDouble(ParameterKey.RANGE_RATE_MEASUREMENTS_BASE_WEIGHT),
new double[] {
parser.getAngle(ParameterKey.AZIMUTH_MEASUREMENTS_BASE_WEIGHT),
parser.getAngle(ParameterKey.ELEVATION_MEASUREMENTS_BASE_WEIGHT)
parser.getDouble(ParameterKey.AZIMUTH_MEASUREMENTS_BASE_WEIGHT),
parser.getDouble(ParameterKey.ELEVATION_MEASUREMENTS_BASE_WEIGHT)
},
parser.getDouble(ParameterKey.PV_MEASUREMENTS_BASE_WEIGHT));
}
......@@ -1234,7 +1234,7 @@ public class OrbitDetermination {
final RangeRate rangeRate = new RangeRateParser().parseFields(fields, stations, pvData,
satRangeBias, weights,
line, lineNumber, file.getName());
if (rangeOutliersManager != null) {
if (rangeRateOutliersManager != null) {
rangeRate.addModifier(rangeRateOutliersManager);
}
addIfNonZeroWeight(rangeRate, measurements);
......
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