1 /* Copyright 2002-2019 CS Systèmes d'Information
2 * Licensed to CS Systèmes d'Information (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
19 import org.hipparchus.util.FastMath;
20 import org.orekit.utils.ParameterDriver;
21
22 /** Class modeling a satellite that can be observed.
23 *
24 * @author Luc Maisonobe
25 * @since 9.3
26 */
27 public class ObservableSatellite {
28
29 /** Prefix for clock offset parameter driver, the propagator index will be appended to it. */
30 public static final String CLOCK_OFFSET_PREFIX = "clock-offset-satellite-";
31
32 /** Clock offset scaling factor.
33 * <p>
34 * We use a power of 2 to avoid numeric noise introduction
35 * in the multiplications/divisions sequences.
36 * </p>
37 */
38 private static final double CLOCK_OFFSET_SCALE = FastMath.scalb(1.0, -10);
39
40 /** Index of the propagator related to this satellite. */
41 private final int propagatorIndex;
42
43 /** Parameter driver for satellite clock offset. */
44 private final ParameterDriver clockOffsetDriver;
45
46 /** Simple constructor.
47 * @param propagatorIndex index of the propagator related to this satellite
48 */
49 public ObservableSatellite(final int propagatorIndex) {
50 this.propagatorIndex = propagatorIndex;
51 this.clockOffsetDriver = new ParameterDriver(CLOCK_OFFSET_PREFIX + propagatorIndex,
52 0.0, CLOCK_OFFSET_SCALE,
53 Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY);
54 }
55
56 /** Get the index of the propagator related to this satellite.
57 * @return index of the propagator related to this satellite
58 */
59 public int getPropagatorIndex() {
60 return propagatorIndex;
61 }
62
63 /** Get the clock offset parameter driver.
64 * <p>
65 * The offset value is defined as the value in seconds that must be <em>subtracted</em> from
66 * the satellite clock reading of time to compute the real physical date. The offset
67 * is therefore negative if the satellite clock is slow and positive if it is fast.
68 * </p>
69 * @return clock offset parameter driver
70 */
71 public ParameterDriver getClockOffsetDriver() {
72 return clockOffsetDriver;
73 }
74
75 }