Commit 259b14a8 authored by Evan Ward's avatar Evan Ward
Browse files

Merge 'origin/develop' into dtc-tostring-590

Fix conflicts in changes.xml
parents 32b4c332 1d9205a0
stages:
- verify
- visualize
- deploy
- verify
- visualize
- deploy
default:
# Default image
......@@ -13,12 +13,16 @@ default:
- .m2/repository
variables:
# This will supress any download for dependencies and plugins or upload messages which would clutter the console log.
# `showDateTime` will show the passed time in milliseconds. You need to specify `--batch-mode` to make this work.
# This will suppress any download for dependencies and plugins or upload
# messages which would clutter the console log. `showDateTime` will show the
# passed time in milliseconds. You need to specify `--batch-mode` to make
# this work.
MAVEN_OPTS: "-Dmaven.repo.local=.m2/repository -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN -Dorg.slf4j.simpleLogger.showDateTime=true -Djava.awt.headless=true"
# As of Maven 3.3.0 instead of this you may define these options in `.mvn/maven.config` so the same config is used
# when running from the command line.
# `installAtEnd` and `deployAtEnd` are only effective with recent version of the corresponding plugins.
# As of Maven 3.3.0 instead of this you may define these options in
# `.mvn/maven.config` so the same config is used when running from the
# command line.
# `installAtEnd` and `deployAtEnd` are only effective with recent version of
# the corresponding plugins.
MAVEN_CLI_OPTS: "-s .CI/maven-settings.xml --batch-mode --errors --fail-at-end --show-version -DinstallAtEnd=true -DdeployAtEnd=true"
SONAR_PROJECT_KEY: "${CI_PROJECT_NAMESPACE}:${CI_PROJECT_NAME}"
SONAR_PROJECT_NAME: "${CI_PROJECT_TITLE} (${CI_PROJECT_NAMESPACE}:${CI_PROJECT_NAME})"
......@@ -47,9 +51,12 @@ coverage-import:
stage: visualize
image: haynes/jacoco2cobertura:1.0.4
script:
# convert report from jacoco to cobertura
# Display total coverage
- "grep -o '<tfoot.*tfoot>' target/site/jacoco/index.html | sed 's:<[^>]*>: :g'"
# Convert report from jacoco to cobertura
- 'python /opt/cover2cover.py target/site/jacoco/jacoco.xml src/main/java > target/site/cobertura.xml'
# read the <source></source> tag and prepend the path to every filename attribute
# Read the <source></source> tag and prepend the path to every filename
# attribute
- 'python /opt/source2filename.py target/site/cobertura.xml'
needs:
- verify
......@@ -58,10 +65,10 @@ coverage-import:
artifacts:
reports:
cobertura: target/site/cobertura.xml
coverage: '/Total.*?([0-9]{1,3})%/'
# On main branches (develop, release-*, master)
# the produced artifacts are deployed on the Nexus of the project
# (https://packages.orekit.org/)
# On main branches (develop, release-*, master) the produced artifacts are
# deployed on the Nexus of the project (https://packages.orekit.org/)
deploy:artifacts:
stage: deploy
script:
......@@ -78,27 +85,17 @@ deploy:artifacts:
deploy:site:
stage: deploy
before_script:
##
## Create the SSH directory and give it the right permissions
##
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
# Create the SSH directory and give it the right permissions
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- echo "$SSH_SECRET_KEY" > ~/.ssh/id_website
- chmod 600 ~/.ssh/id_website
##
## We're using tr to fix line endings which makes ed25519 keys work
## without extra base64 encoding.
## https://gitlab.com/gitlab-examples/ssh-private-key/issues/1#note_48526556
##
- echo "$SSH_SECRET_KEY" > ~/.ssh/id_website
- chmod 700 ~/.ssh/id_website
##
## Add known hosts
##
- cp $SSH_KNOWN_HOSTS ~/.ssh/known_hosts
# Add known hosts
- cp $SSH_KNOWN_HOSTS ~/.ssh/known_hosts
script:
- mvn $MAVEN_CLI_OPTS site:deploy
- mvn $MAVEN_CLI_OPTS site:deploy
only:
- master@orekit/orekit
- /^release-[.0-9]+$/@orekit/orekit
- develop@orekit/orekit
- master@orekit/orekit
- /^release-[.0-9]+$/@orekit/orekit
- develop@orekit/orekit
......@@ -8,8 +8,9 @@
in Java. Orekit is designed to be easily used in very different contexts, from
quick studies up to critical operations. As a library, Orekit provides basic
elements (orbits, dates, attitude, frames, ...) and various algorithms to
handle them (conversions, propagations, pointing, ...).
handle them (conversions, propagations, pointing, events detection, orbit determination ...).
[![](http://img.shields.io/:license-apache-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0.html)
[![](https://sonar.orekit.org/api/project_badges/measure?project=orekit%3Aorekit&metric=alert_status)](https://sonar.orekit.org/dashboard?id=org.orekit%3Aorekit)
[![](https://sonar.orekit.org/api/project_badges/measure?project=orekit%3Aorekit&metric=coverage)](https://sonar.orekit.org/dashboard?id=org.orekit%3Aorekit)
......
......@@ -50,7 +50,7 @@
<orekit.maven-install-plugin.version>3.0.0-M1</orekit.maven-install-plugin.version>
<orekit.mathjax.config>&lt;script type=&quot;text/x-mathjax-config&quot;&gt;MathJax.Hub.Config({ TeX: { extensions: [&quot;autoload.js&quot;]}});&lt;/script&gt;</orekit.mathjax.config>
<orekit.mathjax.enable>&lt;script type=&quot;text/javascript&quot; src=&quot;https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS_CHTML&quot;&gt;&lt;/script&gt;</orekit.mathjax.enable>
<orekit.hipparchus.version>2.0-SNAPSHOT</orekit.hipparchus.version>
<orekit.hipparchus.version>2.0</orekit.hipparchus.version>
<orekit.junit.version>4.13.1</orekit.junit.version>
<orekit.compiler.source>1.8</orekit.compiler.source>
<orekit.compiler.target>1.8</orekit.compiler.target>
......
......@@ -25,6 +25,18 @@
Fix DateTimeComponents.toString(): correct ISO 8601, leap second, rounding issues.
Backwards incompatible.
</action>
<action dev="bryan" type="update" issue="626">
Used a separate Comparator for sorting integer least square solutions.
</action>
<action dev="bryan" type="update" issue="799">
Used the field-specific value of π.
</action>
<action dev="bryan" type="fix" issue="795" due-to="guylaine">
Fixed output of NRLMSISE00 for altitude at 32.5 km.
</action>
<action dev="luc" type="add" issue="821">
Added support for CCSDS TDM V2.0.
</action>
<action dev="luc" type="add" issue="819">
Allow data filtering upon loading to be used for explicit loading by applications.
</action>
......
......@@ -71,17 +71,17 @@ public class FieldGeodeticPoint<T extends CalculusFieldElement<T>> {
*/
public FieldGeodeticPoint(final T latitude, final T longitude,
final T altitude) {
double lat = MathUtils.normalizeAngle(latitude.getReal(), FastMath.PI / 2);
double lon = MathUtils.normalizeAngle(longitude.getReal(), 0);
if (lat > FastMath.PI / 2.0) {
final T zero = latitude.getField().getZero();
final T pi = zero.getPi();
T lat = MathUtils.normalizeAngle(latitude, pi.multiply(0.5));
T lon = MathUtils.normalizeAngle(longitude, zero);
if (lat.getReal() > pi.multiply(0.5).getReal()) {
// latitude is beyond the pole -> add 180 to longitude
lat = FastMath.PI - lat;
lon = MathUtils.normalizeAngle(longitude.getReal() + FastMath.PI, 0);
lat = pi.subtract(lat);
lon = MathUtils.normalizeAngle(longitude.add(pi), zero);
}
final double deltaLat = lat - latitude.getReal();
final double deltaLon = lon - longitude.getReal();
this.latitude = latitude.add(deltaLat);
this.longitude = longitude.add(deltaLon);
this.latitude = lat;
this.longitude = lon;
this.altitude = altitude;
}
......
......@@ -561,7 +561,7 @@ public class OneAxisEllipsoid extends Ellipsoid implements BodyShape {
final double evoluteCuspZ = FastMath.copySign(getA() * e2 / g, -z.getReal());
final T deltaZ = z.subtract(evoluteCuspZ);
// we use π/2 - atan(r/Δz) instead of atan(Δz/r) for accuracy purposes, as r is much smaller than Δz
phi = r.divide(deltaZ.abs()).atan().negate().add(0.5 * FastMath.PI).copySign(deltaZ);
phi = r.divide(deltaZ.abs()).atan().negate().add(r.getPi().multiply(0.5)).copySign(deltaZ);
h = deltaZ.hypot(r).subtract(osculatingRadius);
} else if (FastMath.abs(z.getReal()) <= ANGULAR_THRESHOLD * r.getReal()) {
// the point is almost on the major axis
......
......@@ -407,7 +407,7 @@ public class FundamentalNutationArguments implements Serializable {
final T tc = conventions.evaluateTC(date, timeScales);
final T gamma = gmstFunction == null ?
tc.getField().getZero().add(Double.NaN) : gmstFunction.value(date).add(FastMath.PI);
tc.getField().getZero().add(Double.NaN) : gmstFunction.value(date).add(tc.getPi());
final T gammaDot = gmstRateFunction == null ?
tc.getField().getZero().add(Double.NaN) : gmstRateFunction.value(date);
......
......@@ -16,6 +16,7 @@
*/
package org.orekit.estimation.measurements.gnss;
import java.util.Comparator;
import java.util.SortedSet;
import java.util.TreeSet;
......@@ -57,6 +58,19 @@ public abstract class AbstractLambdaMethod implements IntegerLeastSquareSolver {
/** Placeholder for solutions found. */
private SortedSet<IntegerLeastSquareSolution> solutions;
/** Comparator for integer least square solutions. */
private Comparator<IntegerLeastSquareSolution> comparator;
/** Constructor.
* <p>
* By default a {@link IntegerLeastSquareComparator} is used
* to compare integer least square solutions
* </p>
*/
protected AbstractLambdaMethod() {
this.comparator = new IntegerLeastSquareComparator();
}
/** {@inheritDoc} */
@Override
public IntegerLeastSquareSolution[] solveILS(final int nbSol, final double[] floatAmbiguities,
......@@ -82,6 +96,18 @@ public abstract class AbstractLambdaMethod implements IntegerLeastSquareSolver {
}
/** Set a custom comparator for integer least square solutions comparison.
* <p>
* Calling this method overrides any comparator that could have been set
* beforehand. It also overrides the default {@link IntegerLeastSquareComparator}.
* </p>
* @param newCompartor new comparator to use
* @since 11.0
*/
public void setComparator(final Comparator<IntegerLeastSquareSolution> newCompartor) {
this.comparator = newCompartor;
}
/** Initialize ILS problem.
* @param floatAmbiguities float estimates of ambiguities
* @param indirection indirection array to extract ambiguity covariances from global covariance matrix
......@@ -97,7 +123,7 @@ public abstract class AbstractLambdaMethod implements IntegerLeastSquareSolver {
this.diag = new double[n];
this.zInverseTransformation = new int[n * n];
this.maxSolutions = nbSol;
this.solutions = new TreeSet<>();
this.solutions = new TreeSet<>(comparator);
// initialize decomposition matrices
for (int i = 0; i < n; ++i) {
......
/* Copyright 2002-2021 CS GROUP
* Licensed to CS GROUP (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.gnss;
import java.util.Comparator;
/** Comparator for {@link IntegerLeastSquareSolution} instance.
* @see IntegerLeastSquareSolution
* @author Bryan Cazabonne
* @since 11.0
*/
public class IntegerLeastSquareComparator implements Comparator<IntegerLeastSquareSolution> {
/** Simple constructor.
*/
public IntegerLeastSquareComparator() {
// nothing to do
}
/** {@inheritDoc}
* The comparison is based on the squared
* distance to the float solution.
*/
@Override
public int compare(final IntegerLeastSquareSolution ilss1,
final IntegerLeastSquareSolution ilss2) {
if (ilss1 == null) {
return ilss2 == null ? 0 : -1;
} else if (ilss2 == null) {
return 1;
}
return Double.compare(ilss1.getSquaredDistance(), ilss2.getSquaredDistance());
}
}
......@@ -20,7 +20,7 @@ package org.orekit.estimation.measurements.gnss;
* @author Luc Maisonobe
* @since 10.0
*/
public class IntegerLeastSquareSolution implements Comparable<IntegerLeastSquareSolution> {
public class IntegerLeastSquareSolution {
/** Solution array. */
private final long[] solution;
......@@ -51,30 +51,4 @@ public class IntegerLeastSquareSolution implements Comparable<IntegerLeastSquare
return d2;
}
/** {@inheritDoc} */
@Override
public int compareTo(final IntegerLeastSquareSolution other) {
return Double.compare(getSquaredDistance(), other.getSquaredDistance());
}
/** {@inheritDoc}
* @since 10.1
*/
@Override
public boolean equals(final Object other) {
if (other instanceof IntegerLeastSquareSolution) {
return getSquaredDistance() == ((IntegerLeastSquareSolution) other).getSquaredDistance();
}
return false;
}
/** {@inheritDoc}
* @since 10.1
*/
@Override
public int hashCode() {
return 0X67b3 ^ Double.hashCode(getSquaredDistance());
}
}
......@@ -40,6 +40,10 @@ public enum ObservationType {
* Strength of the radio signal transmitted by the spacecraft as received at the ground station or at another spacecraft.
*/
CARRIER_POWER(Unit.ONE),
/** Data: Doppler counts [n/a].<p>
* Count of signal cycles.
*/
DOPPLER_COUNT(Unit.ONE),
/** Data: Doppler instantaneous [km/s].<p>
* Instantaneous range rate of the spacecraft.
*/
......@@ -52,6 +56,26 @@ public enum ObservationType {
PC_N0(Unit.ONE),
/** Data: Ranging power to noise spectral density ratio (Pr/No) [dBHz]. */
PR_N0(Unit.ONE),
/** Data: phase cycle count at receiver. */
RECEIVE_PHASE_CT_1(Unit.ONE),
/** Data: phase cycle count at receiver. */
RECEIVE_PHASE_CT_2(Unit.ONE),
/** Data: phase cycle count at receiver. */
RECEIVE_PHASE_CT_3(Unit.ONE),
/** Data: phase cycle count at receiver. */
RECEIVE_PHASE_CT_4(Unit.ONE),
/** Data: phase cycle count at receiver. */
RECEIVE_PHASE_CT_5(Unit.ONE),
/** Data: phase cycle count at transmitter. */
TRANSMIT_PHASE_CT_1(Unit.ONE),
/** Data: phase cycle count at transmitter. */
TRANSMIT_PHASE_CT_2(Unit.ONE),
/** Data: phase cycle count at transmitter. */
TRANSMIT_PHASE_CT_3(Unit.ONE),
/** Data: phase cycle count at transmitter. */
TRANSMIT_PHASE_CT_4(Unit.ONE),
/** Data: phase cycle count at transmitter. */
TRANSMIT_PHASE_CT_5(Unit.ONE),
/** Data: Range value [km, s or RU].
* @see RangeUnits
*/
......@@ -91,7 +115,7 @@ public enum ObservationType {
},
/** Data: Received frequencies [Hz].<p>
/** Data: Received frequencies [Hz].<p>
* The RECEIVE_FREQ keyword shall be used to indicate that the values represent measurements of the received frequency.<p>
* The keyword is indexed to accommodate a scenario in which multiple downlinks are used.<p>
* RECEIVE_FREQ_n (n = 1, 2, 3, 4, 5)
......@@ -168,6 +192,12 @@ public enum ObservationType {
*/
ANGLE_2(Unit.DEGREE),
// Optical/Radar Related keywords
/** Data: visual magnitude. */
MAG(Unit.ONE),
/** Data: Radar Cross section [m²]. */
RCS(Units.M2),
// Time Related Keywords
/** Data: Clock bias [s].<p>
* The CLOCK_BIAS keyword can be used by the message recipient to adjust timetag
......
......@@ -17,6 +17,8 @@
package org.orekit.files.ccsds.ndm.tdm;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
......@@ -37,6 +39,12 @@ import org.orekit.utils.Constants;
*/
public class TdmMetadata extends Metadata {
/** Identifier for the tracking data. */
private String trackId;
/** List of data types in the data section. */
private List<ObservationType> dataTypes;
/** Start epoch of total time span covered by observations block. */
private AbsoluteDate startTime;
......@@ -68,6 +76,9 @@ public class TdmMetadata extends Metadata {
/** Path 2 (see above). */
private int[] path2;
/** Map of external ephemeris names for participants (minimum 1 and up to 5). */
private Map<Integer, String> ephemerisNames;
/** Frequency band for transmitted frequencies. */
private String transmitBand;
......@@ -120,6 +131,21 @@ public class TdmMetadata extends Metadata {
/** Reference frame in which data are given: used in combination with ANGLE_TYPE=RADEC. */
private FrameFacade referenceFrame;
/** The interpolation method to be used. */
private String interpolationMethod;
/** The interpolation degree. */
private int interpolationDegree;
/** Bias that was added to Doppler count in the data section. */
private double doppplerCountBias;
/** Scaled by which Doppler count was multiplied in the data section. */
private double dopplerCountScale;
/** Indicator for occurred rollover in Doppler count. */
private boolean doppplerCountRollover;
/** Transmit delays map.<p>
* Specifies a fixed interval of time, in seconds, for the signal to travel from the transmitting
* electronics to the transmit point. Each item in the list corresponds to the each participants.
......@@ -150,11 +176,21 @@ public class TdmMetadata extends Metadata {
*/
private double correctionDoppler;
/** Correction magnitude.<p>
* Magnitude correction that has been added or should be added to the MAGNITUDE data.
*/
private double correctionMagnitude;
/** Raw correction Range in {@link #getRangeUnits()}.<p>
* Range correction that has been added or should be added to the RANGE data.
*/
private double rawCorrectionRange;
/** Correction radar cross section.<p>
* Radar cross section correction that has been added or should be added to the RCS data.
*/
private double correctionRcs;
/** Correction receive.<p>
* Receive correction that has been added or should be added to the RECEIVE data.
*/
......@@ -165,6 +201,16 @@ public class TdmMetadata extends Metadata {
*/
private double correctionTransmit;
/** Yearly aberration correction.<p>
* Yearly correction that has been added or should be added to the ANGLE data.
*/
private double correctionAberrationYearly;
/** Diurnal aberration correction.<p>
* Diurnl correction that has been added or should be added to the ANGLE data.
*/
private double correctionAberrationDiurnal;
/** Correction applied ? YES/NO<p>
* Indicate whethers or not the values associated with the CORRECTION_* keywords have been
* applied to the tracking data.
......@@ -175,9 +221,13 @@ public class TdmMetadata extends Metadata {
*/
public TdmMetadata() {
super(null);
participants = new TreeMap<>();
transmitDelays = new TreeMap<>();
receiveDelays = new TreeMap<>();
participants = new TreeMap<>();
ephemerisNames = new TreeMap<>();
doppplerCountBias = Double.NaN;
dopplerCountScale = 1;
doppplerCountRollover = false;
transmitDelays = new TreeMap<>();
receiveDelays = new TreeMap<>();
}
/** {@inheritDoc} */
......@@ -189,6 +239,37 @@ public class TdmMetadata extends Metadata {
}
}
/** Getter for the tracking data identifier.
* @return tracking data identifier
*/
public String getTrackId() {
return trackId;
}
/** Setter for the tracking data identifier.
* @param trackId tracking data identifier
*/
public void setTrackId(final String trackId) {
refuseFurtherComments();
this.trackId = trackId;
}
/** Getter for the data types in the data section.
* @return data types in the data section
*/
public List<ObservationType> getDataTypes() {
return dataTypes;
}
/** Setter for the data types in the data section.
* @param dataTypes data types in the data section
*/
public void setDataTypes(final List<ObservationType> dataTypes) {
refuseFurtherComments();
this.dataTypes = new ArrayList<>();
this.dataTypes.addAll(dataTypes);
}
/** Getter for the startTime.
* @return the startTime
*/
......@@ -304,6 +385,31 @@ public class TdmMetadata extends Metadata {
this.path2 = safeCopy(path2);
}
/** Getter for external ephemeris names for participants.
* @return external ephemeris names for participants
*/
public Map<Integer, String> getEphemerisNames() {
return ephemerisNames;
}
/** Setter for the external ephemeris names for participants.
* @param ephemerisNames external ephemeris names for participants
*/
public void setEphemerisNames(final Map<Integer, String> ephemerisNames) {
refuseFurtherComments();
this.ephemerisNames = new TreeMap<Integer, String>();
this.ephemerisNames.putAll(ephemerisNames);
}
/** Adds an ephemeris name to the list.
* @param participantNumber the number of the participant
* @param ephemerisName name of the ephemeris for the participant
*/
public void addEphemerisName(final int participantNumber, final String ephemerisName) {
refuseFurtherComments();
this.ephemerisNames.put(participantNumber, ephemerisName);
}
/** Getter for the transmitBand.
* @return the transmitBand
*/
......@@ -514,6 +620,92 @@ public class TdmMetadata extends Metadata {
this.referenceFrame = referenceFrame;
}
/**
* Get the interpolation method to be used.
*
* @return the interpolation method
*/
public String getInterpolationMethod() {
return interpolationMethod;
}
/**
* Set the interpolation method to be used.
* @param interpolationMethod the interpolation method to be set
*/
public void setInterpolationMethod(final String interpolationMethod) {
refuseFurtherComments();
this.interpolationMethod = interpolationMethod;
}
/**
* Get the interpolation degree.
* @return the interpolation degree
*/
public int getInterpolationDegree() {
return interpolationDegree;