...
 
Commits (76)
......@@ -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>
......@@ -46,7 +46,7 @@
<orekit.nexus-staging-maven-plugin.version>1.6.8</orekit.nexus-staging-maven-plugin.version>
<orekit.maven-gpg-plugin.version>1.6</orekit.maven-gpg-plugin.version>
<orekit.maven-install-plugin.version>3.0.0-M1</orekit.maven-install-plugin.version>
<orekit.hipparchus.version>1.5</orekit.hipparchus.version>
<orekit.hipparchus.version>1.6-SNAPSHOT</orekit.hipparchus.version>
<orekit.junit.version>4.12</orekit.junit.version>
<orekit.compiler.source>1.8</orekit.compiler.source>
<orekit.compiler.target>1.8</orekit.compiler.target>
......
This diff is collapsed.
......@@ -20,6 +20,58 @@
<title>Orekit Changes</title>
</properties>
<body>
<release version="10.1" date="TBD" description="TBD">
<action dev="bryan" type="fix" issue="585">
Improved contributing guide.
</action>
<action dev="petrus" type="fix" issue="570">
Make FieldOfView.getFootprint public.
</action>
<action dev="bryan" type="add">
Add Nequick ionospheric model.
</action>
<action dev="luc" type="fix" issue="581">
Fixed spurious empty line insertion during Rinex 2 decompression
when the number of observations per satellite is a multiple of 5
</action>
<action dev="luc" type="fix" issue="580">
Fixed decompression of very small negative values in Hatanaka
Compact RINEX format.
</action>
<action dev="luc" type="fix" issue="578">
Orbit determination tutorials (and tests too) now supports compressed
measurement files (gzip, Unix compress, Hatanaka Compact RINEX).
</action>
<action dev="luc" type="fix" issue="579">
Handle properly special events flags in Hatanaka Compact RINEX format.
</action>
<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;
......@@ -236,7 +237,11 @@ 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}"),
STEC_INTEGRATION_DID_NOT_CONVERGE("STEC integration did not converge"),
MODIP_GRID_NOT_LOADED("MODIP grid not be loaded from {0}"),
NEQUICK_F2_FM3_NOT_LOADED("NeQuick coefficient f2 or fm3 not be loaded from {0}"),
NOT_A_SUPPORTED_HATANAKA_COMPRESSED_FILE("file {0} is not a supported Hatanaka-compressed file");
// CHECKSTYLE: resume JavadocVariable check
......@@ -319,7 +324,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;
}
}
......@@ -89,11 +89,10 @@ public class IonosphericDSConverter {
// mass never has derivatives
final DerivativeStructure dsM = factory.constant(state.getMass());
final DerivativeStructure dsMu = factory.constant(state.getMu());
final FieldOrbit<DerivativeStructure> dsOrbit =
new FieldCartesianOrbit<>(new TimeStampedFieldPVCoordinates<>(state.getDate(), posDS, velDS, accDS),
state.getFrame(), dsMu);
state.getFrame(),
factory.getDerivativeField().getZero().add(state.getMu()));
final FieldAttitude<DerivativeStructure> dsAttitude;
if (freeStateParameters > 3) {
......@@ -149,7 +148,7 @@ public class IonosphericDSConverter {
extend(pv0.getPosition(), factory),
extend(pv0.getVelocity(), factory),
extend(pv0.getAcceleration(), factory)),
s0.getFrame(), s0.getMu());
s0.getFrame(), extend(s0.getMu(), factory));
// attitude
final FieldAngularCoordinates<DerivativeStructure> ac0 = s0.getAttitude().getOrientation();
......
......@@ -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.Scanner;
......@@ -138,7 +139,7 @@ public class OEMParser extends ODMParser implements EphemerisFileParser {
/** {@inheritDoc} */
public OEMFile parse(final InputStream stream, final String fileName) {
try (BufferedReader reader = new BufferedReader(new InputStreamReader(stream, "UTF-8"))) {
try (BufferedReader reader = new BufferedReader(new InputStreamReader(stream, StandardCharsets.UTF_8))) {
return parse(reader, fileName);
} catch (IOException ioe) {
throw new OrekitException(ioe, new DummyLocalizable(ioe.getMessage()));
......
......@@ -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;
......@@ -139,7 +140,7 @@ public class OMMParser extends ODMParser {
try {
final BufferedReader reader =
new BufferedReader(new InputStreamReader(stream, "UTF-8"));
new BufferedReader(new InputStreamReader(stream, StandardCharsets.UTF_8));
// initialize internal data structures
final ParseInfo pi = new ParseInfo();
......
......@@ -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;
......@@ -132,7 +133,7 @@ public class OPMParser extends ODMParser {
public OPMFile parse(final InputStream stream, final String fileName) {
try {
final BufferedReader reader = new BufferedReader(new InputStreamReader(stream, "UTF-8"));
final BufferedReader reader = new BufferedReader(new InputStreamReader(stream, StandardCharsets.UTF_8));
// initialize internal data structures
final ParseInfo pi = new ParseInfo();
pi.fileName = fileName;
......
......@@ -21,6 +21,7 @@ import java.io.FileInputStream;
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.Locale;
......@@ -643,7 +644,7 @@ public class TDMParser extends DefaultHandler {
* @return parsed file content in a TDMFile object
*/
public TDMFile parse(final InputStream stream, final String fileName) {
try (BufferedReader reader = new BufferedReader(new InputStreamReader(stream, "UTF-8"))) {
try (BufferedReader reader = new BufferedReader(new InputStreamReader(stream, StandardCharsets.UTF_8))) {
try {
// Initialize internal TDMFile
final TDMFile tdmFile = parseInfo.tdmFile;
......
......@@ -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.Collections;
import java.util.HashMap;
import java.util.Map;
......@@ -122,7 +123,7 @@ public class AstronomicalAmplitudeReader implements DataLoader {
throws IOException {
// parse the file
final BufferedReader r = new BufferedReader(new InputStreamReader(input, "UTF-8"));
final BufferedReader r = new BufferedReader(new InputStreamReader(input, StandardCharsets.UTF_8));
int lineNumber = 0;
for (String line = r.readLine(); line != null; line = r.readLine()) {
++lineNumber;
......
......@@ -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.text.ParseException;
import java.util.ArrayList;
import java.util.List;
......@@ -94,7 +95,7 @@ public class EGMFormatReader extends PotentialCoefficientsReader {
setTideSystem(TideSystem.TIDE_FREE);
}
final BufferedReader r = new BufferedReader(new InputStreamReader(input, "UTF-8"));
final BufferedReader r = new BufferedReader(new InputStreamReader(input, StandardCharsets.UTF_8));
final List<List<Double>> c = new ArrayList<List<Double>>();
final List<List<Double>> s = new ArrayList<List<Double>>();
boolean okFields = true;
......
......@@ -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.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
......@@ -128,7 +129,7 @@ public class FESCHatEpsilonReader extends OceanTidesReader {
// parse the file
startParse(name);
final BufferedReader r = new BufferedReader(new InputStreamReader(input, "UTF-8"));
final BufferedReader r = new BufferedReader(new InputStreamReader(input, StandardCharsets.UTF_8));
int lineNumber = 0;
for (String line = r.readLine(); line != null; line = r.readLine()) {
++lineNumber;
......
......@@ -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.regex.Matcher;
import java.util.regex.Pattern;
......@@ -92,7 +93,7 @@ public class FESCnmSnmReader extends OceanTidesReader {
// parse the file
startParse(name);
final BufferedReader r = new BufferedReader(new InputStreamReader(input, "UTF-8"));
final BufferedReader r = new BufferedReader(new InputStreamReader(input, StandardCharsets.UTF_8));
int lineNumber = 0;
boolean dataStarted = false;
for (String line = r.readLine(); line != null; line = r.readLine()) {
......
......@@ -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.text.ParseException;
import java.util.ArrayList;
import java.util.List;
......@@ -121,7 +122,7 @@ public class GRGSFormatReader extends PotentialCoefficientsReader {
// 0 0 .99999999988600E+00 .00000000000000E+00 .153900E-09 .000000E+00
// 2 0 -0.48416511550920E-03 0.00000000000000E+00 .204904E-10 .000000E+00
final BufferedReader r = new BufferedReader(new InputStreamReader(input, "UTF-8"));
final BufferedReader r = new BufferedReader(new InputStreamReader(input, StandardCharsets.UTF_8));
int lineNumber = 0;
double[][] c = null;
double[][] s = null;
......
......@@ -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.text.ParseException;
import java.util.ArrayList;
import java.util.HashMap;
......@@ -202,7 +203,7 @@ public class ICGEMFormatReader extends PotentialCoefficientsReader {
normalized = true;
tideSystem = TideSystem.UNKNOWN;
final BufferedReader r = new BufferedReader(new InputStreamReader(input, "UTF-8"));
final BufferedReader r = new BufferedReader(new InputStreamReader(input, StandardCharsets.UTF_8));
boolean inHeader = true;
double[][] c = null;
double[][] s = null;
......
......@@ -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.text.ParseException;
import java.util.ArrayList;
import java.util.List;
......@@ -90,7 +91,7 @@ public class SHMFormatReader extends PotentialCoefficientsReader {
boolean normalized = false;
TideSystem tideSystem = TideSystem.UNKNOWN;
final BufferedReader r = new BufferedReader(new InputStreamReader(input, "UTF-8"));
final BufferedReader r = new BufferedReader(new InputStreamReader(input, StandardCharsets.UTF_8));
boolean okEarth = false;
boolean okSHM = false;
boolean okCoeffs = false;
......
......@@ -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.Arrays;
import java.util.HashMap;
......@@ -422,7 +423,7 @@ class BulletinAFilesLoader implements EOPHistoryLoader {
this.fileName = name;
// set up a reader for line-oriented bulletin A files
final BufferedReader reader = new BufferedReader(new InputStreamReader(input, "UTF-8"));
final BufferedReader reader = new BufferedReader(new InputStreamReader(input, StandardCharsets.UTF_8));
lineNumber = 0;
firstMJD = -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.HashMap;
import java.util.List;
......@@ -293,7 +294,7 @@ class BulletinBFilesLoader implements EOPHistoryLoader {
configuration = null;
// set up a reader for line-oriented bulletin B files
final BufferedReader reader = new BufferedReader(new InputStreamReader(input, "UTF-8"));
final BufferedReader reader = new BufferedReader(new InputStreamReader(input, StandardCharsets.UTF_8));
// reset parse info to start new file (do not clear history!)
fieldsMap.clear();
......
......@@ -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.SortedSet;
......@@ -206,7 +207,7 @@ class EOPC04FilesLoader implements EOPHistoryLoader {
ITRFVersionLoader.ITRFVersionConfiguration configuration = null;
// set up a reader for line-oriented bulletin B files
final BufferedReader reader = new BufferedReader(new InputStreamReader(input, "UTF-8"));
final BufferedReader reader = new BufferedReader(new InputStreamReader(input, StandardCharsets.UTF_8));
// reset parse info to start new file (do not clear history!)
lineNumber = 0;
......
......@@ -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;
......@@ -146,7 +147,7 @@ public class ITRFVersionLoader {
final Pattern patternDD = Pattern.compile(START + NON_BLANK_FIELD + CALENDAR_DATE + CALENDAR_DATE + ITRF + END);
// set up a reader for line-oriented bulletin A files
final BufferedReader reader = new BufferedReader(new InputStreamReader(input, "UTF-8"));
final BufferedReader reader = new BufferedReader(new InputStreamReader(input, StandardCharsets.UTF_8));
int lineNumber = 0;
String line = null;
......
......@@ -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.SortedSet;
......@@ -201,7 +202,7 @@ class RapidDataAndPredictionColumnsLoader implements EOPHistoryLoader {
ITRFVersionLoader.ITRFVersionConfiguration configuration = null;
// set up a reader for line-oriented bulletin B files
final BufferedReader reader = new BufferedReader(new InputStreamReader(input, "UTF-8"));
final BufferedReader reader = new BufferedReader(new InputStreamReader(input, StandardCharsets.UTF_8));
// reset parse info to start new file (do not clear history!)
lineNumber = 0;
......
......@@ -19,6 +19,7 @@ package org.orekit.frames;
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.SortedSet;
......@@ -121,7 +122,7 @@ class RapidDataAndPredictionXMLLoader implements EOPHistoryLoader {
reader.setEntityResolver((publicId, systemId) -> new InputSource());
// read all file, ignoring header
reader.parse(new InputSource(new InputStreamReader(input, "UTF-8")));
reader.parse(new InputSource(new InputStreamReader(input, StandardCharsets.UTF_8)));
} catch (SAXException se) {
if ((se.getCause() != null) && (se.getCause() instanceof OrekitException)) {
......
......@@ -16,6 +16,8 @@
*/
package org.orekit.gnss;
import org.orekit.utils.Constants;
/**
* Enumerate for GNSS frequencies.
*
......@@ -151,12 +153,22 @@ public enum Frequency {
}
/** Get the value of the frequency in MHz.
* @return satellite system for which this frequency is defined
* @return value of the frequency in MHz
* @see #F0
* @see #getRatio()
* @see #getWavelength()
*/
public double getMHzFrequency() {
return ratio * F0;
}
/** Get the wavelength in meters.
* @return wavelength in meters
* @see #getMHzFrequency()
* @since 10.1
*/
public double getWavelength() {
return Constants.SPEED_OF_LIGHT / (1.0e6 * getMHzFrequency());
}
}
This diff is collapsed.
......@@ -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.text.ParseException;
import java.util.ArrayList;
import java.util.List;
......@@ -120,7 +121,7 @@ public class SEMParser implements DataLoader {
prnList.clear();
// Creates the reader
final BufferedReader reader = new BufferedReader(new InputStreamReader(input, "UTF-8"));
final BufferedReader reader = new BufferedReader(new InputStreamReader(input, StandardCharsets.UTF_8));
try {
// Reads the number of almanacs in the file from the first line
......
......@@ -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.text.ParseException;
import java.util.ArrayList;
import java.util.List;
......@@ -132,7 +133,7 @@ public class YUMAParser implements DataLoader {
prnList.clear();
// Creates the reader
final BufferedReader reader = new BufferedReader(new InputStreamReader(input, "UTF-8"));
final BufferedReader reader = new BufferedReader(new InputStreamReader(input, StandardCharsets.UTF_8));
try {
// Gathers data to create one GPSAlmanac from 13 consecutive lines
......
......@@ -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.Collections;
import java.util.HashMap;
......@@ -155,7 +156,7 @@ public class AntexLoader {
public void loadData(final InputStream input, final String name)
throws IOException, OrekitException {
try (BufferedReader reader = new BufferedReader(new InputStreamReader(input, "UTF-8"))) {
try (BufferedReader reader = new BufferedReader(new InputStreamReader(input, StandardCharsets.UTF_8))) {
// placeholders for parsed data
int lineNumber = 0;
......
......@@ -270,11 +270,11 @@ class GNSSAttitudeContext implements TimeStamped {
final double dtMin = FastMath.min(turnSpan.getTurnStartDate().durationFrom(date), dt0 - 60.0);
final double dtMax = FastMath.max(dtMin + fullTurn, dt0 + 60.0);
double[] bracket = UnivariateSolverUtils.bracket(yawReached, dt0,
dtMin, dtMax, 1.0, 2.0, 15);
dtMin, dtMax, fullTurn / 100, 1.0, 100);
if (yawReached.value(bracket[0]) <= 0.0) {
// we have bracketed the wrong crossing
bracket = UnivariateSolverUtils.bracket(yawReached, 0.5 * (bracket[0] + bracket[1] + fullTurn),
bracket[1], bracket[1] + fullTurn, 1.0, 2.0, 15);
bracket[1], bracket[1] + fullTurn, fullTurn / 100, 1.0, 100);
}
final double dt = new BracketingNthOrderBrentSolver(1.0e-3, 5).
solve(100, yawReached, bracket[0], bracket[1]);
......
......@@ -297,11 +297,11 @@ class GNSSFieldAttitudeContext<T extends RealFieldElement<T>> implements FieldTi
final double dtMin = FastMath.min(turnSpan.getTurnStartDate().durationFrom(date).getReal(), dt0 - 60.0);
final double dtMax = FastMath.max(dtMin + fullTurn, dt0 + 60.0);
double[] bracket = UnivariateSolverUtils.bracket(yawReached, dt0,
dtMin, dtMax, 1.0, 2.0, 15);
dtMin, dtMax, fullTurn / 100, 1.0, 100);
if (yawReached.value(bracket[0]) <= 0.0) {
// we have bracketed the wrong crossing
bracket = UnivariateSolverUtils.bracket(yawReached, 0.5 * (bracket[0] + bracket[1] + fullTurn),
bracket[1], bracket[1] + fullTurn, 1.0, 2.0, 15);
bracket[1], bracket[1] + fullTurn, fullTurn / 100, 1.0, 100);
}
final double dt = new BracketingNthOrderBrentSolver(1.0e-3, 5).
solve(100, yawReached, bracket[0], bracket[1]);
......
......@@ -20,6 +20,7 @@ import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.StreamTokenizer;
import java.nio.charset.StandardCharsets;
import java.text.ParseException;
import java.util.Collection;
import java.util.LinkedList;
......@@ -93,7 +94,7 @@ public class GeoMagneticModelLoader implements DataLoader {
throws IOException, ParseException {
// open data file and parse values
final StreamTokenizer str = new StreamTokenizer(new InputStreamReader(input, "UTF-8"));
final StreamTokenizer str = new StreamTokenizer(new InputStreamReader(input, StandardCharsets.UTF_8));
while (true) {
final GeoMagneticField model = readModel(str);
......
......@@ -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.text.ParseException;
import java.util.Iterator;
import java.util.SortedSet;
......@@ -483,7 +484,7 @@ public class MarshallSolarActivityFutureEstimation implements DataLoader, DTM200
}
// read the data
final BufferedReader reader = new BufferedReader(new InputStreamReader(input, "UTF-8"));
final BufferedReader reader = new BufferedReader(new InputStreamReader(input, StandardCharsets.UTF_8));
boolean inData = false;
final TimeScale utc = TimeScalesFactory.getUTC();
DateComponents fileDate = null;
......
......@@ -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.Optional;
......@@ -285,7 +286,7 @@ public class OceanLoadingCoefficientsBLQFactory {
data[i][2] = new double[4];
}
try (BufferedReader reader = new BufferedReader(new InputStreamReader(input, "UTF-8"))) {
try (BufferedReader reader = new BufferedReader(new InputStreamReader(input, StandardCharsets.UTF_8))) {
int lineNumber = 0;
int dataLine = -1;
......
......@@ -21,6 +21,7 @@ import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;
import java.text.ParseException;
import org.orekit.data.DataLoader;
......@@ -153,7 +154,7 @@ public class KlobucharIonoCoefficientsLoader implements DataLoader {
throws IOException, ParseException {
// Open stream and parse data
final BufferedReader br = new BufferedReader(new InputStreamReader(input, "UTF-8"));
final BufferedReader br = new BufferedReader(new InputStreamReader(input, StandardCharsets.UTF_8));
int lineNumber = 0;
final String splitter = "\\s+";
for (String line = br.readLine(); line != null; line = br.readLine()) {
......
......@@ -151,9 +151,9 @@ public class SaastamoinenModel implements DiscreteTroposphericModel {
public double pathDelay(final double elevation, final double height,
final double[] parameters, final AbsoluteDate date) {
// there are no data in the model for negative altitudes
// we use the data for the lowest available altitude: 0.0
final double fixedHeight = FastMath.max(0.0, height);
// there are no data in the model for negative altitudes and altitude bigger than 5000 m
// limit the height to a range of [0, 5000] m
final double fixedHeight = FastMath.min(FastMath.max(0, height), 5000);
// the corrected temperature using a temperature gradient of -6.5 K/km
final double T = t0 - 6.5e-3 * fixedHeight;
......@@ -192,9 +192,9 @@ public class SaastamoinenModel implements DiscreteTroposphericModel {
final Field<T> field = height.getField();
final T zero = field.getZero();
// there are no data in the model for negative altitudes
// we use the data for the lowest available altitude: 0.0
final T fixedHeight = FastMath.max(zero, height);
// there are no data in the model for negative altitudes and altitude bigger than 5000 m
// limit the height to a range of [0, 5000] m
final T fixedHeight = FastMath.min(FastMath.max(zero, height), zero.add(5000