AdditionalCovarianceMetadataKey.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.cdm;

  18. import org.orekit.files.ccsds.utils.ContextBinding;
  19. import org.orekit.files.ccsds.utils.lexical.ParseToken;
  20. import org.orekit.files.ccsds.utils.lexical.TokenType;
  21. import org.orekit.utils.units.Unit;

  22. /** Keys for {@link AdditionalCovarianceMetadata covariance metadatail y a} entries.
  23.  */
  24. public enum AdditionalCovarianceMetadataKey {

  25.     /** Comment entry. */
  26.     COMMENT((token, context, container) ->
  27.             token.getType() == TokenType.ENTRY ? container.addComment(token.getContentAsNormalizedString()) : true),

  28.     /** The atmospheric density forecast error. */
  29.     DENSITY_FORECAST_UNCERTAINTY((token, context, container) -> token.processAsDouble(Unit.NONE, context.getParsedUnitsBehavior(),
  30.                                                                                       container::setDensityForecastUncertainty)),

  31.     /** The minimum suggested covariance scale factor. */
  32.     CSCALE_FACTOR_MIN((token, context, container) -> token.processAsDouble(Unit.NONE, context.getParsedUnitsBehavior(),
  33.                                                                            container::setcScaleFactorMin)),

  34.     /** The (median) suggested covariance scale factor. */
  35.     CSCALE_FACTOR((token, context, container) -> token.processAsDouble(Unit.NONE, context.getParsedUnitsBehavior(),
  36.                                                                        container::setcScaleFactor)),

  37.     /** The maximum suggested covariance scale factor. */
  38.     CSCALE_FACTOR_MAX((token, context, container) -> token.processAsDouble(Unit.NONE, context.getParsedUnitsBehavior(),
  39.                                                                            container::setcScaleFactorMax)),

  40.     /** The source (or origin) of the specific orbital data for this object. */
  41.     SCREENING_DATA_SOURCE((token, context, container) -> token.processAsFreeTextString(container::setScreeningDataSource)),

  42.     /** The Drag Consider Parameter (DCP) sensitivity vector (position errors at TCA). */
  43.     DCP_SENSITIVITY_VECTOR_POSITION((token, context, container) -> token.processAsDoubleArray(Unit.NONE, context.getParsedUnitsBehavior(),
  44.                                                                                               container::setDcpSensitivityVectorPosition)),

  45.      /** The Drag Consider Parameter (DCP) sensitivity vector (velocity errors at TCA). */
  46.     DCP_SENSITIVITY_VECTOR_VELOCITY((token, context, container) -> token.processAsDoubleArray(Unit.NONE, context.getParsedUnitsBehavior(),
  47.                                                                                               container::setDcpSensitivityVectorVelocity));

  48.     /** Processing method. */
  49.     private final transient TokenProcessor processor;

  50.     /** Simple constructor.
  51.      * @param processor processing method
  52.      */
  53.     AdditionalCovarianceMetadataKey(final TokenProcessor processor) {
  54.         this.processor = processor;
  55.     }

  56.     /** Process one token.
  57.      * @param token token to process
  58.      * @param context context binding
  59.      * @param container container to fill
  60.      * @return true of token was accepted
  61.      */
  62.     public boolean process(final ParseToken token, final ContextBinding context, final AdditionalCovarianceMetadata container) {
  63.         return processor.process(token, context, container);
  64.     }

  65.     /** Interface for processing one token. */
  66.     interface TokenProcessor {
  67.         /** Process one token.
  68.          * @param token token to process
  69.          * @param context context binding
  70.          * @param container container to fill
  71.          * @return true of token was accepted
  72.          */
  73.         boolean process(ParseToken token, ContextBinding context, AdditionalCovarianceMetadata container);
  74.     }

  75. }