Commit 82d58452 authored by Bryan Cazabonne's avatar Bryan Cazabonne
Browse files

Minor fixes before merging issue-712 branch into develop.

parent 2942c7c0
/* Copyright 2002-2020 CS GROUP
/* 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.
......@@ -14,9 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.orekit.gnss.corrections;
import org.orekit.gnss.SatelliteSystem;
package org.orekit.gnss;
/** Corrections of Differential Code Biases (DCBs) applied.
* Contains information on the programs used to correct the observations
......
/* Copyright 2002-2020 CS GROUP
/* 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.
......@@ -14,16 +14,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.orekit.gnss.corrections;
import org.orekit.gnss.SatelliteSystem;
package org.orekit.gnss;
/** Corrections of antenna phase center variations (PCVs) applied.
* Contains information on the programs used to correct the observations
* in RINEX or clock files for antenna phase center variations.
*/
public class AppliedPCVS {
/** Satellite system. */
......
......@@ -21,8 +21,6 @@ import java.util.List;
import org.hipparchus.geometry.euclidean.threed.Vector3D;
import org.hipparchus.geometry.euclidean.twod.Vector2D;
import org.orekit.gnss.RinexLoader.Parser.PhaseShiftCorrection;
import org.orekit.gnss.corrections.AppliedDCBS;
import org.orekit.gnss.corrections.AppliedPCVS;
import org.orekit.time.AbsoluteDate;
/** Container for Rinex file header.
......
......@@ -36,8 +36,6 @@ import org.orekit.data.DataLoader;
import org.orekit.data.DataProvidersManager;
import org.orekit.errors.OrekitException;
import org.orekit.errors.OrekitMessages;
import org.orekit.gnss.corrections.AppliedDCBS;
import org.orekit.gnss.corrections.AppliedPCVS;
import org.orekit.time.AbsoluteDate;
import org.orekit.time.TimeScale;
import org.orekit.time.TimeScales;
......
......@@ -100,7 +100,8 @@ public enum SatelliteSystem {
/** Get default time scale for satellite system.
* @param timeScales the set of timeScales to use
* @return the default time scale among the given set matching to satellitesystem, null if there are not
* @return the default time scale among the given set matching to satellite system,
* null if there are not
*/
public TimeScale getDefaultTimeSystem(final TimeScales timeScales) {
......
/* Copyright 2002-2020 CS GROUP
/* 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.
......@@ -24,12 +24,12 @@ import org.orekit.errors.OrekitMessages;
import org.orekit.time.TimeScale;
import org.orekit.time.TimeScales;
/** Enumerate for the time systems.
/** Enumerate for the time systems used in navigation files.
*
* @author Thomas Neidhart
* @author Evan Ward
* @author Thomas Paulet
*
* @since 11.0
*/
public enum TimeSystem {
......
/* Copyright 2002-2012 Space Applications Services
/* 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.
......@@ -26,11 +26,11 @@ import java.util.function.Function;
import org.orekit.errors.OrekitIllegalArgumentException;
import org.orekit.errors.OrekitMessages;
import org.orekit.frames.Frame;
import org.orekit.gnss.AppliedDCBS;
import org.orekit.gnss.AppliedPCVS;
import org.orekit.gnss.ObservationType;
import org.orekit.gnss.SatelliteSystem;
import org.orekit.gnss.TimeSystem;
import org.orekit.gnss.corrections.AppliedDCBS;
import org.orekit.gnss.corrections.AppliedPCVS;
import org.orekit.time.AbsoluteDate;
import org.orekit.time.DateComponents;
import org.orekit.time.TimeComponents;
......@@ -49,6 +49,7 @@ import org.orekit.utils.TimeSpanMap;
* @see <a href="ftp://igs.org/pub/data/format/rinex_clock304.txt"> 3.04 clock file format</a>
*
* @author Thomas Paulet
* @since 11.0
*/
public class ClockFile {
......@@ -140,7 +141,7 @@ public class ClockFile {
* @param frameBuilder for constructing a reference frame from the identifier
*/
public ClockFile(final Function<? super String, ? extends Frame> frameBuilder) {
// Initialize fields with default data
this.systemObservationTypes = new HashMap<SatelliteSystem, List<ObservationType>>();
this.listAppliedDCBS = new ArrayList<AppliedDCBS>();
this.listAppliedPCVS = new ArrayList<AppliedPCVS>();
......@@ -243,7 +244,6 @@ public class ClockFile {
return satellites.size();
}
/** Getter for the format version.
* @return the format version
*/
......@@ -251,7 +251,6 @@ public class ClockFile {
return formatVersion;
}
/** Setter for the format version.
* @param formatVersion the format version to set
*/
......@@ -266,7 +265,6 @@ public class ClockFile {
return satelliteSystem;
}
/** Setter for the satellite system.
* @param satelliteSystem the satellite system to set
*/
......@@ -281,7 +279,6 @@ public class ClockFile {
return programName;
}
/** Setter for the program name.
* @param programName the program name to set
*/
......@@ -289,7 +286,6 @@ public class ClockFile {
this.programName = programName;
}
/** Getter for the agency name.
* @return the agencyName
*/
......@@ -297,7 +293,6 @@ public class ClockFile {
return agencyName;
}
/** Setter for the agency name.
* @param agencyName the agency name to set
*/
......@@ -305,15 +300,13 @@ public class ClockFile {
this.agencyName = agencyName;
}
/** Getter for the creation date of the file as a string.
* @return the creation dateas a string
* @return the creation date as a string
*/
public String getCreationDateString() {
return creationDateString;
}
/** Setter for the creation date as a string.
* @param creationDateString the creation date as a string to set
*/
......@@ -321,7 +314,6 @@ public class ClockFile {
this.creationDateString = creationDateString;
}
/** Getter for the creation time of the file as a string.
* @return the creation time as a string
*/
......@@ -329,7 +321,6 @@ public class ClockFile {
return creationTimeString;
}
/** Setter for the creation time as a string.
* @param creationTimeString the creation time as a string to set
*/
......@@ -337,7 +328,6 @@ public class ClockFile {
this.creationTimeString = creationTimeString;
}
/** Getter for the creation time zone of the file as a string.
* @return the creation time zone as a string
*/
......@@ -345,7 +335,6 @@ public class ClockFile {
return creationTimeZoneString;
}
/** Setter for the creation time zone.
* @param creationTimeZoneString the creation time zone as a string to set
*/
......@@ -360,7 +349,6 @@ public class ClockFile {
return creationDate;
}
/** Setter for the creation date.
* @param creationDate the creation date to set
*/
......@@ -375,7 +363,6 @@ public class ClockFile {
return comments;
}
/** Add a comment line.
* @param comment the comment line to add
*/
......@@ -383,7 +370,6 @@ public class ClockFile {
this.comments = comments.concat(comment + "\n");
}
/** Getter for the different observation type for each satellite system.
* @return the map of the different observation type per satellite system
*/
......@@ -391,7 +377,6 @@ public class ClockFile {
return Collections.unmodifiableMap(systemObservationTypes);
}
/** Add an observation type for a specified satellite system.
* @param satSystem the satellite system to add observation type
* @param observationType the system observation type to set
......@@ -402,7 +387,6 @@ public class ClockFile {
systemObservationTypes.get(satSystem).add(observationType);
}
/** Getter for the file time system.
* @return the file time system
*/
......@@ -410,7 +394,6 @@ public class ClockFile {
return timeSystem;
}
/** Setter for the file time system.
* @param timeSystem the file time system to set
*/
......@@ -425,7 +408,6 @@ public class ClockFile {
return timeScale;
}
/** Setter for the data time scale.
* @param timeScale the data time scale to set
*/
......@@ -440,7 +422,6 @@ public class ClockFile {
return numberOfLeapSeconds;
}
/** Setter for the number of leap seconds.
* @param numberOfLeapSeconds the number of leap seconds to set
*/
......@@ -448,8 +429,6 @@ public class ClockFile {
this.numberOfLeapSeconds = numberOfLeapSeconds;
}
/** Getter for the number of leap second for GNSS time scales.
* @return the number of leap seconds for GNSS time scales
*/
......@@ -457,7 +436,6 @@ public class ClockFile {
return numberOfLeapSecondsGNSS;
}
/** Setter for the number of leap seconds for GNSS time scales.
* @param numberOfLeapSecondsGNSS the number of leap seconds for GNSS time scales to set
*/
......@@ -465,15 +443,13 @@ public class ClockFile {
this.numberOfLeapSecondsGNSS = numberOfLeapSecondsGNSS;
}
/** Getter for the applied differencial code bias corrections.
* @return the list of applied differencial code bias corrections
/** Getter for the applied differential code bias corrections.
* @return the list of applied differential code bias corrections
*/
public List<AppliedDCBS> getListAppliedDCBS() {
return Collections.unmodifiableList(listAppliedDCBS);
}
/** Add an applied differencial code bias corrections.
* @param appliedDCBS the applied differencial code bias corrections to add
*/
......@@ -481,7 +457,6 @@ public class ClockFile {
listAppliedDCBS.add(appliedDCBS);
}
/** Getter for the applied phase center variations.
* @return the list of the applied phase center variations
*/
......@@ -489,7 +464,6 @@ public class ClockFile {
return Collections.unmodifiableList(listAppliedPCVS);
}
/** Add an applied phase center variations.
* @param appliedPCVS the phase center variations to add
*/
......@@ -497,7 +471,6 @@ public class ClockFile {
listAppliedPCVS.add(appliedPCVS);
}
/** Getter for the different clock data types.
* @return the list of the different clock data types
*/
......@@ -505,7 +478,6 @@ public class ClockFile {
return Collections.unmodifiableList(clockDataTypes);
}
/** Add a clock data types.
* @param clockDataType the clock data types to add
*/
......@@ -513,7 +485,6 @@ public class ClockFile {
clockDataTypes.add(clockDataType);
}
/** Getter for the station name.
* @return the station name
*/
......@@ -521,7 +492,6 @@ public class ClockFile {
return stationName;
}
/** Setter for the station name.
* @param stationName the station name to set
*/
......@@ -536,7 +506,6 @@ public class ClockFile {
return stationIdentifier;
}
/** Setter for the station identifier.
* @param stationIdentifier the station identifier to set
*/
......@@ -551,7 +520,6 @@ public class ClockFile {
return externalClockReference;
}
/** Setter for the external clock reference.
* @param externalClockReference the external clock reference to set
*/
......@@ -559,7 +527,6 @@ public class ClockFile {
this.externalClockReference = externalClockReference;
}
/** Getter for the analysis center ID.
* @return the analysis center ID
*/
......@@ -567,7 +534,6 @@ public class ClockFile {
return analysisCenterID;
}
/** Setter for the analysis center ID.
* @param analysisCenterID the analysis center ID to set
*/
......@@ -575,7 +541,6 @@ public class ClockFile {
this.analysisCenterID = analysisCenterID;
}
/** Getter for the analysis center name.
* @return the analysis center name
*/
......@@ -583,7 +548,6 @@ public class ClockFile {
return analysisCenterName;
}
/** Setter for the analysis center name.
* @param analysisCenterName the analysis center name to set
*/
......@@ -591,7 +555,6 @@ public class ClockFile {
this.analysisCenterName = analysisCenterName;
}
/** Getter for the reference clocks.
* @return the time span map of the different refence clocks
*/
......@@ -635,8 +598,6 @@ public class ClockFile {
return Collections.unmodifiableList(receivers);
}
/** Getter for the satellites.
* @return the list of the satellites
*/
......@@ -652,7 +613,7 @@ public class ClockFile {
}
/** Getter for the clock data.
/** Getter for an unmodifiable map of clock data.
* @return the clock data
*/
public Map<String, List<ClockDataLine>> getClockData() {
......@@ -924,9 +885,9 @@ public class ClockFile {
/** Constructor.
* @param designator the designator
* @param receiverIdentifier the receiver identifier
* @param x the X coordinates in meters in considred Earth centered frame
* @param y the Y coordinates in meters in considred Earth centered frame
* @param z the Z coordinates in meters in considred Earth centered frame
* @param x the X coordinate in meters in considered Earth centered frame
* @param y the Y coordinate in meters in considered Earth centered frame
* @param z the Z coordinate in meters in considered Earth centered frame
*/
public Receiver(final String designator, final String receiverIdentifier,
final double x, final double y, final double z) {
......@@ -951,22 +912,22 @@ public class ClockFile {
return receiverIdentifier;
}
/** Getter for the X coordinates in meters in considred Earth centered frame.
* @return the X coordinates in meters in considred Earth centered frame
/** Getter for the X coordinate in meters in considered Earth centered frame.
* @return the X coordinate in meters in considered Earth centered frame
*/
public double getX() {
return x;
}
/** Getter for the Y coordinates in meters in considred Earth centered frame.
* @return the Y coordinates in meters in considred Earth centered frame
/** Getter for the Y coordinate in meters in considered Earth centered frame.
* @return the Y coordinate in meters in considered Earth centered frame
*/
public double getY() {
return y;
}
/** Getter for the Z coordinates in meters in considred Earth centered frame.
* @return the Z coordinates in meters in considred Earth centered frame
/** Getter for the Z coordinate in meters in considered Earth centered frame.
* @return the Z coordinate in meters in considered Earth centered frame
*/
public double getZ() {
return z;
......
/* Copyright 2002-2012 Space Applications Services
/* 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.
......@@ -39,13 +39,13 @@ import org.orekit.data.DataContext;
import org.orekit.errors.OrekitException;
import org.orekit.errors.OrekitMessages;
import org.orekit.frames.Frame;
import org.orekit.gnss.AppliedDCBS;
import org.orekit.gnss.AppliedPCVS;
import org.orekit.gnss.ObservationType;
import org.orekit.gnss.SatelliteSystem;
import org.orekit.gnss.TimeSystem;
import org.orekit.gnss.clock.ClockFile.ClockDataType;
import org.orekit.gnss.clock.ClockFile.ReferenceClock;
import org.orekit.gnss.corrections.AppliedDCBS;
import org.orekit.gnss.corrections.AppliedPCVS;
import org.orekit.time.AbsoluteDate;
import org.orekit.time.DateComponents;
import org.orekit.time.TimeComponents;
......@@ -60,14 +60,14 @@ import org.orekit.utils.IERSConventions;
* <p> A time system should be specified in the file. However, if it is not, default time system will be chosen
* regarding the satellite system. If it is mixed or not specified, default time system will be UTC. </p>
* <p> Caution, files with missing information in header can lead to wrong data dates and station positions.
* It is adviced to check the correctness and format compliance of the clock file to be parsed. </p>
* @see <a href="ftp://igs.org/pub/data/format/rinex_clock300.txt"> 3.00 clock file format</a>
* @see <a href="ftp://igs.org/pub/data/format/rinex_clock302.txt"> 3.02 clock file format</a>
* @see <a href="ftp://igs.org/pub/data/format/rinex_clock304.txt"> 3.04 clock file format</a>
* It is advised to check the correctness and format compliance of the clock file to be parsed. </p>
* @see <a href="https://files.igs.org/pub/data/format/rinex_clock300.txt"> 3.00 clock file format</a>
* @see <a href="https://files.igs.org/pub/data/format/rinex_clock302.txt"> 3.02 clock file format</a>
* @see <a href="https://files.igs.org/pub/data/format/rinex_clock304.txt"> 3.04 clock file format</a>
*
* @author Thomas Paulet
* @since 11.0
*/
public class ClockFileParser {
/** Handled clock file format versions. */
......@@ -88,7 +88,6 @@ public class ClockFileParser {
/** Set of time scales. */
private final TimeScales timeScales;
/**
* Create an clock file parser using default values.
*
......@@ -101,15 +100,14 @@ public class ClockFileParser {
this(ClockFileParser::guessFrame);
}
/**
* Create an clock file parser and specify the frame builder.
* Create a clock file parser and specify the frame builder.
*
* <p>This constructor uses the {@link DataContext#getDefault() default data context}.
*
* @param frameBuilder is a function that can construct a frame from a clock file
* coordinate system string. The coordinate system can be
* any 5 character string e.g. ITR92, IGb08.
* @param frameBuilder is a function that can construct a frame from a clock file
* coordinate system string. The coordinate system can be
* any 5 character string e.g. ITR92, IGb08.
* @see #ClockFileParser(Function, TimeScales)
*/
@DefaultDataContext
......@@ -118,10 +116,10 @@ public class ClockFileParser {
}
/** Constructor, build the IGS clock file parser.
* @param frameBuilder is a function that can construct a frame from a clock file
* coordinate system string. The coordinate system can be
* any 5 character string e.g. ITR92, IGb08.
* @param timeScales the set of time scales used for parsing dates.
* @param frameBuilder is a function that can construct a frame from a clock file
* coordinate system string. The coordinate system can be
* any 5 character string e.g. ITR92, IGb08.
* @param timeScales the set of time scales used for parsing dates.
*/
public ClockFileParser(final Function<? super String, ? extends Frame> frameBuilder,
final TimeScales timeScales) {
......@@ -136,8 +134,8 @@ public class ClockFileParser {
* <p>This method uses the {@link DataContext#getDefault() default data context}.
*
* @param name of the frame.
* @return defaultly, return ITRF based on 2010 conventions,
* with tidal effects considered during EOP interpolation.
* @return by default, return ITRF based on 2010 conventions,
* with tidal effects considered during EOP interpolation.
* <p>If String matches to other already recorded frames, it will return the corresponding frame.</p>
* Already embedded frames are:
* <p> - ITRF96
......@@ -160,9 +158,9 @@ public class ClockFileParser {
* method may read more data than necessary from {@code stream} and the additional
* data will be lost. The other parse methods do not have this issue.
*
* @param stream to read the IGS clock file from.
* @return a parsed IGS clock file.
* @throws IOException if {@code stream} throws one.
* @param stream to read the IGS clock file from
* @return a parsed IGS clock file
* @throws IOException if {@code stream} throws one
* @see #parse(String)
* @see #parse(BufferedReader, String)
*/
......@@ -172,15 +170,30 @@ public class ClockFileParser {
}
}
public ClockFile parse(final String fileName) throws IOException, OrekitException {
/**
* Parse an IGS clock file from a file on the local file system.
* @param fileName file name
* @return a parsed IGS clock file
* @throws IOException if one is thrown while opening or reading from {@code fileName}
* @see #parse(InputStream)
* @see #parse(BufferedReader, String)
*/
public ClockFile parse(final String fileName) throws IOException {
try (BufferedReader reader = Files.newBufferedReader(Paths.get(fileName),
StandardCharsets.UTF_8)) {
return parse(reader, fileName);
}
}
/**
* Parse an IGS clock file from a stream.
* @param reader containing the clock file
* @param fileName file name
* @return a parsed IGS clock file
* @throws IOException if {@code reader} throws one
* @see #parse(InputStream)
* @see #parse(String)
*/
public ClockFile parse(final BufferedReader reader,
final String fileName) throws IOException {
......@@ -212,6 +225,7 @@ public class ClockFileParser {
}
/** Transient data used for parsing a clock file. */
private class ParseInfo {
/** Set of time scales for parsing dates. */
......@@ -252,7 +266,6 @@ public class ClockFileParser {
/** Constructor, build the ParseInfo object. */
protected ParseInfo () {
this.timeScales = ClockFileParser.this.timeScales;
this.file = new ClockFile(frameBuilder);
}
......@@ -335,6 +348,7 @@ public class ClockFileParser {
// Date string location after 3.04 format version
dateString = line.substring(42, 65);
}
parseDateTimeZone(dateString, pi);
......@@ -517,7 +531,7 @@ public class ClockFileParser {
// Second element is the program name
final String progDCBS = line.substring(2, 20).trim();