ODMParser.java

  1. /* Copyright 2002-2020 CS Group
  2.  * Licensed to CS Group (CS) under one or more
  3.  * contributor license agreements.  See the NOTICE file distributed with
  4.  * this work for additional information regarding copyright ownership.
  5.  * CS licenses this file to You under the Apache License, Version 2.0
  6.  * (the "License"); you may not use this file except in compliance with
  7.  * the License.  You may obtain a copy of the License at
  8.  *
  9.  *   http://www.apache.org/licenses/LICENSE-2.0
  10.  *
  11.  * Unless required by applicable law or agreed to in writing, software
  12.  * distributed under the License is distributed on an "AS IS" BASIS,
  13.  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14.  * See the License for the specific language governing permissions and
  15.  * limitations under the License.
  16.  */
  17. package org.orekit.files.ccsds;

  18. import java.io.FileInputStream;
  19. import java.io.IOException;
  20. import java.io.InputStream;
  21. import java.util.List;
  22. import java.util.regex.Matcher;
  23. import java.util.regex.Pattern;

  24. import org.hipparchus.util.FastMath;
  25. import org.orekit.annotation.DefaultDataContext;
  26. import org.orekit.bodies.CelestialBodies;
  27. import org.orekit.data.DataContext;
  28. import org.orekit.errors.OrekitException;
  29. import org.orekit.errors.OrekitMessages;
  30. import org.orekit.time.AbsoluteDate;
  31. import org.orekit.utils.IERSConventions;

  32. /**
  33.  * Base class for all CCSDS Orbit Data Message parsers.
  34.  *
  35.  * <p> This base class is immutable, and hence thread safe. When parts must be
  36.  * changed, such as reference date for Mission Elapsed Time or Mission Relative
  37.  * Time time systems, or the gravitational coefficient or the IERS conventions,
  38.  * the various {@code withXxx} methods must be called, which create a new
  39.  * immutable instance with the new parameters. This is a combination of the <a
  40.  * href="https://en.wikipedia.org/wiki/Builder_pattern">builder design
  41.  * pattern</a> and a <a href="http://en.wikipedia.org/wiki/Fluent_interface">fluent
  42.  * interface</a>.
  43.  *
  44.  * @author Luc Maisonobe
  45.  * @since 6.1
  46.  */
  47. public abstract class ODMParser {

  48.     /** Pattern for international designator. */
  49.     private static final Pattern INTERNATIONAL_DESIGNATOR = Pattern.compile("(\\p{Digit}{4})-(\\p{Digit}{3})(\\p{Upper}{1,3})");

  50.     /** Reference date for Mission Elapsed Time or Mission Relative Time time systems. */
  51.     private final AbsoluteDate missionReferenceDate;

  52.     /** Gravitational coefficient. */
  53.     private final  double mu;

  54.     /** IERS Conventions. */
  55.     private final  IERSConventions conventions;

  56.     /** Indicator for simple or accurate EOP interpolation. */
  57.     private final  boolean simpleEOP;

  58.     /** Data context used for obtain frames and time scales. */
  59.     private final DataContext dataContext;

  60.     /** Launch Year. */
  61.     private int launchYear;

  62.     /** Launch number. */
  63.     private int launchNumber;

  64.     /** Piece of launch (from "A" to "ZZZ"). */
  65.     private String launchPiece;

  66.     /** Complete constructor.
  67.      *
  68.      * <p>This method uses the {@link DataContext#getDefault() default data context}.
  69.      *
  70.      * @param missionReferenceDate reference date for Mission Elapsed Time or Mission Relative Time time systems
  71.      * @param mu gravitational coefficient
  72.      * @param conventions IERS Conventions
  73.      * @param simpleEOP if true, tidal effects are ignored when interpolating EOP
  74.      * @param launchYear launch year for TLEs
  75.      * @param launchNumber launch number for TLEs
  76.      * @param launchPiece piece of launch (from "A" to "ZZZ") for TLEs
  77.      * @see #ODMParser(AbsoluteDate, double, IERSConventions, boolean, int, int, String, DataContext)
  78.      * @deprecated use {@link #ODMParser(AbsoluteDate, double, IERSConventions, boolean,
  79.      * int, int, String, DataContext)} instead.
  80.      */
  81.     @Deprecated
  82.     @DefaultDataContext
  83.     protected ODMParser(final AbsoluteDate missionReferenceDate, final double mu,
  84.                         final IERSConventions conventions, final boolean simpleEOP,
  85.                         final int launchYear, final int launchNumber, final String launchPiece) {
  86.         this(missionReferenceDate, mu, conventions, simpleEOP, launchYear, launchNumber,
  87.                 launchPiece, DataContext.getDefault());
  88.     }

  89.     /** Complete constructor.
  90.      * @param missionReferenceDate reference date for Mission Elapsed Time or Mission Relative Time time systems
  91.      * @param mu gravitational coefficient
  92.      * @param conventions IERS Conventions
  93.      * @param simpleEOP if true, tidal effects are ignored when interpolating EOP
  94.      * @param launchYear launch year for TLEs
  95.      * @param launchNumber launch number for TLEs
  96.      * @param launchPiece piece of launch (from "A" to "ZZZ") for TLEs
  97.      * @param dataContext used to retrieve frames and time scales.
  98.      * @since 10.1
  99.      */
  100.     protected ODMParser(final AbsoluteDate missionReferenceDate, final double mu,
  101.                         final IERSConventions conventions, final boolean simpleEOP,
  102.                         final int launchYear, final int launchNumber,
  103.                         final String launchPiece,
  104.                         final DataContext dataContext) {
  105.         this.missionReferenceDate = missionReferenceDate;
  106.         this.mu                   = mu;
  107.         this.conventions          = conventions;
  108.         this.simpleEOP            = simpleEOP;
  109.         this.launchYear           = launchYear;
  110.         this.launchNumber         = launchNumber;
  111.         this.launchPiece          = launchPiece;
  112.         this.dataContext = dataContext;
  113.     }

  114.     /** Set initial date.
  115.      * @param newMissionReferenceDate mission reference date to use while parsing
  116.      * @return a new instance, with mission reference date replaced
  117.      * @see #getMissionReferenceDate()
  118.      */
  119.     public abstract ODMParser withMissionReferenceDate(AbsoluteDate newMissionReferenceDate);

  120.     /** Get initial date.
  121.      * @return mission reference date to use while parsing
  122.      * @see #withMissionReferenceDate(AbsoluteDate)
  123.      */
  124.     public AbsoluteDate getMissionReferenceDate() {
  125.         return missionReferenceDate;
  126.     }

  127.     /** Set gravitational coefficient.
  128.      * @param newMu gravitational coefficient to use while parsing
  129.      * @return a new instance, with gravitational coefficient date replaced
  130.      * @see #getMu()
  131.      */
  132.     public abstract ODMParser withMu(double newMu);

  133.     /** Get gravitational coefficient.
  134.      * @return gravitational coefficient to use while parsing
  135.      * @see #withMu(double)
  136.      */
  137.     public double getMu() {
  138.         return mu;
  139.     }

  140.     /** Set IERS conventions.
  141.      * @param newConventions IERS conventions to use while parsing
  142.      * @return a new instance, with IERS conventions replaced
  143.      * @see #getConventions()
  144.      */
  145.     public abstract ODMParser withConventions(IERSConventions newConventions);

  146.     /** Get IERS conventions.
  147.      * @return IERS conventions to use while parsing
  148.      * @see #withConventions(IERSConventions)
  149.      */
  150.     public IERSConventions getConventions() {
  151.         return conventions;
  152.     }

  153.     /** Set EOP interpolation method.
  154.      * @param newSimpleEOP if true, tidal effects are ignored when interpolating EOP
  155.      * @return a new instance, with EOP interpolation method replaced
  156.      * @see #isSimpleEOP()
  157.      */
  158.     public abstract ODMParser withSimpleEOP(boolean newSimpleEOP);

  159.     /** Get EOP interpolation method.
  160.      * @return true if tidal effects are ignored when interpolating EOP
  161.      * @see #withSimpleEOP(boolean)
  162.      */
  163.     public boolean isSimpleEOP() {
  164.         return simpleEOP;
  165.     }

  166.     /** Set international designator.
  167.      * <p>
  168.      * This method may be used to ensure the launch year number and pieces are
  169.      * correctly set if they are not present in the CCSDS file header in the
  170.      * OBJECT_ID in the form YYYY-NNN-P{PP}. If they are already in the header,
  171.      * they will be parsed automatically regardless of this method being called
  172.      * or not (i.e. header information override information set here).
  173.      * </p>
  174.      * @param newLaunchYear launch year
  175.      * @param newLaunchNumber launch number
  176.      * @param newLaunchPiece piece of launch (from "A" to "ZZZ")
  177.      * @return a new instance, with TLE settings replaced
  178.      */
  179.     public abstract ODMParser withInternationalDesignator(int newLaunchYear,
  180.                                                           int newLaunchNumber,
  181.                                                           String newLaunchPiece);

  182.     /** Get the launch year.
  183.      * @return launch year
  184.      */
  185.     public int getLaunchYear() {
  186.         return launchYear;
  187.     }

  188.     /** Get the launch number.
  189.      * @return launch number
  190.      */
  191.     public int getLaunchNumber() {
  192.         return launchNumber;
  193.     }

  194.     /** Get the piece of launch.
  195.      * @return piece of launch
  196.      */
  197.     public String getLaunchPiece() {
  198.         return launchPiece;
  199.     }

  200.     /**
  201.      * Get the data context used for getting frames, time scales, and celestial bodies.
  202.      *
  203.      * @return the data context.
  204.      */
  205.     public DataContext getDataContext() {
  206.         return dataContext;
  207.     }

  208.     /**
  209.      * Set the data context.
  210.      *
  211.      * @param newDataContext used for frames, time scales, and celestial bodies.
  212.      * @return a new instance with the data context replaced.
  213.      */
  214.     public abstract ODMParser withDataContext(DataContext newDataContext);

  215.     /** Parse a CCSDS Orbit Data Message.
  216.      * @param fileName name of the file containing the message
  217.      * @return parsed orbit
  218.      */
  219.     public ODMFile parse(final String fileName) {
  220.         try (InputStream stream = new FileInputStream(fileName)) {
  221.             return parse(stream, fileName);
  222.         } catch (IOException e) {
  223.             throw new OrekitException(OrekitMessages.UNABLE_TO_FIND_FILE, fileName);
  224.         }
  225.     }

  226.     /** Parse a CCSDS Orbit Data Message.
  227.      * @param stream stream containing message
  228.      * @return parsed orbit
  229.      */
  230.     public ODMFile parse(final InputStream stream) {
  231.         return parse(stream, "<unknown>");
  232.     }

  233.     /** Parse a CCSDS Orbit Data Message.
  234.      * @param stream stream containing message
  235.      * @param fileName name of the file containing the message (for error messages)
  236.      * @return parsed orbit
  237.      */
  238.     public abstract ODMFile parse(InputStream stream, String fileName);

  239.     /** Parse a comment line.
  240.      * @param keyValue key=value pair containing the comment
  241.      * @param comment placeholder where the current comment line should be added
  242.      * @return true if the line was a comment line and was parsed
  243.      */
  244.     protected boolean parseComment(final KeyValue keyValue, final List<String> comment) {
  245.         if (keyValue.getKeyword() == Keyword.COMMENT) {
  246.             comment.add(keyValue.getValue());
  247.             return true;
  248.         } else {
  249.             return false;
  250.         }
  251.     }

  252.     /** Parse an entry from the header.
  253.      * @param keyValue key = value pair
  254.      * @param odmFile instance to update with parsed entry
  255.      * @param comment previous comment lines, will be emptied if used by the keyword
  256.      * @return true if the keyword was a header keyword and has been parsed
  257.      */
  258.     protected boolean parseHeaderEntry(final KeyValue keyValue,
  259.                                        final ODMFile odmFile, final List<String> comment) {
  260.         switch (keyValue.getKeyword()) {

  261.             case CREATION_DATE:
  262.                 if (!comment.isEmpty()) {
  263.                     odmFile.setHeaderComment(comment);
  264.                     comment.clear();
  265.                 }
  266.                 odmFile.setCreationDate(new AbsoluteDate(
  267.                         keyValue.getValue(),
  268.                         dataContext.getTimeScales().getUTC()));
  269.                 return true;

  270.             case ORIGINATOR:
  271.                 odmFile.setOriginator(keyValue.getValue());
  272.                 return true;

  273.             default:
  274.                 return false;

  275.         }

  276.     }

  277.     /** Parse a meta-data key = value entry.
  278.      * @param keyValue key = value pair
  279.      * @param metaData instance to update with parsed entry
  280.      * @param comment previous comment lines, will be emptied if used by the keyword
  281.      * @return true if the keyword was a meta-data keyword and has been parsed
  282.      */
  283.     protected boolean parseMetaDataEntry(final KeyValue keyValue,
  284.                                          final ODMMetaData metaData, final List<String> comment) {
  285.         switch (keyValue.getKeyword()) {
  286.             case OBJECT_NAME:
  287.                 if (!comment.isEmpty()) {
  288.                     metaData.setComment(comment);
  289.                     comment.clear();
  290.                 }
  291.                 metaData.setObjectName(keyValue.getValue());
  292.                 return true;

  293.             case OBJECT_ID: {
  294.                 metaData.setObjectID(keyValue.getValue());
  295.                 final Matcher matcher = INTERNATIONAL_DESIGNATOR.matcher(keyValue.getValue());
  296.                 if (matcher.matches()) {
  297.                     metaData.setLaunchYear(Integer.parseInt(matcher.group(1)));
  298.                     metaData.setLaunchNumber(Integer.parseInt(matcher.group(2)));
  299.                     metaData.setLaunchPiece(matcher.group(3));
  300.                 }
  301.                 return true;
  302.             }

  303.             case CENTER_NAME:
  304.                 metaData.setCenterName(keyValue.getValue());
  305.                 final String canonicalValue;
  306.                 if (keyValue.getValue().equals("SOLAR SYSTEM BARYCENTER") || keyValue.getValue().equals("SSB")) {
  307.                     canonicalValue = "SOLAR_SYSTEM_BARYCENTER";
  308.                 } else if (keyValue.getValue().equals("EARTH MOON BARYCENTER") || keyValue.getValue().equals("EARTH-MOON BARYCENTER") ||
  309.                         keyValue.getValue().equals("EARTH BARYCENTER") || keyValue.getValue().equals("EMB")) {
  310.                     canonicalValue = "EARTH_MOON";
  311.                 } else {
  312.                     canonicalValue = keyValue.getValue();
  313.                 }
  314.                 for (final CenterName c : CenterName.values()) {
  315.                     if (c.name().equals(canonicalValue)) {
  316.                         metaData.setHasCreatableBody(true);
  317.                         final CelestialBodies celestialBodies =
  318.                                 getDataContext().getCelestialBodies();
  319.                         metaData.setCenterBody(c.getCelestialBody(celestialBodies));
  320.                         metaData.getODMFile().setMuCreated(
  321.                                 c.getCelestialBody(celestialBodies).getGM());
  322.                     }
  323.                 }
  324.                 return true;

  325.             case REF_FRAME:
  326.                 metaData.setFrameString(keyValue.getValue());
  327.                 metaData.setRefFrame(parseCCSDSFrame(keyValue.getValue())
  328.                         .getFrame(getConventions(), isSimpleEOP(), getDataContext()));
  329.                 return true;

  330.             case REF_FRAME_EPOCH:
  331.                 metaData.setFrameEpochString(keyValue.getValue());
  332.                 return true;

  333.             case TIME_SYSTEM:
  334.                 if (!CcsdsTimeScale.contains(keyValue.getValue())) {
  335.                     throw new OrekitException(
  336.                             OrekitMessages.CCSDS_TIME_SYSTEM_NOT_IMPLEMENTED,
  337.                             keyValue.getValue());
  338.                 }
  339.                 final CcsdsTimeScale timeSystem =
  340.                         CcsdsTimeScale.valueOf(keyValue.getValue());
  341.                 metaData.setTimeSystem(timeSystem);
  342.                 if (metaData.getFrameEpochString() != null) {
  343.                     metaData.setFrameEpoch(parseDate(metaData.getFrameEpochString(), timeSystem));
  344.                 }
  345.                 return true;

  346.             default:
  347.                 return false;
  348.         }
  349.     }

  350.     /** Parse a general state data key = value entry.
  351.      * @param keyValue key = value pair
  352.      * @param general instance to update with parsed entry
  353.      * @param comment previous comment lines, will be emptied if used by the keyword
  354.      * @return true if the keyword was a meta-data keyword and has been parsed
  355.      */
  356.     protected boolean parseGeneralStateDataEntry(final KeyValue keyValue,
  357.                                                  final OGMFile general, final List<String> comment) {
  358.         switch (keyValue.getKeyword()) {

  359.             case EPOCH:
  360.                 general.setEpochComment(comment);
  361.                 comment.clear();
  362.                 general.setEpoch(parseDate(keyValue.getValue(), general.getMetaData().getTimeSystem()));
  363.                 return true;

  364.             case SEMI_MAJOR_AXIS:
  365.                 general.setKeplerianElementsComment(comment);
  366.                 comment.clear();
  367.                 general.setA(keyValue.getDoubleValue() * 1000);
  368.                 general.setHasKeplerianElements(true);
  369.                 return true;

  370.             case ECCENTRICITY:
  371.                 general.setE(keyValue.getDoubleValue());
  372.                 return true;

  373.             case INCLINATION:
  374.                 general.setI(FastMath.toRadians(keyValue.getDoubleValue()));
  375.                 return true;

  376.             case RA_OF_ASC_NODE:
  377.                 general.setRaan(FastMath.toRadians(keyValue.getDoubleValue()));
  378.                 return true;

  379.             case ARG_OF_PERICENTER:
  380.                 general.setPa(FastMath.toRadians(keyValue.getDoubleValue()));
  381.                 return true;

  382.             case TRUE_ANOMALY:
  383.                 general.setAnomalyType("TRUE");
  384.                 general.setAnomaly(FastMath.toRadians(keyValue.getDoubleValue()));
  385.                 return true;

  386.             case MEAN_ANOMALY:
  387.                 general.setAnomalyType("MEAN");
  388.                 general.setAnomaly(FastMath.toRadians(keyValue.getDoubleValue()));
  389.                 return true;

  390.             case GM:
  391.                 general.setMuParsed(keyValue.getDoubleValue() * 1e9);
  392.                 return true;

  393.             case MASS:
  394.                 comment.addAll(0, general.getSpacecraftComment());
  395.                 general.setSpacecraftComment(comment);
  396.                 comment.clear();
  397.                 general.setMass(keyValue.getDoubleValue());
  398.                 return true;

  399.             case SOLAR_RAD_AREA:
  400.                 comment.addAll(0, general.getSpacecraftComment());
  401.                 general.setSpacecraftComment(comment);
  402.                 comment.clear();
  403.                 general.setSolarRadArea(keyValue.getDoubleValue());
  404.                 return true;

  405.             case SOLAR_RAD_COEFF:
  406.                 comment.addAll(0, general.getSpacecraftComment());
  407.                 general.setSpacecraftComment(comment);
  408.                 comment.clear();
  409.                 general.setSolarRadCoeff(keyValue.getDoubleValue());
  410.                 return true;

  411.             case DRAG_AREA:
  412.                 comment.addAll(0, general.getSpacecraftComment());
  413.                 general.setSpacecraftComment(comment);
  414.                 comment.clear();
  415.                 general.setDragArea(keyValue.getDoubleValue());
  416.                 return true;

  417.             case DRAG_COEFF:
  418.                 comment.addAll(0, general.getSpacecraftComment());
  419.                 general.setSpacecraftComment(comment);
  420.                 comment.clear();
  421.                 general.setDragCoeff(keyValue.getDoubleValue());
  422.                 return true;

  423.             case COV_REF_FRAME:
  424.                 general.setCovarianceComment(comment);
  425.                 comment.clear();
  426.                 final CCSDSFrame covFrame = parseCCSDSFrame(keyValue.getValue());
  427.                 if (covFrame.isLof()) {
  428.                     general.setCovRefLofType(covFrame.getLofType());
  429.                 } else {
  430.                     general.setCovRefFrame(covFrame
  431.                             .getFrame(getConventions(), isSimpleEOP(), getDataContext()));
  432.                 }
  433.                 return true;

  434.             case CX_X:
  435.                 general.createCovarianceMatrix();
  436.                 general.setCovarianceMatrixEntry(0, 0, keyValue.getDoubleValue() * 1.0e6);
  437.                 return true;

  438.             case CY_X:
  439.                 general.setCovarianceMatrixEntry(0, 1, keyValue.getDoubleValue() * 1.0e6);
  440.                 return true;

  441.             case CY_Y:
  442.                 general.setCovarianceMatrixEntry(1, 1, keyValue.getDoubleValue() * 1.0e6);
  443.                 return true;

  444.             case CZ_X:
  445.                 general.setCovarianceMatrixEntry(0, 2, keyValue.getDoubleValue() * 1.0e6);
  446.                 return true;

  447.             case CZ_Y:
  448.                 general.setCovarianceMatrixEntry(1, 2, keyValue.getDoubleValue() * 1.0e6);
  449.                 return true;

  450.             case CZ_Z:
  451.                 general.setCovarianceMatrixEntry(2, 2, keyValue.getDoubleValue() * 1.0e6);
  452.                 return true;

  453.             case CX_DOT_X:
  454.                 general.setCovarianceMatrixEntry(0, 3, keyValue.getDoubleValue() * 1.0e6);
  455.                 return true;

  456.             case CX_DOT_Y:
  457.                 general.setCovarianceMatrixEntry(1, 3, keyValue.getDoubleValue() * 1.0e6);
  458.                 return true;

  459.             case CX_DOT_Z:
  460.                 general.setCovarianceMatrixEntry(2, 3, keyValue.getDoubleValue() * 1.0e6);
  461.                 return true;

  462.             case CX_DOT_X_DOT:
  463.                 general.setCovarianceMatrixEntry(3, 3, keyValue.getDoubleValue() * 1.0e6);
  464.                 return true;

  465.             case CY_DOT_X:
  466.                 general.setCovarianceMatrixEntry(0, 4, keyValue.getDoubleValue() * 1.0e6);
  467.                 return true;

  468.             case CY_DOT_Y:
  469.                 general.setCovarianceMatrixEntry(1, 4, keyValue.getDoubleValue() * 1.0e6);
  470.                 return true;

  471.             case CY_DOT_Z:
  472.                 general.setCovarianceMatrixEntry(2, 4, keyValue.getDoubleValue() * 1.0e6);
  473.                 return true;

  474.             case CY_DOT_X_DOT:
  475.                 general.setCovarianceMatrixEntry(3, 4, keyValue.getDoubleValue() * 1.0e6);
  476.                 return true;

  477.             case CY_DOT_Y_DOT:
  478.                 general.setCovarianceMatrixEntry(4, 4, keyValue.getDoubleValue() * 1.0e6);
  479.                 return true;

  480.             case CZ_DOT_X:
  481.                 general.setCovarianceMatrixEntry(0, 5, keyValue.getDoubleValue() * 1.0e6);
  482.                 return true;

  483.             case CZ_DOT_Y:
  484.                 general.setCovarianceMatrixEntry(1, 5, keyValue.getDoubleValue() * 1.0e6);
  485.                 return true;

  486.             case CZ_DOT_Z:
  487.                 general.setCovarianceMatrixEntry(2, 5, keyValue.getDoubleValue() * 1.0e6);
  488.                 return true;

  489.             case CZ_DOT_X_DOT:
  490.                 general.setCovarianceMatrixEntry(3, 5, keyValue.getDoubleValue() * 1.0e6);
  491.                 return true;

  492.             case CZ_DOT_Y_DOT:
  493.                 general.setCovarianceMatrixEntry(4, 5, keyValue.getDoubleValue() * 1.0e6);
  494.                 return true;

  495.             case CZ_DOT_Z_DOT:
  496.                 general.setCovarianceMatrixEntry(5, 5, keyValue.getDoubleValue() * 1.0e6);
  497.                 return true;

  498.             case USER_DEFINED_X:
  499.                 general.setUserDefinedParameters(keyValue.getKey(), keyValue.getValue());
  500.                 return true;

  501.             default:
  502.                 return false;
  503.         }
  504.     }

  505.     /** Parse a CCSDS frame.
  506.      * @param frameName name of the frame, as the value of a CCSDS key=value line
  507.      * @return CCSDS frame corresponding to the name
  508.      */
  509.     protected CCSDSFrame parseCCSDSFrame(final String frameName) {
  510.         return CCSDSFrame.valueOf(frameName.replaceAll("-", ""));
  511.     }

  512.     /** Parse a date.
  513.      * @param date date to parse, as the value of a CCSDS key=value line
  514.      * @param timeSystem time system to use
  515.      * @return parsed date
  516.      */
  517.     protected AbsoluteDate parseDate(final String date, final CcsdsTimeScale timeSystem) {
  518.         return timeSystem.parseDate(date, conventions, missionReferenceDate,
  519.                 getDataContext().getTimeScales());
  520.     }

  521. }