Class ODMParser
- java.lang.Object
-
- org.orekit.files.ccsds.ODMParser
-
public abstract class ODMParser extends Object
Base class for all CCSDS Orbit 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.- Since:
- 6.1
- Author:
- Luc Maisonobe
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ODMParser(AbsoluteDate missionReferenceDate, double mu, IERSConventions conventions, boolean simpleEOP, int launchYear, int launchNumber, String launchPiece)
Complete constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description IERSConventions
getConventions()
Get IERS conventions.int
getLaunchNumber()
Get the launch number.String
getLaunchPiece()
Get the piece of launch.int
getLaunchYear()
Get the launch year.AbsoluteDate
getMissionReferenceDate()
Get initial date.double
getMu()
Get gravitational coefficient.boolean
isSimpleEOP()
Get EOP interpolation method.ODMFile
parse(InputStream stream)
Parse a CCSDS Orbit Data Message.abstract ODMFile
parse(InputStream stream, String fileName)
Parse a CCSDS Orbit Data Message.ODMFile
parse(String fileName)
Parse a CCSDS Orbit Data Message.protected CCSDSFrame
parseCCSDSFrame(String frameName)
Parse a CCSDS frame.protected boolean
parseComment(org.orekit.files.ccsds.KeyValue keyValue, List<String> comment)
Parse a comment line.protected AbsoluteDate
parseDate(String date, CcsdsTimeScale timeSystem)
Parse a date.protected boolean
parseGeneralStateDataEntry(org.orekit.files.ccsds.KeyValue keyValue, OGMFile general, List<String> comment)
Parse a general state data key = value entry.protected boolean
parseHeaderEntry(org.orekit.files.ccsds.KeyValue keyValue, ODMFile odmFile, List<String> comment)
Parse an entry from the header.protected boolean
parseMetaDataEntry(org.orekit.files.ccsds.KeyValue keyValue, ODMMetaData metaData, List<String> comment)
Parse a meta-data key = value entry.abstract ODMParser
withConventions(IERSConventions newConventions)
Set IERS conventions.abstract ODMParser
withInternationalDesignator(int newLaunchYear, int newLaunchNumber, String newLaunchPiece)
Set international designator.abstract ODMParser
withMissionReferenceDate(AbsoluteDate newMissionReferenceDate)
Set initial date.abstract ODMParser
withMu(double newMu)
Set gravitational coefficient.abstract ODMParser
withSimpleEOP(boolean newSimpleEOP)
Set EOP interpolation method.
-
-
-
Constructor Detail
-
ODMParser
protected ODMParser(AbsoluteDate missionReferenceDate, double mu, IERSConventions conventions, boolean simpleEOP, int launchYear, int launchNumber, String launchPiece)
Complete constructor.- Parameters:
missionReferenceDate
- reference date for Mission Elapsed Time or Mission Relative Time time systemsmu
- gravitational coefficientconventions
- IERS ConventionssimpleEOP
- if true, tidal effects are ignored when interpolating EOPlaunchYear
- launch year for TLEslaunchNumber
- launch number for TLEslaunchPiece
- piece of launch (from "A" to "ZZZ") for TLEs
-
-
Method Detail
-
withMissionReferenceDate
public abstract ODMParser 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)
-
withMu
public abstract ODMParser withMu(double newMu)
Set gravitational coefficient.- Parameters:
newMu
- gravitational coefficient to use while parsing- Returns:
- a new instance, with gravitational coefficient date replaced
- See Also:
getMu()
-
getMu
public double getMu()
Get gravitational coefficient.- Returns:
- gravitational coefficient to use while parsing
- See Also:
withMu(double)
-
withConventions
public abstract ODMParser 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 abstract ODMParser 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)
-
withInternationalDesignator
public abstract ODMParser withInternationalDesignator(int newLaunchYear, int newLaunchNumber, String newLaunchPiece)
Set international designator.This method may be used to ensure the launch year number and pieces are correctly set if they are not present in the CCSDS file header in the OBJECT_ID in the form YYYY-NNN-P{PP}. If they are already in the header, they will be parsed automatically regardless of this method being called or not (i.e. header information override information set here).
- Parameters:
newLaunchYear
- launch yearnewLaunchNumber
- launch numbernewLaunchPiece
- piece of launch (from "A" to "ZZZ")- Returns:
- a new instance, with TLE settings replaced
-
getLaunchYear
public int getLaunchYear()
Get the launch year.- Returns:
- launch year
-
getLaunchNumber
public int getLaunchNumber()
Get the launch number.- Returns:
- launch number
-
getLaunchPiece
public String getLaunchPiece()
Get the piece of launch.- Returns:
- piece of launch
-
parse
public ODMFile parse(String fileName)
Parse a CCSDS Orbit Data Message.- Parameters:
fileName
- name of the file containing the message- Returns:
- parsed orbit
-
parse
public ODMFile parse(InputStream stream)
Parse a CCSDS Orbit Data Message.- Parameters:
stream
- stream containing message- Returns:
- parsed orbit
-
parse
public abstract ODMFile parse(InputStream stream, String fileName)
Parse a CCSDS Orbit Data Message.- Parameters:
stream
- stream containing messagefileName
- name of the file containing the message (for error messages)- Returns:
- parsed orbit
-
parseComment
protected boolean parseComment(org.orekit.files.ccsds.KeyValue keyValue, List<String> comment)
Parse a comment line.- Parameters:
keyValue
- key=value pair containing the commentcomment
- placeholder where the current comment line should be added- Returns:
- true if the line was a comment line and was parsed
-
parseHeaderEntry
protected boolean parseHeaderEntry(org.orekit.files.ccsds.KeyValue keyValue, ODMFile odmFile, List<String> comment)
Parse an entry from the header.- Parameters:
keyValue
- key = value pairodmFile
- instance to update with parsed entrycomment
- previous comment lines, will be emptied if used by the keyword- Returns:
- true if the keyword was a header keyword and has been parsed
-
parseMetaDataEntry
protected boolean parseMetaDataEntry(org.orekit.files.ccsds.KeyValue keyValue, ODMMetaData metaData, List<String> comment)
Parse a meta-data key = value entry.- Parameters:
keyValue
- key = value pairmetaData
- instance to update with parsed entrycomment
- previous comment lines, will be emptied if used by the keyword- Returns:
- true if the keyword was a meta-data keyword and has been parsed
-
parseGeneralStateDataEntry
protected boolean parseGeneralStateDataEntry(org.orekit.files.ccsds.KeyValue keyValue, OGMFile general, List<String> comment)
Parse a general state data key = value entry.- Parameters:
keyValue
- key = value pairgeneral
- instance to update with parsed entrycomment
- previous comment lines, will be emptied if used by the keyword- Returns:
- true if the keyword was a meta-data keyword and has been parsed
-
parseCCSDSFrame
protected CCSDSFrame parseCCSDSFrame(String frameName)
Parse a CCSDS frame.- Parameters:
frameName
- name of the frame, as the value of a CCSDS key=value line- Returns:
- CCSDS frame corresponding to the name
-
parseDate
protected AbsoluteDate parseDate(String date, CcsdsTimeScale timeSystem)
Parse a date.- Parameters:
date
- date to parse, as the value of a CCSDS key=value linetimeSystem
- time system to use- Returns:
- parsed date
-
-