public class CPFParser extends Object implements EphemerisFileParser
It supports both 1.0 and 2.0 versions
Note: Only required header keys are read. Furthermore, only position data are read. Other keys are simply ignored Contributions are welcome to support more fields in the format.
| Constructor and Description |
|---|
CPFParser()
Default constructor.
|
CPFParser(double mu,
int interpolationSamples,
IERSConventions iersConventions,
TimeScale utc,
Frames frames)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
CPFFile |
parse(BufferedReader reader,
String fileName)
Parse an ephemeris file from a stream.
|
CPFFile |
parse(InputStream stream)
Parse a CPF file from an input stream using the UTF-8 charset.
|
CPFFile |
parse(String fileName)
Parse an ephemeris file from a file on the local file system.
|
@DefaultDataContext public CPFParser()
This constructor uses the default data context.
public CPFParser(double mu,
int interpolationSamples,
IERSConventions iersConventions,
TimeScale utc,
Frames frames)
mu - standard gravitational parameter to use for
creating Orbits from
the ephemeris data.interpolationSamples - number of samples to use when interpolatingiersConventions - IERS convention for frames definitionutc - time scale used to define epochs in CPF files (UTC)frames - set of frames for satellite coordinatespublic CPFFile parse(InputStream stream) throws IOException
This method creates a BufferedReader from the stream and as such this
method may read more data than necessary from stream and the additional
data will be lost. The other parse methods do not have this issue.
stream - to read the CPF file from.IOException - if stream throws one.parse(String),
parse(BufferedReader, String)public CPFFile parse(String fileName) throws IOException
For Implementors: Most subclasses should implement this method as follows, but there is no default implementation because most subclasses should use a specialized return type.
try (BufferedReader reader = Files.newBufferedReader(Paths.get(fileName))) {
return parse(reader, fileName);
}
parse in interface EphemerisFileParserfileName - path to the ephemeris file.IOException - if one is thrown while opening or reading from fileNamepublic CPFFile parse(BufferedReader reader, String fileName) throws IOException
parse in interface EphemerisFileParserreader - containing the ephemeris file.fileName - to use in error messages.IOException - if reader throws one.Copyright © 2002-2021 CS GROUP. All rights reserved.