Class ODMParser

  • Direct Known Subclasses:
    OEMParser, OMMParser, OPMParser

    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 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 systems
        mu - gravitational coefficient
        conventions - IERS Conventions
        simpleEOP - if true, tidal effects are ignored when interpolating EOP
        launchYear - launch year for TLEs
        launchNumber - launch number for TLEs
        launchPiece - 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()
      • 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()
      • 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 year
        newLaunchNumber - launch number
        newLaunchPiece - 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 message
        fileName - 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 comment
        comment - 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 pair
        odmFile - instance to update with parsed entry
        comment - 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 pair
        metaData - instance to update with parsed entry
        comment - 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 pair
        general - instance to update with parsed entry
        comment - 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 line
        timeSystem - time system to use
        Returns:
        parsed date