Package org.orekit.files.sp3
Class SP3Parser
- java.lang.Object
-
- org.orekit.files.sp3.SP3Parser
-
- All Implemented Interfaces:
EphemerisFileParser
public class SP3Parser extends Object implements EphemerisFileParser
A parser for the SP3 orbit file format. It supports all formats from sp3-a to sp3-d.Note: this parser is thread-safe, so calling
parse(java.io.InputStream)
from different threads is allowed.- Author:
- Thomas Neidhart, Luc Maisonobe
- See Also:
- SP3-a file format, SP3-c file format, SP3-d file format
-
-
Constructor Summary
Constructors Constructor Description SP3Parser()
Create an SP3 parser using default values.SP3Parser(double mu, int interpolationSamples, Function<? super String,? extends Frame> frameBuilder)
Create an SP3 parser and specify the extra information needed to create aPropagator
from the ephemeris data.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SP3File
parse(BufferedReader reader, String fileName)
Parse an ephemeris file from a stream.SP3File
parse(InputStream stream)
Parse a SP3 file from an input stream using the UTF-8 charset.SP3File
parse(String fileName)
Parse an ephemeris file from a file on the local file system.
-
-
-
Constructor Detail
-
SP3Parser
public SP3Parser()
Create an SP3 parser using default values.- See Also:
SP3Parser(double, int, Function)
-
SP3Parser
public SP3Parser(double mu, int interpolationSamples, Function<? super String,? extends Frame> frameBuilder)
Create an SP3 parser and specify the extra information needed to create aPropagator
from the ephemeris data.- Parameters:
mu
- is the standard gravitational parameter to use for creatingOrbits
from the ephemeris data. SeeConstants
.interpolationSamples
- is the number of samples to use when interpolating.frameBuilder
- is a function that can construct a frame from an SP3 coordinate system string. The coordinate system can be any 5 character string e.g. ITR92, IGb08.
-
-
Method Detail
-
parse
public SP3File parse(InputStream stream) throws IOException
Parse a SP3 file from an input stream using the UTF-8 charset.This method creates a
BufferedReader
from the stream and as such this method may read more data than necessary fromstream
and the additional data will be lost. The other parse methods do not have this issue.- Parameters:
stream
- to read the SP3 file from.- Returns:
- a parsed SP3 file.
- Throws:
IOException
- ifstream
throws one.- See Also:
parse(String)
,parse(BufferedReader, String)
-
parse
public SP3File parse(String fileName) throws IOException, OrekitException
Description copied from interface:EphemerisFileParser
Parse an ephemeris file from a file on the local file system.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); }
- Specified by:
parse
in interfaceEphemerisFileParser
- Parameters:
fileName
- path to the ephemeris file.- Returns:
- parsed ephemeris file.
- Throws:
IOException
- if one is thrown while opening or reading fromfileName
.OrekitException
-
parse
public SP3File parse(BufferedReader reader, String fileName) throws IOException
Description copied from interface:EphemerisFileParser
Parse an ephemeris file from a stream.- Specified by:
parse
in interfaceEphemerisFileParser
- Parameters:
reader
- containing the ephemeris file.fileName
- to use in error messages.- Returns:
- a parsed ephemeris file.
- Throws:
IOException
- ifreader
throws one.
-
-