1   /* Copyright 2022-2026 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  
19  import java.util.List;
20  import java.util.stream.Collectors;
21  import java.util.stream.Stream;
22  
23  import org.orekit.utils.units.Unit;
24  
25  /** Attitude covariance set type used in CCSDS {@link Acm Attitude Comprehensive Messages}.
26   * @author Luc Maisonobe
27   * @since 12.0
28   */
29  public enum AttitudeCovarianceType {
30  
31      // CHECKSTYLE: stop MultipleStringLiterals check
32  
33      /** Angles. */
34      ANGLE("°²", "°²", "°²"),
35  
36      /** Angles and gyro biases. */
37      ANGLE_GYROBIAS("°²", "°²", "°²", "°²/s²", "°²/s²", "°²/s²"),
38  
39      /** Angles and angular velocities. */
40      ANGLE_ANGVEL("°²", "°²", "°²", "°²/s²", "°²/s²", "°²/s²"),
41  
42      /** Quaternion. */
43      QUATERNION("n/a", "n/a", "n/a", "n/a"),
44  
45      /** Quaternion and gyro biases. */
46      QUATERNION_GYROBIAS("n/a", "n/a", "n/a", "n/a", "°²/s²", "°²/s²", "°²/s²"),
47  
48      /** Quaternion and angular velocities. */
49      QUATERNION_ANGVEL("n/a", "n/a", "n/a", "n/a", "°²/s²", "°²/s²", "°²/s²");
50  
51      // CHECKSTYLE: resume MultipleStringLiterals check
52  
53      /** Elements units. */
54      private final List<Unit> units;
55  
56      /** Simple constructor.
57       * @param unitsSpecifications elements units specifications
58       */
59      AttitudeCovarianceType(final String... unitsSpecifications) {
60          this.units       = Stream.of(unitsSpecifications).
61                             map(Unit::parse).
62                             collect(Collectors.toList());
63      }
64  
65      /** Get the elements units.
66       * @return elements units (they correspond to diagonal elements, hence they are already squared)
67       */
68      public List<Unit> getUnits() {
69          return units;
70      }
71  
72  }