Class RinexObservationWriter
- All Implemented Interfaces:
AutoCloseable
As RINEX file are organized in batches of observations at some dates,
these observations are cached and a new batch is output only when
a new date appears when calling writeObservationDataSet(ObservationDataSet)
or when the file is closed by calling the close method.
Failing to call close would imply the last batch
of measurements is not written. This is the reason why this class implements
AutoCloseable, so the close method can be called automatically in
a try-with-resources statement.
- Since:
- 12.0
- Author:
- Luc Maisonobe
-
Field Summary
Fields inherited from class org.orekit.files.rinex.utils.BaseRinexWriter
FOUR_DIGITS_INTEGER, NINE_TWO_DIGITS_FLOAT, NINETEEN_SCIENTIFIC_FLOAT, PADDED_FOUR_DIGITS_INTEGER, PADDED_TWO_DIGITS_INTEGER, SIX_DIGITS_INTEGER, THREE_DIGITS_INTEGER, TWO_DIGITS_INTEGER -
Constructor Summary
ConstructorsConstructorDescriptionRinexObservationWriter(Appendable output, String outputName) Simple constructor.RinexObservationWriter(Appendable output, String outputName, BiFunction<SatelliteSystem, TimeScales, ? extends TimeScale> timeScaleBuilder, TimeScales timeScales) Simple constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidProcess all pending measurements.voidsetReceiverClockModel(ClockModel receiverClockModel) Set receiver clock model.voidwriteCompleteFile(RinexObservation rinexObservation) Write a complete observation file.voidwriteHeader(RinexObservationHeader header) Write header.voidwriteObservationDataSet(ObservationDataSet observationDataSet) Write one observation data set.voidWrite one observation data set in RINEX 2 format.voidWrite one observation data set in RINEX 3/4 format.Methods inherited from class org.orekit.files.rinex.utils.BaseRinexWriter
checkHeaderWritten, exceedsHeaderLength, finishHeaderLine, finishLine, getColumn, getHeader, outputField, outputField, outputField, outputField, outputField, prepareComments, writeHeader, writeHeaderLine, writeProgramRunByDate
-
Constructor Details
-
RinexObservationWriter
Simple constructor.This constructor uses the
default data contextand recognizes onlyPredefinedObservationTypeandSatelliteSystemwith non-nulltime scales(i.e. neither user-defined, norSatelliteSystem.SBAS, norSatelliteSystem.MIXED).- Parameters:
output- destination of generated outputoutputName- output name for error messages
-
RinexObservationWriter
public RinexObservationWriter(Appendable output, String outputName, BiFunction<SatelliteSystem, TimeScales, ? extends TimeScale> timeScaleBuilder, TimeScales timeScales) Simple constructor.- Parameters:
output- destination of generated outputoutputName- output name for error messagestimeScaleBuilder- mapper from satellite system to time scales (useful for user-defined satellite systems)timeScales- the set of time scales to use when parsing dates- Since:
- 13.0
-
-
Method Details
-
close
- Specified by:
closein interfaceAutoCloseable- Overrides:
closein classBaseRinexWriter<RinexObservationHeader>- Throws:
IOException
-
setReceiverClockModel
Set receiver clock model.- Parameters:
receiverClockModel- receiver clock model- Since:
- 12.1
-
writeCompleteFile
@DefaultDataContext public void writeCompleteFile(RinexObservation rinexObservation) throws IOException Write a complete observation file.This method calls
BaseRinexWriter.prepareComments(List)andwriteHeader(RinexObservationHeader)once and then loops on callingwriteObservationDataSet(ObservationDataSet)for all observation data sets in the file- Parameters:
rinexObservation- Rinex observation file to write- Throws:
IOException- if an I/O error occurs.- See Also:
-
writeHeader
Write header.This method must be called exactly once at the beginning (directly or by
writeCompleteFile(RinexObservation))- Parameters:
header- header to write- Throws:
IOException- if an I/O error occurs.
-
writeObservationDataSet
Write one observation data set.Note that this writer outputs only regular observations, so the event flag is always set to 0
- Parameters:
observationDataSet- observation data set to write- Throws:
IOException- if an I/O error occurs.
-
processPending
Process all pending measurements.- Throws:
IOException- if an I/O error occurs.
-
writePendingRinex2Observations
Write one observation data set in RINEX 2 format.- Throws:
IOException- if an I/O error occurs.
-
writePendingRinex34Observations
Write one observation data set in RINEX 3/4 format.- Throws:
IOException- if an I/O error occurs.
-