ObservableSatellite.java

  1. /* Copyright 2002-2022 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.estimation.measurements;

  18. import org.hipparchus.util.FastMath;
  19. import org.orekit.utils.ParameterDriver;

  20. /** Class modeling a satellite that can be observed.
  21.  *
  22.  * @author Luc Maisonobe
  23.  * @since 9.3
  24.  */
  25. public class ObservableSatellite {

  26.     /** Prefix for clock offset parameter driver, the propagator index will be appended to it. */
  27.     public static final String CLOCK_OFFSET_PREFIX = "clock-offset-satellite-";

  28.     /** Prefix for clock drift parameter driver, the propagator index will be appended to it. */
  29.     public static final String CLOCK_DRIFT_PREFIX = "clock-drift-satellite-";

  30.     /** Clock offset scaling 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 CLOCK_OFFSET_SCALE = FastMath.scalb(1.0, -10);

  37.     /** Index of the propagator related to this satellite. */
  38.     private final int propagatorIndex;

  39.     /** Parameter driver for satellite clock offset. */
  40.     private final ParameterDriver clockOffsetDriver;

  41.     /** Parameter driver for satellite clock drift. */
  42.     private final ParameterDriver clockDriftDriver;

  43.     /** Simple constructor.
  44.      * @param propagatorIndex index of the propagator related to this satellite
  45.      */
  46.     public ObservableSatellite(final int propagatorIndex) {
  47.         this.propagatorIndex   = propagatorIndex;
  48.         this.clockOffsetDriver = new ParameterDriver(CLOCK_OFFSET_PREFIX + propagatorIndex,
  49.                                                      0.0, CLOCK_OFFSET_SCALE,
  50.                                                      Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY);
  51.         this.clockDriftDriver = new ParameterDriver(CLOCK_DRIFT_PREFIX + propagatorIndex,
  52.                                                     0.0, CLOCK_OFFSET_SCALE,
  53.                                                     Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY);
  54.     }

  55.     /** Get the index of the propagator related to this satellite.
  56.      * @return index of the propagator related to this satellite
  57.      */
  58.     public int getPropagatorIndex() {
  59.         return propagatorIndex;
  60.     }

  61.     /** Get the clock offset parameter driver.
  62.      * <p>
  63.      * The offset value is defined as the value in seconds that must be <em>subtracted</em> from
  64.      * the satellite clock reading of time to compute the real physical date. The offset
  65.      * is therefore negative if the satellite clock is slow and positive if it is fast.
  66.      * </p>
  67.      * @return clock offset parameter driver
  68.      */
  69.     public ParameterDriver getClockOffsetDriver() {
  70.         return clockOffsetDriver;
  71.     }

  72.     /** Get the clock drift parameter driver.
  73.      * <p>
  74.      * The drift is negative if the satellite clock is slowing down and positive if it is speeding up.
  75.      * </p>
  76.      * @return clock offset parameter driver
  77.      * @since 10.3
  78.      */
  79.     public ParameterDriver getClockDriftDriver() {
  80.         return clockDriftDriver;
  81.     }

  82. }