GlonassUserRangeAccuracy.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.gnss.metric.messages.common;

  18. /** Enumerate for GLONASS User Range Accuracy.
  19.  * @see "ICD L1, L2 GLONASS, Edition 5.1, Table 4.4, 2008"
  20.  * @author Bryan Cazabonne
  21.  */
  22. public class GlonassUserRangeAccuracy implements AccuracyProvider {

  23.     /** User Range Accuracy indicator (word F<sub>T</sub>). */
  24.     private final int glonassUraIndex;

  25.     /**
  26.      * Simple constructor.
  27.      * @param index integer value of the Glonass user range accuracy
  28.      */
  29.     public GlonassUserRangeAccuracy(final int index) {
  30.         this.glonassUraIndex = index;
  31.     }

  32.     /** {@inheritDoc} */
  33.     @Override
  34.     public double getAccuracy() {
  35.         switch (glonassUraIndex) {
  36.             case 0  : return 1.0;
  37.             case 1  : return 2.0;
  38.             case 2  : return 2.5;
  39.             case 3  : return 4.0;
  40.             case 4  : return 5.0;
  41.             case 5  : return 7.0;
  42.             case 6  : return 10.0;
  43.             case 7  : return 12.0;
  44.             case 8  : return 14.0;
  45.             case 9  : return 16.0;
  46.             case 10 : return 32.0;
  47.             case 11 : return 64.0;
  48.             case 12 : return 128.0;
  49.             case 13 : return 256.0;
  50.             case 14 : return 512.0;
  51.             default : return 1024.0; // Data shall not be used
  52.         }
  53.     }

  54. }