Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream-orekit-gitlab/release-12.0' in…
Browse files Browse the repository at this point in the history
…to develop
  • Loading branch information
petrushy committed Dec 31, 2023
2 parents f7fc0e8 + 4dea1a9 commit 6b92df0
Show file tree
Hide file tree
Showing 39 changed files with 2,080 additions and 437 deletions.
2 changes: 1 addition & 1 deletion build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<project name="orekit" default="jar" basedir=".">

<property name="project.version" value="12.0" />
<property name="project.version" value="12.0.1" />
<property name="src.dir" location="src" />
<property name="main.src.dir" value="${src.dir}/main/java" />
<property name="main.resources.dir" value="${src.dir}/main/resources" />
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<groupId>org.orekit</groupId>
<artifactId>orekit</artifactId>
<packaging>jar</packaging>
<version>12.0</version>
<version>12.0.1</version>
<name>OREKIT</name>
<url>http://www.orekit.org/</url>

Expand Down
51 changes: 51 additions & 0 deletions src/changes/changes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,51 @@
<title>Orekit Changes</title>
</properties>
<body>
<release version="12.0.1" date="31/12/2023"
description="Version 12.0.1 is a patch release of Orekit.
It fixes several issues related to the Ephemeris class, interpolation and caching behaviours.
Checkstyle configuration for IntelliJ is added and some javadocs have been updated. Finally, missing
contributions have been added to the changes.">
<action dev="luc" type="add" issue="1286">
Fixed parsing of SP3 files with partly missing standard deviations.
</action>
<action dev="maxime" type="update" issue="1280">
Added missing contributions for 12.0 in changes.xml.
</action>
<action dev="luc" type="add" issue="1278">
Fixed exceptions occurring in EOP prediction with ill chosen fitting parameters.
</action>
<action dev="luc" type="add" due-to="Elisabet Cid Borobia">
Added translation of error messages in Catalan language.
</action>
<action dev="vincent" type="fix" issue="1277">
Fixed regression in computation speed when using Ephemeris.
</action>
<action dev="bryan" type="add" issue="1271">
Added checkstyle configuration for Intellij in contributing.md.
</action>
<action dev="vincent" type="fix" issue="1269">
Fixed infinite loop when using specific date with CssiSpaceWeatherData.
</action>
<action dev="vincent" type="fix" issue="1266">
SpacecraftStateInterpolator now takes into account the extrapolation threshold given at construction.
</action>
<action dev="tmills" type="update" issue="1261">
Updated JavaDoc for references to the yields method where applicable.
</action>
<action dev="maxime" type="fix" issue="1254">
Fixed bad dates in ephemeris when reset-at-end is set to false.
</action>
<action dev="maxime" type="fix" issue="1253">
Fixed covariance computation with ephemeris propagation.
</action>
<action dev="bryan" type="update" issue="1230">
AberrationModifier shall be used with user defined DataContext.
</action>
<action dev="bryan" type="fix" issue="1055">
Fixed bad caching of the ocean tides model.
</action>
</release>
<release version="12.0" date="2023-11-08"
description="Orekit 12.0 is a major new release.
It includes both new features and bug fixes. The main new features
Expand All @@ -39,6 +84,12 @@
formats: EOP C04, STK ephemeris files, Rinex 3.05 and 4.0, Rinex 2 navigation
messages, CCSDS ADM v2, and Sinex Differential Code Bias (DCB).
See the list below for a full description of the changes.">
<action dev="theo611 " type="update" issue="1203">
Added new method addSupportedParameters in AbstractPropagatorBuilder.
</action>
<action dev="jasquier" type="add" issue="982">
Added Gauss angles-only initial orbit determination method.
</action>
<action dev="lirw1984" type="update" issue="938">
Enhanced parsing of CRD files.
</action>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import org.hipparchus.util.FastMath;
import org.hipparchus.util.MathUtils;
import org.orekit.annotation.DefaultDataContext;
import org.orekit.bodies.CelestialBodyFactory;
import org.orekit.data.DataContext;
import org.orekit.errors.OrekitException;
import org.orekit.errors.OrekitMessages;
import org.orekit.estimation.measurements.AngularRaDec;
Expand All @@ -42,6 +42,7 @@
import org.orekit.time.AbsoluteDate;
import org.orekit.time.FieldAbsoluteDate;
import org.orekit.utils.Constants;
import org.orekit.utils.FieldPVCoordinates;
import org.orekit.utils.PVCoordinates;
import org.orekit.utils.ParameterDriver;
import org.orekit.utils.TimeSpanMap;
Expand All @@ -57,15 +58,28 @@
*/
public class AberrationModifier implements EstimationModifier<AngularRaDec> {

/** Data context. */
private final DataContext dataContext;

/** Empty constructor.
* <p>
* This constructor is not strictly necessary, but it prevents spurious
* javadoc warnings with JDK 18 and later.
* This constructor uses the {@link DefaultDataContext default data context}
* </p>
* @since 12.0
* @see #AberrationModifier(DataContext)
*/
@DefaultDataContext
public AberrationModifier() {
// nothing to do
this(DataContext.getDefault());
}

/**
* Constructor.
* @param dataContext data context
* @since 12.0.1
*/
public AberrationModifier(final DataContext dataContext) {
this.dataContext = dataContext;
}

/**
Expand All @@ -80,15 +94,27 @@ public AberrationModifier() {
@DefaultDataContext
public static double[] naturalToProper(final double[] naturalRaDec, final GroundStation station,
final AbsoluteDate date, final Frame frame) {
return naturalToProper(naturalRaDec, station, date, frame, DataContext.getDefault());
}

// Check measurement frame is inertial
if (!frame.isPseudoInertial()) {
throw new OrekitException(OrekitMessages.NON_PSEUDO_INERTIAL_FRAME, frame.getName());
}
/**
* Natural to proper correction for aberration of light.
*
* @param naturalRaDec the "natural" direction (in barycentric coordinates)
* @param station the observer ground station
* @param date the date of the measurement
* @param frame the frame of the measurement
* @param context the data context
* @return the "proper" direction (station-relative coordinates)
* @since 12.0.1
*/
public static double[] naturalToProper(final double[] naturalRaDec, final GroundStation station,
final AbsoluteDate date, final Frame frame, final DataContext context) {

ensureFrameIsPseudoInertial(frame);

// Velocity of station relative to barycentre (units of c)
final PVCoordinates baryPV = CelestialBodyFactory.getSolarSystemBarycenter()
.getPVCoordinates(date, frame);
final PVCoordinates baryPV = context.getCelestialBodies().getSolarSystemBarycenter().getPVCoordinates(date, frame);
final PVCoordinates stationPV = station.getBaseFrame().getPVCoordinates(date, frame);
final Vector3D stationBaryVel = stationPV.getVelocity()
.subtract(baryPV.getVelocity())
Expand All @@ -110,15 +136,28 @@ public static double[] naturalToProper(final double[] naturalRaDec, final Ground
@DefaultDataContext
public static double[] properToNatural(final double[] properRaDec, final GroundStation station,
final AbsoluteDate date, final Frame frame) {
return properToNatural(properRaDec, station, date, frame, DataContext.getDefault());
}

/**
* Proper to natural correction for aberration of light.
*
* @param properRaDec the "proper" direction (station-relative coordinates)
* @param station the observer ground station
* @param date the date of the measurement
* @param frame the frame of the measurement
* @param context the data context
* @return the "natural" direction (in barycentric coordinates)
* @since 12.0.1
*/
public static double[] properToNatural(final double[] properRaDec, final GroundStation station,
final AbsoluteDate date, final Frame frame, final DataContext context) {

// Check measurement frame is inertial
if (!frame.isPseudoInertial()) {
throw new OrekitException(OrekitMessages.NON_PSEUDO_INERTIAL_FRAME, frame.getName());
}
ensureFrameIsPseudoInertial(frame);

// Velocity of barycentre relative to station (units of c)
final PVCoordinates baryPV = CelestialBodyFactory.getSolarSystemBarycenter()
.getPVCoordinates(date, frame);
final PVCoordinates baryPV = context.getCelestialBodies().getSolarSystemBarycenter().getPVCoordinates(date, frame);
final PVCoordinates stationPV = station.getBaseFrame().getPVCoordinates(date, frame);
final Vector3D baryStationVel = baryPV.getVelocity()
.subtract(stationPV.getVelocity())
Expand Down Expand Up @@ -163,20 +202,34 @@ private static double[] lorentzVelocitySum(final double[] raDec, final Vector3D
public static Gradient[] fieldNaturalToProper(final Gradient[] naturalRaDec,
final FieldTransform<Gradient> stationToInertial,
final Frame frame) {
return fieldNaturalToProper(naturalRaDec, stationToInertial, frame, DataContext.getDefault());
}

/**
* Natural to proper correction for aberration of light.
*
* @param naturalRaDec the "natural" direction (in barycentric coordinates)
* @param stationToInertial the transform from station to inertial coordinates
* @param frame the frame of the measurement
* @param context the data context
* @return the "proper" direction (station-relative coordinates)
* @since 12.0.1
*/
public static Gradient[] fieldNaturalToProper(final Gradient[] naturalRaDec,
final FieldTransform<Gradient> stationToInertial,
final Frame frame,
final DataContext context) {

// Check measurement frame is inertial
if (!frame.isPseudoInertial()) {
throw new OrekitException(OrekitMessages.NON_PSEUDO_INERTIAL_FRAME, frame.getName());
}
ensureFrameIsPseudoInertial(frame);

// Set up field
final Field<Gradient> field = naturalRaDec[0].getField();
final FieldVector3D<Gradient> zero = FieldVector3D.getZero(field);
final FieldAbsoluteDate<Gradient> date = stationToInertial.getFieldDate();

// Barycentre in inertial coordinates
final PVCoordinates baryPV = CelestialBodyFactory.getSolarSystemBarycenter()
.getPVCoordinates(date.toAbsoluteDate(), frame);
final FieldPVCoordinates<Gradient> baryPV = context.getCelestialBodies().getSolarSystemBarycenter().getPVCoordinates(date, frame);

// Station in inertial coordinates
final TimeStampedFieldPVCoordinates<Gradient> stationPV =
Expand All @@ -190,7 +243,6 @@ public static Gradient[] fieldNaturalToProper(final Gradient[] naturalRaDec,
return fieldLorentzVelocitySum(naturalRaDec, stationBaryVel);
}


/**
* Proper to natural correction for aberration of light.
*
Expand All @@ -203,20 +255,34 @@ public static Gradient[] fieldNaturalToProper(final Gradient[] naturalRaDec,
public static Gradient[] fieldProperToNatural(final Gradient[] properRaDec,
final FieldTransform<Gradient> stationToInertial,
final Frame frame) {
return fieldProperToNatural(properRaDec, stationToInertial, frame, DataContext.getDefault());
}

/**
* Proper to natural correction for aberration of light.
*
* @param properRaDec the "proper" direction (station-relative coordinates)
* @param stationToInertial the transform from station to inertial coordinates
* @param frame the frame of the measurement
* @param context the data context
* @return the "natural" direction (in barycentric coordinates)
* @since 12.0.1
*/
public static Gradient[] fieldProperToNatural(final Gradient[] properRaDec,
final FieldTransform<Gradient> stationToInertial,
final Frame frame,
final DataContext context) {

// Check measurement frame is inertial
if (!frame.isPseudoInertial()) {
throw new OrekitException(OrekitMessages.NON_PSEUDO_INERTIAL_FRAME, frame.getName());
}
ensureFrameIsPseudoInertial(frame);

// Set up field
final Field<Gradient> field = properRaDec[0].getField();
final FieldVector3D<Gradient> zero = FieldVector3D.getZero(field);
final FieldAbsoluteDate<Gradient> date = stationToInertial.getFieldDate();

// Barycentre in inertial coordinates
final PVCoordinates baryPV = CelestialBodyFactory.getSolarSystemBarycenter()
.getPVCoordinates(date.toAbsoluteDate(), frame);
final FieldPVCoordinates<Gradient> baryPV = context.getCelestialBodies().getSolarSystemBarycenter().getPVCoordinates(date, frame);

// Station in inertial coordinates
final TimeStampedFieldPVCoordinates<Gradient> stationPV =
Expand Down Expand Up @@ -256,17 +322,14 @@ private static Gradient[] fieldLorentzVelocitySum(final Gradient[] raDec,
}


/**
* {@inheritDoc}
*/
/** {@inheritDoc} */
@Override
public List<ParameterDriver> getParametersDrivers() {
return Collections.emptyList();
}


/** {@inheritDoc} */
@Override
@DefaultDataContext
public void modifyWithoutDerivatives(final EstimatedMeasurementBase<AngularRaDec> estimated) {

// Observation date
Expand All @@ -280,7 +343,7 @@ public void modifyWithoutDerivatives(final EstimatedMeasurementBase<AngularRaDec

// Convert measurement to natural direction
final double[] estimatedRaDec = estimated.getEstimatedValue();
final double[] naturalRaDec = properToNatural(estimatedRaDec, station, date, frame);
final double[] naturalRaDec = properToNatural(estimatedRaDec, station, date, frame, dataContext);

// Normalise RA
final double[] observed = estimated.getObservedValue();
Expand All @@ -293,8 +356,8 @@ public void modifyWithoutDerivatives(final EstimatedMeasurementBase<AngularRaDec

}

/** {@inheritDoc} */
@Override
@DefaultDataContext
public void modify(final EstimatedMeasurement<AngularRaDec> estimated) {

// Observation date
Expand Down Expand Up @@ -327,7 +390,7 @@ public void modify(final EstimatedMeasurement<AngularRaDec> estimated) {
field.getZero().add(estimatedRaDec[0]),
field.getZero().add(estimatedRaDec[1])
};
final Gradient[] naturalRaDec = fieldProperToNatural(estimatedRaDecDS, stationToInertial, frame);
final Gradient[] naturalRaDec = fieldProperToNatural(estimatedRaDecDS, stationToInertial, frame, dataContext);

// Normalise RA
final double[] observed = estimated.getObservedValue();
Expand Down Expand Up @@ -356,4 +419,18 @@ public void modify(final EstimatedMeasurement<AngularRaDec> estimated) {
}
}

/**
* Check that given frame is pseudo-inertial. Throws an error otherwise.
*
* @param frame to check
*
* @throws OrekitException if given frame is not pseudo-inertial
*/
private static void ensureFrameIsPseudoInertial(final Frame frame) {
// Check measurement frame is inertial
if (!frame.isPseudoInertial()) {
throw new OrekitException(OrekitMessages.NON_PSEUDO_INERTIAL_FRAME, frame.getName());
}
}

}
10 changes: 8 additions & 2 deletions src/main/java/org/orekit/files/sp3/SP3Parser.java
Original file line number Diff line number Diff line change
Expand Up @@ -705,7 +705,10 @@ public void parse(final String line, final ParseInfo pi) {

if (pi.latestPosition.getNorm() > 0) {

if (line.length() < 69 || line.substring(61, 69).trim().length() == 0) {
if (line.length() < 69 ||
line.substring(61, 63).trim().length() == 0 ||
line.substring(64, 66).trim().length() == 0 ||
line.substring(67, 69).trim().length() == 0) {
pi.latestPositionAccuracy = null;
} else {
pi.latestPositionAccuracy = new Vector3D(SP3Utils.siAccuracy(SP3Utils.POSITION_ACCURACY_UNIT,
Expand Down Expand Up @@ -795,7 +798,10 @@ public void parse(final String line, final ParseInfo pi) {
Double.parseDouble(line.substring(46, 60).trim()));

final Vector3D velocityAccuracy;
if (line.length() < 69 || line.substring(61, 69).trim().length() == 0) {
if (line.length() < 69 ||
line.substring(61, 63).trim().length() == 0 ||
line.substring(64, 66).trim().length() == 0 ||
line.substring(67, 69).trim().length() == 0) {
velocityAccuracy = null;
} else {
velocityAccuracy = new Vector3D(SP3Utils.siAccuracy(SP3Utils.VELOCITY_ACCURACY_UNIT,
Expand Down
Loading

0 comments on commit 6b92df0

Please sign in to comment.