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 theclosemethod. Failing to callclosewould imply the last batch of measurements is not written. This is the reason why this class implementsAutoCloseable, so theclosemethod can be called automatically in atry-with-resourcesstatement.- 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 voidclose()voidprepareComments(List<RinexComment> comments)Prepare comments to be emitted at specified lines.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.voidwritePendingRinex2Observations()Write one observation data set in RINEX 2 format.voidwritePendingRinex34Observations()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 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 Detail
-
close
public void close() throws IOException- Specified by:
closein 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 IOExceptionWrite one observation data set in RINEX 2 format.- Throws:
IOException- if an I/O error occurs.
-
writePendingRinex34Observations
public void writePendingRinex34Observations() throws IOExceptionWrite one observation data set in RINEX 3/4 format.- Throws:
IOException- if an I/O error occurs.
-
-