Class TDMParser
- java.lang.Object
-
- org.xml.sax.helpers.DefaultHandler
-
- org.orekit.files.ccsds.TDMParser
-
- All Implemented Interfaces:
ContentHandler
,DTDHandler
,EntityResolver
,ErrorHandler
public class TDMParser extends DefaultHandler
Class for CCSDS Tracking Data Message parsers.This base class is immutable, and hence thread safe. When parts must be changed, such as reference date for Mission Elapsed Time or Mission Relative Time time systems, or the gravitational coefficient or the IERS conventions, the various
withXxx
methods must be called, which create a new immutable instance with the new parameters. This is a combination of the builder design pattern and a fluent interface.This class allow the handling of both "keyvalue" and "xml" TDM file formats. Format can be inferred if file names ends respectively with ".txt" or ".xml". Otherwise it must be explicitely set using
withFileFormat(TDMFileFormat)
ParseInfo subclass regroups common parsing functions; and specific handlers were added for both file formats.
References:
- CCSDS 503.0-B-1 recommended standard ("Tracking Data Message", Blue Book, Issue 1, November 2007).
- CCSDS 505.0-B-1 recommended standard ("XML Specification for Navigation Data Message", Blue Book, Issue 1, December 2010).
- Since:
- 9.0
- Author:
- Maxime Journot
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TDMParser.TDMFileFormat
Enumerate for the format.
-
Constructor Summary
Constructors Constructor Description TDMParser()
Simple constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IERSConventions
getConventions()
Get IERS conventions.TDMParser.TDMFileFormat
getFileFormat()
Get file format.AbsoluteDate
getMissionReferenceDate()
Get initial date.boolean
isSimpleEOP()
Get EOP interpolation method.TDMFile
parse(InputStream stream)
Parse a CCSDS Tracking Data Message.TDMFile
parse(InputStream stream, String fileName)
Parse a CCSDS Tracking Data Message.TDMFile
parse(String fileName)
Parse a CCSDS Tracking Data Message.TDMFile
parseKeyValue(InputStream stream, String fileName)
Parse a CCSDS Tracking Data Message with KEYVALUE format.TDMFile
parseXml(InputStream stream, String fileName)
Parse a CCSDS Tracking Data Message with XML format.TDMParser
withConventions(IERSConventions newConventions)
Set IERS conventions.TDMParser
withFileFormat(TDMParser.TDMFileFormat newFileFormat)
Set file format.TDMParser
withMissionReferenceDate(AbsoluteDate newMissionReferenceDate)
Set initial date.TDMParser
withSimpleEOP(boolean newSimpleEOP)
Set EOP interpolation method.-
Methods inherited from class org.xml.sax.helpers.DefaultHandler
characters, endDocument, endElement, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startElement, startPrefixMapping, unparsedEntityDecl, warning
-
-
-
-
Constructor Detail
-
TDMParser
public TDMParser()
Simple constructor.This class is immutable, and hence thread safe. When parts must be changed, such fiel format or reference date for Mission Elapsed Time or Mission Relative Time time systems, or the IERS conventions, the various
withXxx
methods must be called, which create a new immutable instance with the new parameters. This is a combination of the builder design pattern and a fluent interface.The initial date for Mission Elapsed Time and Mission Relative Time time systems is not set here. If such time systems are used, it must be initialized before parsing by calling
withMissionReferenceDate(AbsoluteDate)
.The IERS conventions to use is not set here. If it is needed in order to parse some reference frames or UT1 time scale, it must be initialized before parsing by calling
withConventions(IERSConventions)
.The TDM file format to use is not set here. It may be automatically inferred while parsing if the name of the file to parse ends with ".txt" or ".xml". Otherwise it must be initialized before parsing by calling
withFileFormat(TDMFileFormat)
-
-
Method Detail
-
withFileFormat
public TDMParser withFileFormat(TDMParser.TDMFileFormat newFileFormat)
Set file format.- Parameters:
newFileFormat
- The format of the file: KEYVALUE or XML- Returns:
- a new instance, with file format set to newFileFormat
- See Also:
getFileFormat()
-
getFileFormat
public TDMParser.TDMFileFormat getFileFormat()
Get file format.- Returns:
- the file format
- See Also:
withFileFormat(TDMFileFormat)
-
withMissionReferenceDate
public TDMParser withMissionReferenceDate(AbsoluteDate newMissionReferenceDate)
Set initial date.- Parameters:
newMissionReferenceDate
- mission reference date to use while parsing- Returns:
- a new instance, with mission reference date replaced
- See Also:
getMissionReferenceDate()
-
getMissionReferenceDate
public AbsoluteDate getMissionReferenceDate()
Get initial date.- Returns:
- mission reference date to use while parsing
- See Also:
withMissionReferenceDate(AbsoluteDate)
-
withConventions
public TDMParser withConventions(IERSConventions newConventions)
Set IERS conventions.- Parameters:
newConventions
- IERS conventions to use while parsing- Returns:
- a new instance, with IERS conventions replaced
- See Also:
getConventions()
-
getConventions
public IERSConventions getConventions()
Get IERS conventions.- Returns:
- IERS conventions to use while parsing
- See Also:
withConventions(IERSConventions)
-
withSimpleEOP
public TDMParser withSimpleEOP(boolean newSimpleEOP)
Set EOP interpolation method.- Parameters:
newSimpleEOP
- if true, tidal effects are ignored when interpolating EOP- Returns:
- a new instance, with EOP interpolation method replaced
- See Also:
isSimpleEOP()
-
isSimpleEOP
public boolean isSimpleEOP()
Get EOP interpolation method.- Returns:
- true if tidal effects are ignored when interpolating EOP
- See Also:
withSimpleEOP(boolean)
-
parse
public TDMFile parse(String fileName)
Parse a CCSDS Tracking Data Message.- Parameters:
fileName
- name of the file containing the message- Returns:
- parsed file content in a TDMFile object
-
parse
public TDMFile parse(InputStream stream)
Parse a CCSDS Tracking Data Message.- Parameters:
stream
- stream containing message- Returns:
- parsed file content in a TDMFile object
-
parse
public TDMFile parse(InputStream stream, String fileName)
Parse a CCSDS Tracking Data Message.- Parameters:
stream
- stream containing messagefileName
- name of the file containing the message (for error messages)- Returns:
- parsed file content in a TDMFile object
-
parseKeyValue
public TDMFile parseKeyValue(InputStream stream, String fileName)
Parse a CCSDS Tracking Data Message with KEYVALUE format.- Parameters:
stream
- stream containing messagefileName
- name of the file containing the message (for error messages)- Returns:
- parsed file content in a TDMFile object
-
parseXml
public TDMFile parseXml(InputStream stream, String fileName)
Parse a CCSDS Tracking Data Message with XML format.- Parameters:
stream
- stream containing messagefileName
- name of the file containing the message (for error messages)- Returns:
- parsed file content in a TDMFile object
-
-