public class RinexObservationWriter extends Object implements 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.
Constructor and Description |
---|
RinexObservationWriter(Appendable output,
String outputName)
Simple constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
prepareComments(List<RinexComment> comments)
Prepare comments to be emitted at specified lines.
|
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.
|
public RinexObservationWriter(Appendable output, String outputName)
output
- destination of generated outputoutputName
- output name for error messagespublic void close() throws IOException
close
in interface AutoCloseable
IOException
@DefaultDataContext public void writeCompleteFile(RinexObservation rinexObservation) throws IOException
This method calls prepareComments(List)
and
writeHeader(RinexObservationHeader)
once and then loops on
calling writeObservationDataSet(ObservationDataSet)
for all observation data sets in the file
rinexObservation
- Rinex observation file to writeIOException
- if an I/O error occurs.writeHeader(RinexObservationHeader)
,
writeObservationDataSet(ObservationDataSet)
public void prepareComments(List<RinexComment> comments)
comments
- comments to be emitted@DefaultDataContext public void writeHeader(RinexObservationHeader header) throws IOException
This method must be called exactly once at the beginning
(directly or by writeCompleteFile(RinexObservation)
)
header
- header to writeIOException
- if an I/O error occurs.public void writeObservationDataSet(ObservationDataSet observationDataSet) throws IOException
Note that this writers output only regular observations, so the event flag is always set to 0
observationDataSet
- observation data set to writeIOException
- if an I/O error occurs.public void writePendingRinex2Observations() throws IOException
IOException
- if an I/O error occurs.public void writePendingRinex34Observations() throws IOException
IOException
- if an I/O error occurs.Copyright © 2002-2023 CS GROUP. All rights reserved.