Class RinexObservationWriter
- java.lang.Object
-
- org.orekit.files.rinex.observation.RinexObservationWriter
-
- All Implemented Interfaces:
AutoCloseable
public class RinexObservationWriter extends Object implements AutoCloseable
Writer for Rinex observation file.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 theclose
method. Failing to callclose
would imply the last batch of measurements is not written. This is the reason why this class implementsAutoCloseable
, so theclose
method can be called automatically in atry-with-resources
statement.- Since:
- 12.0
- Author:
- Luc Maisonobe
-
-
Constructor Summary
Constructors Constructor Description RinexObservationWriter(Appendable output, String outputName)
Simple constructor.RinexObservationWriter(Appendable output, String outputName, BiFunction<SatelliteSystem,TimeScales,? extends TimeScale> timeScaleBuilder, TimeScales timeScales)
Simple constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
void
prepareComments(List<RinexComment> comments)
Prepare comments to be emitted at specified lines.void
setReceiverClockModel(ClockModel receiverClockModel)
Set receiver clock model.void
writeCompleteFile(RinexObservation rinexObservation)
Write a complete observation file.void
writeHeader(RinexObservationHeader header)
Write header.void
writeObservationDataSet(ObservationDataSet observationDataSet)
Write one observation data set.void
writePendingRinex2Observations()
Write one observation data set in RINEX 2 format.void
writePendingRinex34Observations()
Write one observation data set in RINEX 3/4 format.
-
-
-
Constructor Detail
-
RinexObservationWriter
@DefaultDataContext public RinexObservationWriter(Appendable output, String outputName)
Simple constructor.This constructor uses the
default data context
and recognizes onlyPredefinedObservationType
andSatelliteSystem
with 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 Detail
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Throws:
IOException
-
setReceiverClockModel
public void setReceiverClockModel(ClockModel receiverClockModel)
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
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(RinexObservationHeader)
,writeObservationDataSet(ObservationDataSet)
-
prepareComments
public void prepareComments(List<RinexComment> comments)
Prepare comments to be emitted at specified lines.- Parameters:
comments
- comments to be emitted
-
writeHeader
@DefaultDataContext public void writeHeader(RinexObservationHeader header) throws IOException
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
public void writeObservationDataSet(ObservationDataSet observationDataSet) throws IOException
Write one observation data set.Note that this writers output 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.
-
writePendingRinex2Observations
public void writePendingRinex2Observations() throws IOException
Write one observation data set in RINEX 2 format.- Throws:
IOException
- if an I/O error occurs.
-
writePendingRinex34Observations
public void writePendingRinex34Observations() throws IOException
Write one observation data set in RINEX 3/4 format.- Throws:
IOException
- if an I/O error occurs.
-
-