AmbiguityDriver.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.estimation.measurements.gnss;

  18. import org.hipparchus.util.FastMath;
  19. import org.orekit.gnss.GnssSignal;
  20. import org.orekit.utils.Constants;
  21. import org.orekit.utils.ParameterDriver;

  22. import java.util.Locale;

  23. /** Specialized {@link ParameterDriver} for ambiguity.
  24.  * @author Luc Maisonobe
  25.  * @since 12.1
  26.  */
  27. public class AmbiguityDriver extends ParameterDriver {

  28.     /** Prefix for parameter drivers names. */
  29.     public static final String PREFIX = "ambiguity";

  30.     /** Ambiguity scale factor.
  31.      * <p>
  32.      * We use a power of 2 to avoid numeric noise introduction
  33.      * in the multiplications/divisions sequences.
  34.      * </p>
  35.      */
  36.     private static final double AMBIGUITY_SCALE = FastMath.scalb(1.0, 26);

  37.     /** Emitter id. */
  38.     private final String emitter;

  39.     /** Receiver id. */
  40.     private final String receiver;

  41.     /** Wavelength. */
  42.     private final double wavelength;

  43.     /** Simple constructor.
  44.      * @param emitter emitter id
  45.      * @param receiver receiver id
  46.      * @param wavelength signal wavelength
  47.      */
  48.     public AmbiguityDriver(final String emitter, final String receiver, final double wavelength) {
  49.         // the name is built from emitter, receiver and the multiplier
  50.         // with respect to common frequency F0 (10.23 MHz)
  51.         super(String.format(Locale.US, "%s-%s-%s-%.2f",
  52.                             PREFIX, emitter, receiver,
  53.                             Constants.SPEED_OF_LIGHT / (wavelength * GnssSignal.F0)),
  54.               0.0, AMBIGUITY_SCALE, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY);
  55.         this.emitter    = emitter;
  56.         this.receiver   = receiver;
  57.         this.wavelength = wavelength;
  58.     }

  59.     /** Get emitter id.
  60.      * @return emitter id
  61.      */
  62.     public String getEmitter() {
  63.         return emitter;
  64.     }

  65.     /** Get receiver id.
  66.      * @return receiver id
  67.      */
  68.     public String getReceiver() {
  69.         return receiver;
  70.     }

  71.     /** Get signal wavelength.
  72.      * @return signal wavelength
  73.      */
  74.     public double getWavelength() {
  75.         return wavelength;
  76.     }

  77. }