AttitudeCovarianceType.java

  1. /* Copyright 2022-2025 Luc Maisonobe
  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.adm.acm;

  18. import java.util.List;
  19. import java.util.stream.Collectors;
  20. import java.util.stream.Stream;

  21. import org.orekit.utils.units.Unit;

  22. /** Attitude covariance set type used in CCSDS {@link Acm Attitude Comprehensive Messages}.
  23.  * @author Luc Maisonobe
  24.  * @since 12.0
  25.  */
  26. public enum AttitudeCovarianceType {

  27.     // CHECKSTYLE: stop MultipleStringLiterals check

  28.     /** Angles. */
  29.     ANGLE("°²", "°²", "°²"),

  30.     /** Angles and gyro biases. */
  31.     ANGLE_GYROBIAS("°²", "°²", "°²", "°²/s²", "°²/s²", "°²/s²"),

  32.     /** Angles and angular velocities. */
  33.     ANGLE_ANGVEL("°²", "°²", "°²", "°²/s²", "°²/s²", "°²/s²"),

  34.     /** Quaternion. */
  35.     QUATERNION("n/a", "n/a", "n/a", "n/a"),

  36.     /** Quaternion and gyro biases. */
  37.     QUATERNION_GYROBIAS("n/a", "n/a", "n/a", "n/a", "°²/s²", "°²/s²", "°²/s²"),

  38.     /** Quaternion and angular velocities. */
  39.     QUATERNION_ANGVEL("n/a", "n/a", "n/a", "n/a", "°²/s²", "°²/s²", "°²/s²");

  40.     // CHECKSTYLE: resume MultipleStringLiterals check

  41.     /** Elements units. */
  42.     private final List<Unit> units;

  43.     /** Simple constructor.
  44.      * @param unitsSpecifications elements units specifications
  45.      */
  46.     AttitudeCovarianceType(final String... unitsSpecifications) {
  47.         this.units       = Stream.of(unitsSpecifications).
  48.                            map(Unit::parse).
  49.                            collect(Collectors.toList());
  50.     }

  51.     /** Get the elements units.
  52.      * @return elements units (they correspond to diagonal elements, hence they are already squared)
  53.      */
  54.     public List<Unit> getUnits() {
  55.         return units;
  56.     }

  57. }