OffsetModel.java

  1. /* Copyright 2002-2016 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.time;


  18. /** TAI UTC offset model.
  19.  * @see UTCTAIOffsetsLoader
  20.  * @author Luc Maisonobe
  21.  * @since 7.1
  22.  */
  23. public class OffsetModel {

  24.     /** Date of the offset start. */
  25.     private final DateComponents start;

  26.     /** Reference date of the linear model as a modified julian day. */
  27.     private final int mjdRef;

  28.     /** Offset at reference date in seconds (TAI minus UTC). */
  29.     private final double offset;

  30.     /** Offset slope in seconds per UTC day (TAI minus UTC / dUTC). */
  31.     private final double slope;

  32.     /** Constructor for a linear offset model.
  33.      * <p>
  34.      * These models were used prior to 1972.
  35.      * </p>
  36.      * @param start date of the offset start
  37.      * @param mjdRef reference date of the linear model as a modified julian day
  38.      * @param offset offset at reference date in seconds (TAI minus UTC)
  39.      * @param slope offset slope in seconds per UTC day (TAI minus UTC / dUTC)
  40.      */
  41.     public OffsetModel(final DateComponents start,
  42.                        final int mjdRef, final double offset, final double slope) {
  43.         this.start  = start;
  44.         this.mjdRef = mjdRef;
  45.         this.offset = offset;
  46.         this.slope  = slope;
  47.     }

  48.     /** Constructor for a constant offset model.
  49.      * <p>
  50.      * These models are used since 1972.
  51.      * </p>
  52.      * @param start date of the offset start
  53.      * @param offset offset at reference date in seconds (TAI minus UTC)
  54.      */
  55.     public OffsetModel(final DateComponents start, final int offset) {
  56.         this(start, 41317, offset, 0.0);
  57.     }

  58.     /** Get the date of the offset start.
  59.      * @return date of the offset start
  60.      */
  61.     public DateComponents getStart() {
  62.         return start;
  63.     }

  64.     /** Get the reference date of the linear model as a modified julian day.
  65.      * @return reference date of the linear model as a modified julian day
  66.      */
  67.     public int getMJDRef() {
  68.         return mjdRef;
  69.     }

  70.     /** Offset at reference date in seconds (TAI minus UTC).
  71.      * @return offset at reference date in seconds (TAI minus UTC)
  72.      */
  73.     public double getOffset() {
  74.         return offset;
  75.     }

  76.     /** Offset slope in seconds per UTC day (TAI minus UTC / dUTC).
  77.      * @return offset slope in seconds per UTC day (TAI minus UTC / dUTC)
  78.      */
  79.     public double getSlope() {
  80.         return slope;
  81.     }

  82. }