...
 
Commits (65)
......@@ -57,6 +57,7 @@
<property name="severity" value="warning"/>
</module>
<module name="UnnecessaryParentheses"/>
<module name="NeedBraces"/>
<module name="UnusedImports"/>
<module name="VisibilityModifier"/>
<module name="WhitespaceAfter"/>
......
......@@ -5,7 +5,7 @@
<groupId>org.orekit</groupId>
<artifactId>orekit</artifactId>
<packaging>jar</packaging>
<version>10.0</version>
<version>10.1-SNAPSHOT</version>
<name>ORbit Extrapolation KIT</name>
<url>http://www.orekit.org/</url>
......
This diff is collapsed.
......@@ -20,6 +20,34 @@
<title>Orekit Changes</title>
</properties>
<body>
<release version="10.1" date="TBD" description="TBD">
<action dev="luc" type="fix" issue="483">
Reset additional state changed by event handlers and not managed by any
additional state providers.
</action>
<action dev="luc" type="add" issue="472">
Added support for Hatanaka Compact RINEX format.
</action>
<action dev="luc" type="fix" issue="574">
Cope with input stream readers that keep asking for new bytes after end
of Unix compressed files has been reached.
</action>
<action dev="luc" type="fix" issue="573">
Added detection of some corrupted Unix-compressed files.
</action>
<action dev="bryan" type="fix" issue="572">
Fixed the Saastamoinen model when station altitude is bigger than 5000.0 meters.
</action>
<action dev="luc" type="fix" issue="568">
Fixed too fast step increase in a bracketing attempt.
</action>
<action dev="luc" type="add">
Added phase measurement builder.
</action>
<action dev="luc" type="add">
Added getWavelength in GNSS Frequency.
</action>
</release>
<release version="10.0" date="2019-06-24"
description="Orekit 10.0 is a major new release. It includes DSST OD,
propagation in non-inertial frames, specialized propagators for GNSS
......
......@@ -30,6 +30,7 @@ import java.util.regex.Pattern;
import org.orekit.errors.OrekitException;
import org.orekit.errors.OrekitMessages;
import org.orekit.gnss.HatanakaCompressFilter;
/** Singleton class managing all supported {@link DataProvider data providers}.
......@@ -102,6 +103,7 @@ public class DataProvidersManager {
// set up predefined filters
addFilter(new GzipFilter());
addFilter(new UnixCompressFilter());
addFilter(new HatanakaCompressFilter());
predefinedFilters = filters.size();
......
......@@ -21,6 +21,7 @@ import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Serializable;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
......@@ -179,7 +180,7 @@ public class FundamentalNutationArguments implements Serializable {
final DefinitionParser definitionParser = new DefinitionParser();
// setup the reader
final BufferedReader reader = new BufferedReader(new InputStreamReader(stream, "UTF-8"));
final BufferedReader reader = new BufferedReader(new InputStreamReader(stream, StandardCharsets.UTF_8));
int lineNumber = 0;
// look for the reference date and the 14 polynomials
......
......@@ -20,6 +20,7 @@ import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
......@@ -524,7 +525,7 @@ public class PoissonSeriesParser {
try {
// setup the reader
final BufferedReader reader = new BufferedReader(new InputStreamReader(stream, "UTF-8"));
final BufferedReader reader = new BufferedReader(new InputStreamReader(stream, StandardCharsets.UTF_8));
int lineNumber = 0;
int expectedIndex = -1;
int nTerms = -1;
......
......@@ -20,6 +20,7 @@ import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
......@@ -93,7 +94,7 @@ public class SimpleTimeStampedTableParser<T extends TimeStamped> {
try {
// setup the reader
final BufferedReader reader = new BufferedReader(new InputStreamReader(stream, "UTF-8"));
final BufferedReader reader = new BufferedReader(new InputStreamReader(stream, StandardCharsets.UTF_8));
final List<T> table = new ArrayList<T>();
......
......@@ -75,6 +75,9 @@ public class UnixCompressFilter implements DataFilter {
/** Underlying compressed stream. */
private final InputStream input;
/** Indicator for end of input. */
private boolean endOfInput;
/** Common sequences table. */
private final UncompressedSequence[] table;
......@@ -119,9 +122,9 @@ public class UnixCompressFilter implements DataFilter {
ZInputStream(final String name, final InputStream input)
throws IOException {
this.name = name;
this.input = input;
this.name = name;
this.input = input;
this.endOfInput = false;
// check header
if (input.read() != MAGIC_HEADER_1 || input.read() != MAGIC_HEADER_2) {
......@@ -232,7 +235,14 @@ public class UnixCompressFilter implements DataFilter {
if (previousSequence != null && available < table.length) {
// update the table with the next uncompressed byte appended to previous sequence
final byte nextByte = (key == available) ? previousSequence.getByte(0) : table[key].getByte(0);
final byte nextByte;
if (key == available) {
nextByte = previousSequence.getByte(0);
} else if (table[key] != null) {
nextByte = table[key].getByte(0);
} else {
throw new OrekitIOException(OrekitMessages.CORRUPTED_FILE, name);
}
table[available++] = new UncompressedSequence(previousSequence, nextByte);
if (available > currentMaxKey && currentWidth < maxWidth) {
// we need to increase the key size
......@@ -258,8 +268,9 @@ public class UnixCompressFilter implements DataFilter {
public int read() throws IOException {
if (currentSequence == null) {
if (!selectNext()) {
if (endOfInput || !selectNext()) {
// we have reached end of data
endOfInput = true;
return -1;
}
}
......
......@@ -21,6 +21,7 @@ import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLConnection;
import java.nio.charset.StandardCharsets;
import java.util.Locale;
import java.util.MissingResourceException;
import java.util.PropertyResourceBundle;
......@@ -148,6 +149,7 @@ public enum OrekitMessages implements Localizable {
CCSDS_DATE_INVALID_PREAMBLE_FIELD("invalid preamble field in CCSDS date: {0}"),
CCSDS_DATE_INVALID_LENGTH_TIME_FIELD("invalid time field length in CCSDS date: {0}, expected {1}"),
CCSDS_DATE_MISSING_AGENCY_EPOCH("missing agency epoch in CCSDS date"),
CCSDS_MISSING_KEYWORD("missing mandatory key {0} in CCSDS file {1}"),
CCSDS_UNEXPECTED_KEYWORD("unexpected keyword in CCSDS line number {0} of file {1}:\n{2}"),
CCSDS_UNKNOWN_GM("the central body gravitational coefficient cannot be retrieved from the ODM"),
CCSDS_UNKNOWN_SPACECRAFT_MASS("there is no spacecraft mass associated with this ODM file"),
......@@ -236,7 +238,8 @@ public enum OrekitMessages implements Localizable {
"prefix that is matched against the name of each loaded file. It should " +
"not contain any regular expression syntax or directory components, i.e. " +
"\"/\" or \"\\\". Actual value: \"{0}\"."),
CANNOT_COMPUTE_AIMING_AT_SINGULAR_POINT("cannot compute aiming direction at singular point: latitude = {0}, longitude = {1}");
CANNOT_COMPUTE_AIMING_AT_SINGULAR_POINT("cannot compute aiming direction at singular point: latitude = {0}, longitude = {1}"),
NOT_A_SUPPORTED_HATANAKA_COMPRESSED_FILE("file {0} is not a supported Hatanaka-compressed file");
// CHECKSTYLE: resume JavadocVariable check
......@@ -319,7 +322,7 @@ public enum OrekitMessages implements Localizable {
if (stream != null) {
try {
// Only this line is changed to make it to read properties files as UTF-8.
bundle = new PropertyResourceBundle(new InputStreamReader(stream, "UTF-8"));
bundle = new PropertyResourceBundle(new InputStreamReader(stream, StandardCharsets.UTF_8));
} finally {
stream.close();
}
......
......@@ -69,7 +69,7 @@ public class Phase extends AbstractMeasurement<Phase> {
/** Simple constructor.
* @param station ground station from which measurement is performed
* @param date date of the measurement
* @param phase observed value
* @param phase observed value (cycles)
* @param wavelength phase observed value wavelength (m)
* @param sigma theoretical standard deviation
* @param baseWeight base weight
......
/* 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.gnss;
import org.hipparchus.random.CorrelatedRandomVectorGenerator;
import org.orekit.estimation.measurements.EstimationModifier;
import org.orekit.estimation.measurements.GroundStation;
import org.orekit.estimation.measurements.ObservableSatellite;
import org.orekit.estimation.measurements.generation.AbstractMeasurementBuilder;
import org.orekit.propagation.SpacecraftState;
import org.orekit.time.AbsoluteDate;
import org.orekit.utils.ParameterDriver;
/** Builder for {@link Phase} measurements.
* @author Luc Maisonobe
* @since 10.1
*/
public class PhaseBuilder extends AbstractMeasurementBuilder<Phase> {
/** Ground station from which measurement is performed. */
private final GroundStation station;
/** Wavelength of the phase observed value [m]. */
private final double wavelength;
/** Simple constructor.
* @param noiseSource noise source, may be null for generating perfect measurements
* @param station ground station from which measurement is performed
* @param wavelength phase observed value wavelength (m)
* @param sigma theoretical standard deviation
* @param baseWeight base weight
* @param satellite satellite related to this builder
*/
public PhaseBuilder(final CorrelatedRandomVectorGenerator noiseSource,
final GroundStation station, final double wavelength,
final double sigma, final double baseWeight,
final ObservableSatellite satellite) {
super(noiseSource, sigma, baseWeight, satellite);
this.station = station;
this.wavelength = wavelength;
}
/** {@inheritDoc} */
@Override
public Phase build(final SpacecraftState[] states) {
final ObservableSatellite satellite = getSatellites()[0];
final double sigma = getTheoreticalStandardDeviation()[0];
final double baseWeight = getBaseWeight()[0];
final SpacecraftState state = states[satellite.getPropagatorIndex()];
// create a dummy measurement
final Phase dummy = new Phase(station, state.getDate(), Double.NaN, wavelength, sigma, baseWeight, satellite);
for (final EstimationModifier<Phase> modifier : getModifiers()) {
dummy.addModifier(modifier);
}
// set a reference date for parameters missing one
for (final ParameterDriver driver : dummy.getParametersDrivers()) {
if (driver.getReferenceDate() == null) {
final AbsoluteDate start = getStart();
final AbsoluteDate end = getEnd();
driver.setReferenceDate(start.durationFrom(end) <= 0 ? start : end);
}
}
// estimate the perfect value of the measurement
double phase = dummy.estimate(0, 0, states).getEstimatedValue()[0];
// add the noise
final double[] noise = getNoise();
if (noise != null) {
phase += noise[0];
}
// generate measurement
final Phase measurement = new Phase(station, state.getDate(), phase, wavelength, sigma, baseWeight, satellite);
for (final EstimationModifier<Phase> modifier : getModifiers()) {
measurement.addModifier(modifier);
}
return measurement;
}
}
/* 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.gnss;
import java.util.Collections;
import java.util.List;
import org.hipparchus.geometry.euclidean.threed.Rotation;
import org.hipparchus.geometry.euclidean.threed.Vector3D;
import org.hipparchus.util.FastMath;
import org.hipparchus.util.MathUtils;
import org.orekit.estimation.measurements.EstimatedMeasurement;
import org.orekit.estimation.measurements.EstimationModifier;
import org.orekit.estimation.measurements.GroundStation;
import org.orekit.frames.Frame;
import org.orekit.utils.ParameterDriver;
import org.orekit.utils.TimeStampedPVCoordinates;
/** Modifier for wind-up effect in GNSS {@link Phase phase measurements}.
* @see <a href="https://gssc.esa.int/navipedia/index.php/Carrier_Phase_Wind-up_Effect">Carrier Phase Wind-up Effect</a>
* @see WindUpFactory
* @author Luc Maisonobe
* @since 10.1
*/
public class WindUp implements EstimationModifier<Phase> {
/** Cached angular value of wind-up. */
private double angularWindUp;
/** Simple constructor.
* <p>
* The constructor is package protected to enforce use of {@link WindUpFactory}
* and preserve phase continuity for successive measurements involving the same
* satellite/receiver pair.
* </p>
*/
WindUp() {
angularWindUp = 0.0;
}
/** {@inheritDoc}
* <p>
* Wind-up effect has no parameters, the returned list is always empty.
* </p>
*/
@Override
public List<ParameterDriver> getParametersDrivers() {
return Collections.emptyList();
}
/** {@inheritDoc} */
@Override
public void modify(final EstimatedMeasurement<Phase> estimated) {
// signal line of sight
final TimeStampedPVCoordinates[] participants = estimated.getParticipants();
final Vector3D los = participants[1].getPosition().subtract(participants[0].getPosition()).normalize();
// get ground antenna dipole
final Frame inertial = estimated.getStates()[0].getFrame();
final GroundStation station = estimated.getObservedMeasurement().getStation();
final Rotation offsetToInert = station.getOffsetToInertial(inertial, estimated.getDate()).getRotation();
final Vector3D iGround = offsetToInert.applyTo(Vector3D.PLUS_I);
final Vector3D jGround = offsetToInert.applyTo(Vector3D.PLUS_J);
final Vector3D dGround = new Vector3D(1.0, iGround, -Vector3D.dotProduct(iGround, los), los).
add(Vector3D.crossProduct(los, jGround));
// get satellite dipole
// we don't use the basic yaw steering attitude model from ESA navipedia page
// but rely on the attitude that was computed by the propagator, which takes
// into account the proper noon and midnight turns for each satellite model
final Rotation satToInert = estimated.getStates()[0].toTransform().getRotation().revert();
final Vector3D iSat = satToInert.applyTo(Vector3D.PLUS_I);
final Vector3D jSat = satToInert.applyTo(Vector3D.PLUS_J);
final Vector3D dSat = new Vector3D(1.0, iSat, -Vector3D.dotProduct(iSat, los), los).
subtract(Vector3D.crossProduct(los, jSat));
// raw correction
final double correction = FastMath.copySign(Vector3D.angle(dSat, dGround),
Vector3D.dotProduct(los, Vector3D.crossProduct(dSat, dGround)));
// ensure continuity accross measurements
// we assume the various measurements are close enough in time
// (less the one satellite half-turn) so the angles remain close
angularWindUp = MathUtils.normalizeAngle(correction, angularWindUp);
// update estimate
estimated.setEstimatedValue(estimated.getEstimatedValue()[0] + angularWindUp / MathUtils.TWO_PI);
}
}
/* 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.gnss;
import java.util.HashMap;
import java.util.Map;
import org.orekit.gnss.SatelliteSystem;
/** Factory for {@link WindUp wind-up} modifiers.
* <p>
* The factory ensures the same instance is returned for all
* satellite/receiver pair, thus preserving phase continuity
* for successive measurements involving the same pair.
* </p>
* @author Luc Maisonobe
* @since 10.1
*/
public class WindUpFactory {
/** Modifiers cache. */
private final Map<SatelliteSystem, Map<Integer, Map<String, WindUp>>> modifiers;
/** Simple constructor.
*/
WindUpFactory() {
this.modifiers = new HashMap<>();
}
/** Get a modifier for a satellite/receiver pair.
* @param system system the satellite belongs to
* @param prnNumber PRN number
* @param receiverName name of the receiver
* @return modifier for the satellite/receiver pair
*/
public WindUp getWindUp(final SatelliteSystem system, final int prnNumber, final String receiverName) {
// select satellite system
Map<Integer, Map<String, WindUp>> systemModifiers = modifiers.get(system);
if (systemModifiers == null) {
// build a new map for this satellite system
systemModifiers = new HashMap<>();
modifiers.put(system, systemModifiers);
}
// select satellite
Map<String, WindUp> satelliteModifiers = systemModifiers.get(prnNumber);
if (satelliteModifiers == null) {
// build a new map for this satellite
satelliteModifiers = new HashMap<>();
systemModifiers.put(prnNumber, satelliteModifiers);
}
// select receiver
WindUp receiverModifier = satelliteModifiers.get(receiverName);
if (receiverModifier == null) {
// build a new wind-up modifier
receiverModifier = new WindUp();
satelliteModifiers.put(receiverName, receiverModifier);
}
return receiverModifier;
}
}
/* 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.files.ccsds;
/** Orbit element set type used in CCSDS {@link OCMFile Orbit Comprehensive Messages}.
* @see <a href="https://sanaregistry.org/r/orbital_elements">SANA registry for orbital elements</a>
* @author Luc Maisonobe
* @since 10.1
*/
public enum CCSDSElementsType {
/** Spherical 6-element set (α,δ,β,A,r,v). */
ADBARV("Spherical 6-element set (α,δ,β,A,r,v)",
CCSDSUnit.DEG, CCSDSUnit.DEG, CCSDSUnit.DEG,
CCSDSUnit.DEG, CCSDSUnit.KM, CCSDSUnit.KM),
/** Cartesian 3-element position (X, Y, Z). */
CARTP("Cartesian 3-element position (X, Y, Z)",
CCSDSUnit.KM, CCSDSUnit.KM, CCSDSUnit.KM),
/** Cartesian 6-element position and velocity (X, Y, Z, XD, YD, ZD). */
CARTPV(" Cartesian 6-element position and velocity (X, Y, Z, XD, YD, ZD)",
CCSDSUnit.KM, CCSDSUnit.KM, CCSDSUnit.KM,
CCSDSUnit.KM_S, CCSDSUnit.KM_S, CCSDSUnit.KM_S),
/** Cartesian 9-element position, velocity and acceleration (X, Y, Z, XD, YD, ZD, XDD, YDD, ZDD). */
CARTPVA("Cartesian 9-element position, velocity and acceleration (X, Y, Z, XD, YD, ZD, XDD, YDD, ZDD)",
CCSDSUnit.KM, CCSDSUnit.KM, CCSDSUnit.KM,
CCSDSUnit.KM_S, CCSDSUnit.KM_S, CCSDSUnit.KM_S,
CCSDSUnit.KM_S2, CCSDSUnit.KM_S2, CCSDSUnit.KM_S2),
/** Delaunay elements (L, G, H, l, g, h). */
DELAUNAY("Delaunay elements (L, G, H, l, g, h)",
CCSDSUnit.KM2_S, CCSDSUnit.KM2_S, CCSDSUnit.KM2_S,
CCSDSUnit.DEG, CCSDSUnit.DEG, CCSDSUnit.DEG),
/** Modified Delaunay elements (Lm, Gm, Hm, lm, gm, hm). */
DELAUNAYMOD("Delaunay elements (Lm, Gm, Hm, lm, gm, hm)",
CCSDSUnit.SQKM, CCSDSUnit.SQKM, CCSDSUnit.SQKM,
CCSDSUnit.DEG, CCSDSUnit.DEG, CCSDSUnit.DEG),
/** 12 elements eigenvalue/eigenvectors (EigMaj, EigMed, EigMin, EigVecMaj, EigVecMed, EigVecMin). */
EIGVAL3EIGVEC3("12 elements eigenvalue/eigenvectors (EigMaj, EigMed, EigMin, EigVecMaj, EigVecMed, EigVecMin)",
CCSDSUnit.KM, CCSDSUnit.KM, CCSDSUnit.KM,
CCSDSUnit.DIMENSIONLESS, CCSDSUnit.DIMENSIONLESS, CCSDSUnit.DIMENSIONLESS,
CCSDSUnit.DIMENSIONLESS, CCSDSUnit.DIMENSIONLESS, CCSDSUnit.DIMENSIONLESS,
CCSDSUnit.DIMENSIONLESS, CCSDSUnit.DIMENSIONLESS, CCSDSUnit.DIMENSIONLESS),
/** Equinoctial elements (a, af, ag, L=M+ω+frΩ, χ, ψ, fr). */
EQUINOCTIAL(" Equinoctial elements (a, af, ag, L=M+ω+frΩ, χ, ψ, fr)",
CCSDSUnit.KM, CCSDSUnit.DIMENSIONLESS, CCSDSUnit.DIMENSIONLESS,
CCSDSUnit.DEG, CCSDSUnit.DIMENSIONLESS, CCSDSUnit.DIMENSIONLESS,
CCSDSUnit.DIMENSIONLESS),
/** Modified equinoctial elements (p=a(1−e²), af, ag, L'=υ+ω+frΩ, χ, ψ, fr). */
EQUINOCTIALMOD("Modified equinoctial elements (p=a(1−e²), af, ag, L'=υ+ω+frΩ, χ, ψ, fr)",
CCSDSUnit.KM, CCSDSUnit.DIMENSIONLESS, CCSDSUnit.DIMENSIONLESS,
CCSDSUnit.DEG, CCSDSUnit.DIMENSIONLESS, CCSDSUnit.DIMENSIONLESS,
CCSDSUnit.DIMENSIONLESS),
/** Geodetic elements (λ, ΦGD, β, A, h, vre). */
GEODETIC("Geodetic elements (λ, ΦGD, β, A, h, vre)",
CCSDSUnit.DEG, CCSDSUnit.DEG, CCSDSUnit.DEG,
CCSDSUnit.DEG, CCSDSUnit.KM, CCSDSUnit.KM_S),
/** Keplerian 6-elemnt classical set (a, e, i, Ω, ω, ν). */
KEPLERIAN("Keplerian 6-elemnt classical set (a, e, i, Ω, ω, ν)",
CCSDSUnit.KM, CCSDSUnit.DIMENSIONLESS, CCSDSUnit.DEG,
CCSDSUnit.DEG, CCSDSUnit.DEG, CCSDSUnit.DEG),
/** Keplerian 6-elemnt classical set (a, e, i, Ω, ω, M). */
KEPLERIANMEAN("Keplerian 6-elemnt classical set (a, e, i, Ω, ω, M)",
CCSDSUnit.KM, CCSDSUnit.DIMENSIONLESS, CCSDSUnit.DEG,
CCSDSUnit.DEG, CCSDSUnit.DEG, CCSDSUnit.DEG),
/** Modified spherical 6-element set (λ, δ, β, A, r, v). */
LDMARV(" Modified spherical 6-element set (λ, δ, β, A, r, v)",
CCSDSUnit.DEG, CCSDSUnit.DEG, CCSDSUnit.DEG,
CCSDSUnit.DEG, CCSDSUnit.KM, CCSDSUnit.KM_S),
/** Geosynchronous on-station tailored set (a, ex, ey, ix, iy, λ). */
ONSTATION("Geosynchronous on-station tailored set (a, ex, ey, ix, iy, λ)",
CCSDSUnit.KM, CCSDSUnit.DIMENSIONLESS, CCSDSUnit.DIMENSIONLESS,
CCSDSUnit.DIMENSIONLESS, CCSDSUnit.DIMENSIONLESS, CCSDSUnit.DEG),
/** Canonical counterpart of equinoctial 6-element set (λM=M+ω+Ω, gp, hp, Lp, Gp, Hp). */
POINCARE("Canonical counterpart of equinoctial 6-element set (λM=M+ω+Ω, gp, hp, Lp, Gp, Hp)",
CCSDSUnit.DEG, CCSDSUnit.KM_SQS, CCSDSUnit.KM_SQS,
CCSDSUnit.KM2_S, CCSDSUnit.KM_SQS, CCSDSUnit.KM_SQS);
/** Description. */
private final String description;
/** Elements units. */
private final CCSDSUnit[] units;
/** Simple constructor.
* @param description description
* @param units elements units
*/
CCSDSElementsType(final String description, final CCSDSUnit... units) {
this.description = description;
this.units = units.clone();
}
/** Get the elements units.
* @return elements units
*/
public CCSDSUnit[] getUnits() {
return units.clone();
}
/** {@inheritDoc} */
@Override
public String toString() {
return description;
}
}
......@@ -42,6 +42,17 @@ public enum CCSDSFrame {
},
/** Earth Mean Equator and Equinox of J2000. */
J2000(null) {
/** {@inheritDoc} */
@Override
public Frame getFrame(final IERSConventions conventions, final boolean simpleEOP) {
return FramesFactory.getEME2000();
}
},
/** Geocentric Celestial Reference Frame. */
GCRF(null) {
......
/* 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.files.ccsds;
/** Object type used in CCSDS {@link OCMFile Orbit Comprehensive Messages}.
* @author Luc Maisonobe
* @since 10.1
*/
public enum CCSDSObjectType {
/** Payload. */
PL("Payload"),
/** Payload mission-related. */
PM("Payload mission-related"),
/** Payload fragmentation debris. */
PF("Payload fragmentation debris"),
/** Payload debris. */
PD("Payload debris"),
/** Rocket body. */
RB("Rocket body"),
/** Rocket mission-related. */
RM("Rocket mission-related"),
/** Rocket fragmentation debris. */
RF("Rocket fragmentation debris"),
/** Rocket debris. */
RD("Rocket debris"),
/** Unidentified. */
UI("Unidentified");
/** Description. */
private final String description;
/** Simple constructor.
* @param description description
*/
CCSDSObjectType(final String description) {
this.description = description;
}
/** {@inheritDoc} */
@Override
public String toString() {
return description;
}
}
/* 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.files.ccsds;
/** Operational status used in CCSDS {@link OCMFile Orbit Comprehensive Messages}.
* @author Luc Maisonobe
* @since 10.1
*/
public enum CCSDSOpsStatus {
/** Operational object. */
OPERATIONAL("Operational"),
/** Non-operational object. */
NONOPERATIONAL("Non-operational"),
/** partially operational object. */
PARTIALLY_OPERATIONAL("Partially operational"),
/** Backup object. */
BACKUP("Backup"),
/** Object in stand-by. */
STANBY("Stand-by"),
/** Object in extended mission. */
EXTENDED_MISSION("Extended mission"),
/** Object in reentry mode. */
REENTRY_MODE("Reentry mode"),
/** Decayed object. */
DECAYED("Decayed"),
/** Unknown status. */
UNKNOWN("Unknown");
/** Description. */
private final String description;
/** Simple constructor.
* @param description description
*/
CCSDSOpsStatus(final String description) {
this.description = description;
}
/** {@inheritDoc} */
@Override
public String toString() {
return description;
}
}
/* 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.files.ccsds;
/** Basis of orbit state time history data {@link OCMFile Orbit Comprehensive Messages}.
* @author Luc Maisonobe
* @since 10.1
*/
public enum CCSDSOrbitBasis {
/** Predicted. */
PREDICTED("Predicted"),
/** Estimated from orbit determination. */
DETERMINED_OD("Estimated from orbit determination"),
/** Estimated from telemetry. */
DETERMINED_TLM("Estimated from telemetry"),
/** Hypothetical. */
HYPOTHETICAL("Hypothetical");
/** Description. */
private final String description;
/** Simple constructor.
* @param description description
*/
CCSDSOrbitBasis(final String description) {
this.description = description;
}
/** {@inheritDoc} */
@Override
public String toString() {
return description;
}
}
/* 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.files.ccsds;
/** Orbit type used in CCSDS {@link OCMFile Orbit Comprehensive Messages}.
* @author Luc Maisonobe
* @since 10.1
*/
public enum CCSDSOrbitType {
/** Extended Geostationary Orbit, 37948 < a < 46380 km, e < 0.25, i < 25°. */
EGO("Extended Geostationary Orbit"),
/** Escape Orbit. */
ESO("Escape Orbit"),
/** GEO-superGEO, Crossing Orbit 31570 < hp < 40002 km, 40002 km < ha. */
GHO("GEO-superGEO, Crossing Orbit"),
/** Geosynchronous Earth Orbit, with i > 3°, 35586 < hp < 35986 km, 35586 < ha < 35986 km. */
GEO("Geosynchronous Earth Orbit"),
/** GeoStationary Orbit, with 3° < i < 25°, 35586 < hp < 35986 km, 35586 < ha < 35986 km. */
GSO("GeoStationary Orbit"),
/** Geosynchronous Transfer Orbit, i < 90°, hp < 2000 km, 31570 < ha < 40002 km. */
GTO("Geosynchronous Transfer Orbit"),
/** High Altitude Earth Orbit, 40002 km < hp, 40002 km < ha. */
HAO("High Altitude Earth Orbit"),
/** Highly Eccentric Earth Orbit, hp < 31570 km, 40002 km < ha. */
HEO("Highly Eccentric Earth Orbit"),
/** Inclined Geosynchronous Orbit, 37948 < a < 46380 km, e < 0.25, 25° < i < 180°. */
IGO("Inclined Geosynchronous Orbit"),
/** Low Earth Orbit, hp < 2000 km, ha < 2000 km. */
LEO("Low Earth Orbit"),
/** LEO-MEO Crossing Orbit, hp < 2000 km, 2000 < ha < 31570 km. */
LMO("LEO-MEO Crossing Orbit"),
/** Medium Earth Orbit, 2000 < hp < 31570 km, 2000 < ha < 31570 km. */
MEO("Medium Earth Orbit"),
/** MEO-GEO Crossing Orbit, 2000 < hp < 31570 km, 31570 < ha < 40002 km. */
MGO("MEO-GEO Crossing Orbit"),
/** Navigation Satellites Orbit 50° < i < 70°, 18100 < hp < 24300 km, 18100 < ha < 4300 km. */
NSO("Navigation Satellites Orbit"),
/** UFO: Undefined Orbit. */
UFO("Undefined Orbit");
/** Description. */
private final String description;
/** Simple constructor.
* @param description description
*/
CCSDSOrbitType(final String description) {
this.description = description;
}
/** {@inheritDoc} */
@Override
public String toString() {
return description;
}
}
/* 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.files.ccsds;
import org.hipparchus.util.FastMath;
/** CCSDS/SANA units (km, km/s, degrees...).
* @author Luc Maisonobe
* @since 10.1
*/
public enum CCSDSUnit {
/** Kilometers. */
KM() {
/** {@inheritDoc} */
@Override
public double toSI(final double value) {
return value * 1000.0;
}
},
/** Kilometers per seconds. */
KM_S() {
/** {@inheritDoc} */
@Override
public double toSI(final double value) {
return value * 1000.0;
}
},
/** Kilometers per squared seconds. */
KM_S2() {
/** {@inheritDoc} */
@Override
public double toSI(final double value) {
return value * 1000.0;
}
},
/** Square kilometers. */
KM2() {
/** {@inheritDoc} */
@Override
public double toSI(final double value) {
return value * 1000000.0;
}
},
/** Square kilometers per second. */
KM2_S() {
/** {@inheritDoc} */
@Override
public double toSI(final double value) {
return value * 1000000.0;
}
},
/** Kilometers square roots. */
SQKM() {
/** {@inheritDoc} */
@Override
public double toSI(final double value) {
return value * FastMath.sqrt(1000.0);
}
},
/** Kilometers per seconds square roots. */
KM_SQS() {
/** {@inheritDoc} */
@Override
public double toSI(final double value) {
return value * 1000.0;
}
},
/** Degrees. */
DEG() {
/** {@inheritDoc} */
@Override
public double toSI(final double value) {
return FastMath.toRadians(value);
}
},
/** Dimensionless values. */
DIMENSIONLESS() {
/** {@inheritDoc} */
@Override
public double toSI(final double value) {
return value;
}
};
/** Convert a value from CCSDS/SANA units to SI units.
* @param value value in CCSDS/SANA units
* @return value in SI units
*/
public abstract double toSI(double value);
}
......@@ -192,4 +192,17 @@ public enum CcsdsTimeScale {
return false;
}
/** Parse a value from a key=value entry.
* @param value value to parse
* @return CCSDS time system corresponding to the value
*/
public static CcsdsTimeScale parse(final String value) {
for (final CcsdsTimeScale scale : values()) {
if (scale.name().equals(value)) {
return scale;
}
}
throw new OrekitException(OrekitMessages.CCSDS_TIME_SYSTEM_NOT_IMPLEMENTED, value);
}
}
......@@ -16,6 +16,8 @@
*/
package org.orekit.files.ccsds;
import java.util.Arrays;
import java.util.List;
import java.util.Locale;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
......@@ -50,6 +52,9 @@ class KeyValue {
private final Pattern USER_DEFINED_KEYWORDS =
Pattern.compile("USER_DEFINED_[A-Z][A-Z_]*");
/** Regular expression for splitting comma-separated lists. */
private final String COMMA_SEPARATORS = "\\s*,\\s*";
/** Line from which pair is extracted. */
private final String line;
......@@ -146,6 +151,14 @@ class KeyValue {
this.fileName = fileName;
}
/** Get the line where the keyword was found.
* @return line where the keyword was found
* @since 10.1
*/
public String getLine() {
return line;
}
/** Keyword corresponding to the parsed key.
* @return keyword corresponding to the parsed key
* (null if not recognized)
......@@ -175,8 +188,7 @@ class KeyValue {
try {
return Double.parseDouble(value);
} catch (NumberFormatException nfe) {
throw new OrekitException(OrekitMessages.UNABLE_TO_PARSE_LINE_IN_FILE,
lineNumber, fileName, line);
throw generateException();
}
}
......@@ -187,9 +199,24 @@ class KeyValue {
try {
return Integer.parseInt(value);
} catch (NumberFormatException nfe) {
throw new OrekitException(OrekitMessages.UNABLE_TO_PARSE_LINE_IN_FILE,
lineNumber, fileName, line);
throw generateException();
}
}
/** Get the value as a list.
* @return value
* @since 10.1
*/
public List<String> getListValue() {
return Arrays.asList(value.split(COMMA_SEPARATORS));
}
/** Generate a parse exception for this key value pair.
* @return exception for this key value pair
*/
public OrekitException generateException() {
return new OrekitException(OrekitMessages.UNABLE_TO_PARSE_LINE_IN_FILE,
lineNumber, fileName, line);
}
}
......@@ -37,10 +37,18 @@ public enum Keyword {
/** Comments specific to a ODM file. */
COMMENT,
/** CCSDS OEM format version. */
/** File creation date in UTC. */
CREATION_DATE,
/** Creating agency or operator. */
ORIGINATOR,
/** Unique ID identifying a message from a given originator.
* @since 10.0
*/
MESSAGE_ID,
/** Classification of this message.
* @since 10.0
*/
MESSAGE_CLASSIF,
/** Time system used for state vector, maneuver, and covariance data. */
TIME_SYSTEM,
/** Epoch of state vector and optional Keplerian elements.
......@@ -74,10 +82,341 @@ public enum Keyword {
CCSDS_OPM_VERS,
/** CCSDS OMM format version. */
CCSDS_OMM_VERS,
/** File creation date in UTC. */
/** CCSDS OEM format version. */
CCSDS_OEM_VERS,
/** CCSDS OCM format version.
* @since 10.0
*/
CCSDS_OCM_VERS,
/** Programmatic Point Of Contact at originator.
* @since 10.0
*/
ORIGINATOR_POC,
/** Position of Programmatic Point Of Contact at originator.
* @since 10.0
*/
ORIGINATOR_POSITION,
/** Phone number of Programmatic Point Of Contact at originator.
* @since 10.0
*/
ORIGINATOR_PHONE,
/** Address of Programmatic Point Of Contact at originator.
* @since 10.0
*/
ORIGINATOR_ADDRESS,
/** Creating agency or operator.
* @since 10.0
*/
TECH_ORG,
/** Technical Point Of Contact at originator.
* @since 10.0
*/
TECH_POC,
/** Position of Technical Point Of Contact at originator.
* @since 10.0
*/
TECH_POSITION,
/** Phone number of Technical Point Of Contact at originator.
* @since 10.0
*/
TECH_PHONE,
/** Address of Technical Point Of Contact at originator.
* @since 10.0
*/
TECH_ADDRESS,
/** Unique ID identifying previous message from a given originator.
* @since 10.0
*/
PREV_MESSAGE_ID,
/** Creation date of previous message from a given originator.
* @since 10.0
*/
PREV_MESSAGE_EPOCH,
/** Unique ID identifying next message from a given originator.
* @since 10.0
*/
NEXT_MESSAGE_ID,
/** Creation date of next message from a given originator.
* @since 10.0
*/
NEXT_MESSAGE_EPOCH,
/** Names of Attitude Data Messages link to this Orbit Data Message.
* @since 10.0
*/
ATT_MESSAGE_LINK,
/** Names of Conjunction Data Messages link to this Orbit Data Message.
* @since 10.0
*/
CDM_MESSAGE_LINK,
/** Names of Pointing Request Messages link to this Orbit Data Message.
* @since 10.0
*/
PRM_MESSAGE_LINK,
/** Names of Reentry Data Messages link to this Orbit Data Message.
* @since 10.0
*/
RDM_MESSAGE_LINK,
/** Names of Tracking Data Messages link to this Orbit Data Message.
* @since 10.0
*/
TDM_MESSAGE_LINK,
/** Spacecraft name for which the orbit state is provided. */
OBJECT_NAME,
/** International designator for the object as assigned by the UN Committee
* on Space Research (COSPAR) and the US National Space Science Data Center (NSSDC).
* @since 10.0
*/
INTERNATIONAL_DESIGNATOR,
/** Operator of the space object.
* @since 10.0
*/