OrbitDeterminationKey.java

  1. /* Copyright 2002-2025 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.ndm.odm.ocm;

  18. import org.orekit.files.ccsds.definitions.OdMethodFacade;
  19. import org.orekit.files.ccsds.definitions.Units;
  20. import org.orekit.files.ccsds.utils.ContextBinding;
  21. import org.orekit.files.ccsds.utils.lexical.ParseToken;
  22. import org.orekit.files.ccsds.utils.lexical.TokenType;
  23. import org.orekit.utils.units.Unit;


  24. /** Keys for {@link OrbitDetermination orbit determination data} entries.
  25.  * @author Luc Maisonobe
  26.  * @since 11.0
  27.  */
  28. public enum OrbitDeterminationKey {

  29.     /** Comment entry. */
  30.     COMMENT((token, context, container) ->
  31.             token.getType() == TokenType.ENTRY ? container.addComment(token.getContentAsNormalizedString()) : true),

  32.     /** Identification number. */
  33.     OD_ID((token, context, container) -> token.processAsFreeTextString(container::setId)),

  34.     /** Identification of previous orbit determination. */
  35.     OD_PREV_ID((token, context, container) -> token.processAsFreeTextString(container::setPrevId)),

  36.     /** Orbit determination method. */
  37.     OD_METHOD((token, context, container) -> {
  38.         if (token.getType() == TokenType.ENTRY) {
  39.             container.setMethod(OdMethodFacade.parse(token.getRawContent()));
  40.         }
  41.         return true;
  42.     }),

  43.     /** Time tag for orbit determination solved-for state. */
  44.     OD_EPOCH((token, context, container) -> token.processAsDate(container::setEpoch, context)),

  45.     /** Time elapsed between first accepted observation on epoch. */
  46.     DAYS_SINCE_FIRST_OBS((token, context, container) -> token.processAsDouble(Unit.DAY, context.getParsedUnitsBehavior(),
  47.                                                                               container::setTimeSinceFirstObservation)),

  48.     /** Time elapsed between last accepted observation on epoch. */
  49.     DAYS_SINCE_LAST_OBS((token, context, container) -> token.processAsDouble(Unit.DAY, context.getParsedUnitsBehavior(),
  50.                                                                              container::setTimeSinceLastObservation)),

  51.     /** Time span of observation recommended for the OD of the object. */
  52.     RECOMMENDED_OD_SPAN((token, context, container) -> token.processAsDouble(Unit.DAY, context.getParsedUnitsBehavior(),
  53.                                                                              container::setRecommendedOdSpan)),

  54.     /** Actual time span used for the OD of the object. */
  55.     ACTUAL_OD_SPAN((token, context, container) -> token.processAsDouble(Unit.DAY, context.getParsedUnitsBehavior(),
  56.                                                                         container::setActualOdSpan)),

  57.     /** Number of observations available within the actual OD span. */
  58.     OBS_AVAILABLE((token, context, container) -> token.processAsInteger(container::setObsAvailable)),

  59.     /** Number of observations accepted within the actual OD span. */
  60.     OBS_USED((token, context, container) -> token.processAsInteger(container::setObsUsed)),

  61.     /** Number of sensors tracks available for the OD within the actual OD span. */
  62.     TRACKS_AVAILABLE((token, context, container) -> token.processAsInteger(container::setTracksAvailable)),

  63.     /** Number of sensors tracks accepted for the OD within the actual OD span. */
  64.     TRACKS_USED((token, context, container) -> token.processAsInteger(container::setTracksUsed)),

  65.     /** Maximum time between observations in the OD of the object. */
  66.     MAXIMUM_OBS_GAP((token, context, container) -> token.processAsDouble(Unit.DAY, context.getParsedUnitsBehavior(),
  67.                                                                          container::setMaximumObsGap)),

  68.     /** Positional error ellipsoid 1σ major eigenvalue at the epoch of OD. */
  69.     OD_EPOCH_EIGMAJ((token, context, container) -> token.processAsDouble(Unit.METRE, context.getParsedUnitsBehavior(),
  70.                                                                          container::setEpochEigenMaj)),

  71.     /** Positional error ellipsoid 1σ intermediate eigenvalue at the epoch of OD. */
  72.     OD_EPOCH_EIGINT((token, context, container) -> token.processAsDouble(Unit.METRE, context.getParsedUnitsBehavior(),
  73.                                                                          container::setEpochEigenInt)),

  74.     /** Positional error ellipsoid 1σ minor eigenvalue at the epoch of OD. */
  75.     OD_EPOCH_EIGMIN((token, context, container) -> token.processAsDouble(Unit.METRE, context.getParsedUnitsBehavior(),
  76.                                                                          container::setEpochEigenMin)),

  77.     /** Maximum predicted major eigenvalue of 1σ positional error ellipsoid over entire time span of the OCM. */
  78.     OD_MAX_PRED_EIGMAJ((token, context, container) -> token.processAsDouble(Unit.METRE, context.getParsedUnitsBehavior(),
  79.                                                                             container::setMaxPredictedEigenMaj)),

  80.     /** Minimum predicted minor eigenvalue of 1σ positional error ellipsoid over entire time span of the OCM. */
  81.     OD_MIN_PRED_EIGMIN((token, context, container) -> token.processAsDouble(Unit.METRE, context.getParsedUnitsBehavior(),
  82.                                                                             container::setMinPredictedEigenMin)),

  83.     /** Confidence metric. */
  84.     OD_CONFIDENCE((token, context, container) -> token.processAsDouble(Unit.PERCENT, context.getParsedUnitsBehavior(),
  85.                                                                        container::setConfidence)),

  86.     /** Generalize Dilution Of Precision. */
  87.     GDOP((token, context, container) -> token.processAsDouble(Unit.ONE, context.getParsedUnitsBehavior(), container::setGdop)),

  88.     /** Number of solved-for states. */
  89.     SOLVE_N((token, context, container) -> token.processAsInteger(container::setSolveN)),

  90.     /** Description of state elements solved-for. */
  91.     SOLVE_STATES((token, context, container) -> token.processAsFreeTextList(container::setSolveStates)),

  92.     /** Number of consider parameters. */
  93.     CONSIDER_N((token, context, container) -> token.processAsInteger(container::setConsiderN)),

  94.     /** Description of consider parameters. */
  95.     CONSIDER_PARAMS((token, context, container) -> token.processAsFreeTextList(container::setConsiderParameters)),

  96.     /** Specific Energy Dissipation Rate.
  97.      * @since 12.0
  98.      */
  99.     SEDR((token, context, container) -> token.processAsDouble(Units.W_PER_KG, context.getParsedUnitsBehavior(),
  100.                                                               container::setSedr)),

  101.     /** Number of sensors used. */
  102.     SENSORS_N((token, context, container) -> token.processAsInteger(container::setSensorsN)),

  103.     /** Description of sensors used. */
  104.     SENSORS((token, context, container) -> token.processAsFreeTextList(container::setSensors)),

  105.     /** Weighted RMS residual ratio. */
  106.     WEIGHTED_RMS((token, context, container) -> token.processAsDouble(Unit.ONE, context.getParsedUnitsBehavior(),
  107.                                                                       container::setWeightedRms)),

  108.     /** Observation data types used. */
  109.     DATA_TYPES((token, context, container) -> token.processAsFreeTextList(container::setDataTypes));

  110.     /** Processing method. */
  111.     private final transient TokenProcessor processor;

  112.     /** Simple constructor.
  113.      * @param processor processing method
  114.      */
  115.     OrbitDeterminationKey(final TokenProcessor processor) {
  116.         this.processor = processor;
  117.     }

  118.     /** Process an token.
  119.      * @param token token to process
  120.      * @param context context binding
  121.      * @param container container to fill
  122.      * @return true of token was accepted
  123.      */
  124.     public boolean process(final ParseToken token, final ContextBinding context, final OrbitDetermination container) {
  125.         return processor.process(token, context, container);
  126.     }

  127.     /** Interface for processing one token. */
  128.     interface TokenProcessor {
  129.         /** Process one token.
  130.          * @param token token to process
  131.          * @param context context binding
  132.          * @param container container to fill
  133.          * @return true of token was accepted
  134.          */
  135.         boolean process(ParseToken token, ContextBinding context, OrbitDetermination container);
  136.     }

  137. }