SatelliteTimeCoordinate.java

  1. /* Copyright 2002-2012 Space Applications Services
  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.files.general;

  18. import java.io.Serializable;

  19. import org.apache.commons.math3.geometry.euclidean.threed.Vector3D;
  20. import org.orekit.time.AbsoluteDate;
  21. import org.orekit.time.TimeStamped;
  22. import org.orekit.utils.PVCoordinates;

  23. /** Contains the position/velocity of a satellite at an specific epoch.
  24.  * @author Thomas Neidhart
  25.  */
  26. public class SatelliteTimeCoordinate implements TimeStamped, Serializable {

  27.     /** Serializable UID. */
  28.     private static final long serialVersionUID = -2099947583052252633L;

  29.     /** Epoch for this entry. */
  30.     private AbsoluteDate epoch;

  31.     /** Position/velocity coordinates for this entry. */
  32.     private PVCoordinates coordinate;

  33.     /** Clock correction in micro-seconds. */
  34.     private double clockCorrection;

  35.     /** Clock rate change. */
  36.     private double clockRateChange;

  37.     /** Creates a new {@link SatelliteTimeCoordinate} instance with
  38.      * a given epoch and coordinate.
  39.      * @param time the epoch of the entry
  40.      * @param coord the coordinate of the entry
  41.      */
  42.     public SatelliteTimeCoordinate(final AbsoluteDate time,
  43.                                    final PVCoordinates coord) {
  44.         this(time, coord, 0.0d, 0.0d);
  45.     }

  46.     /** Creates a new {@link SatelliteTimeCoordinate} object with a given epoch
  47.      * and position coordinate. The velocity is set to a zero vector.
  48.      * @param time the epoch of the entry
  49.      * @param pos the position coordinate of the entry
  50.      * @param clock the clock value in (micro-seconds)
  51.      */
  52.     public SatelliteTimeCoordinate(final AbsoluteDate time,
  53.                                    final Vector3D pos, final double clock) {
  54.         this(time, new PVCoordinates(pos, Vector3D.ZERO), clock, 0.0d);
  55.     }

  56.     /** Creates a new {@link SatelliteTimeCoordinate} instance with a given
  57.      * epoch, coordinate and clock value / rate change.
  58.      * @param time the epoch of the entry
  59.      * @param coord the coordinate of the entry
  60.      * @param clockCorr the clock value that corresponds to this coordinate
  61.      * @param rateChange the clock rate change
  62.      */
  63.     public SatelliteTimeCoordinate(final AbsoluteDate time,
  64.                                    final PVCoordinates coord,
  65.                                    final double clockCorr,
  66.                                    final double rateChange) {
  67.         this.epoch = time;
  68.         this.coordinate = coord;
  69.         this.clockCorrection = clockCorr;
  70.         this.clockRateChange = rateChange;
  71.     }

  72.     /** Returns the epoch for this coordinate.
  73.      * @return the epoch
  74.      */
  75.     public AbsoluteDate getEpoch() {
  76.         return epoch;
  77.     }

  78.     /** {@inheritDoc} */
  79.     public AbsoluteDate getDate() {
  80.         return getEpoch();
  81.     }

  82.     /** Set the epoch for this coordinate.
  83.      * @param epoch the epoch to be set
  84.      */
  85.     public void setEpoch(final AbsoluteDate epoch) {
  86.         this.epoch = epoch;
  87.     }

  88.     /** Returns the coordinate of this entry.
  89.      * @return the coordinate
  90.      */
  91.     public PVCoordinates getCoordinate() {
  92.         return coordinate;
  93.     }

  94.     /** Set the coordinate for this entry.
  95.      * @param coordinate the coordinate to be set
  96.      */
  97.     public void setCoordinate(final PVCoordinates coordinate) {
  98.         this.coordinate = coordinate;
  99.     }

  100.     /** Returns the clock correction value.
  101.      * @return the clock correction
  102.      */
  103.     public double getClockCorrection() {
  104.         return clockCorrection;
  105.     }

  106.     /** Set the clock correction to the given value.
  107.      * @param corr the clock correction value
  108.      */
  109.     public void setClockCorrection(final double corr) {
  110.         this.clockCorrection = corr;
  111.     }

  112.     /** Returns the clock rate change value.
  113.      * @return the clock rate change
  114.      */
  115.     public double getClockRateChange() {
  116.         return clockRateChange;
  117.     }

  118.     /** Set the clock rate change to the given value.
  119.      * @param rateChange the clock rate change value
  120.      */
  121.     public void setClockRateChange(final double rateChange) {
  122.         this.clockRateChange = rateChange;
  123.     }
  124. }