GLONASSEphemeris.java

  1. /* Copyright 2002-2021 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.propagation.analytical.gnss.data;

  18. import org.orekit.annotation.DefaultDataContext;
  19. import org.orekit.data.DataContext;
  20. import org.orekit.propagation.numerical.GLONASSNumericalPropagator;
  21. import org.orekit.time.AbsoluteDate;
  22. import org.orekit.time.GLONASSDate;

  23. /**
  24.  * Class for GLONASS ephemeris used by the {@link GLONASSNumericalPropagator}.
  25.  *
  26.  * @author Bryan Cazabonne
  27.  * @since 10.0
  28.  *
  29.  */
  30. public class GLONASSEphemeris implements GLONASSOrbitalElements {

  31.     /** Number of the current four year interval. */
  32.     private final int n4;

  33.     /** Number of the current day in a four year interval. */
  34.     private final int nt;

  35.     /** GLONASS ephemeris reference time. */
  36.     private final double tb;

  37.     /** ECEF-X component of satellite coordinates. */
  38.     private final double x;

  39.     /** ECEF-X component of satellite velocity. */
  40.     private final double xDot;

  41.     /** ECEF-X component of satellite acceleration. */
  42.     private final double xDotDot;

  43.     /** ECEF-Y component of satellite coordinates. */
  44.     private final double y;

  45.     /** ECEF-Y component of satellite velocity. */
  46.     private final double yDot;

  47.     /** ECEF-Y component of satellite acceleration. */
  48.     private final double yDotDot;

  49.     /** ECEF-Z component of satellite coordinates. */
  50.     private final double z;

  51.     /** ECEF-Z component of satellite velocity. */
  52.     private final double zDot;

  53.     /** ECEF-Z component of satellite acceleration. */
  54.     private final double zDotDot;

  55.     /** Date of applicability. */
  56.     private final AbsoluteDate date;

  57.     /**
  58.      * Build a new instance.
  59.      *
  60.      * <p>This method uses the {@link DataContext#getDefault() default data context}.
  61.      *
  62.      * @param n4 number of the current four year interval
  63.      * @param nt number of the current day in a four year interval
  64.      * @param tb reference time, s
  65.      * @param x ECEF-X component of satellite coordinates, m
  66.      * @param xDot ECEF-X component of satellite velocity, m/s
  67.      * @param xDotDot ECEF-X component of satellite acceleration, m/s²
  68.      * @param y ECEF-Y component of satellite coordinates, m
  69.      * @param yDot ECEF-Y component of satellite velocity, m/s
  70.      * @param yDotDot ECEF-Y component of satellite acceleration, m/s²
  71.      * @param z ECEF-Z component of satellite coordinates, m
  72.      * @param zDot ECEF-Z component of satellite velocity, m/s
  73.      * @param zDotDot ECEF-Z component of satellite acceleration, m/s²
  74.      * @see #GLONASSEphemeris(int, int, double, double, double, double, double, double,
  75.      * double, double, double, double, AbsoluteDate)
  76.      */
  77.     @DefaultDataContext
  78.     public GLONASSEphemeris(final int n4, final int nt, final double tb,
  79.                             final double x, final double xDot, final double xDotDot,
  80.                             final double y, final double yDot, final double yDotDot,
  81.                             final double z, final double zDot, final double zDotDot) {
  82.         this(n4, nt, tb, x, xDot, xDotDot, y, yDot, yDotDot, z, zDot, zDotDot,
  83.             new GLONASSDate(nt, n4, tb,
  84.                     DataContext.getDefault().getTimeScales().getGLONASS()).getDate());
  85.     }

  86.     /**
  87.      * Build a new instance.
  88.      *
  89.      * @param n4      number of the current four year interval
  90.      * @param nt      number of the current day in a four year interval
  91.      * @param tb      reference time, s
  92.      * @param x       ECEF-X component of satellite coordinates, m
  93.      * @param xDot    ECEF-X component of satellite velocity, m/s
  94.      * @param xDotDot ECEF-X component of satellite acceleration, m/s²
  95.      * @param y       ECEF-Y component of satellite coordinates, m
  96.      * @param yDot    ECEF-Y component of satellite velocity, m/s
  97.      * @param yDotDot ECEF-Y component of satellite acceleration, m/s²
  98.      * @param z       ECEF-Z component of satellite coordinates, m
  99.      * @param zDot    ECEF-Z component of satellite velocity, m/s
  100.      * @param zDotDot ECEF-Z component of satellite acceleration, m/s²
  101.      * @param date    of applicability corresponding to {@code nt}, {@code n4}, and {@code
  102.      *                tb}.
  103.      * @since 10.1
  104.      */
  105.     public GLONASSEphemeris(final int n4, final int nt, final double tb,
  106.                             final double x, final double xDot, final double xDotDot,
  107.                             final double y, final double yDot, final double yDotDot,
  108.                             final double z, final double zDot, final double zDotDot,
  109.                             final AbsoluteDate date) {
  110.         this.n4 = n4;
  111.         this.nt = nt;
  112.         this.tb = tb;
  113.         this.x = x;
  114.         this.xDot = xDot;
  115.         this.xDotDot = xDotDot;
  116.         this.y = y;
  117.         this.yDot = yDot;
  118.         this.yDotDot = yDotDot;
  119.         this.z = z;
  120.         this.zDot = zDot;
  121.         this.zDotDot = zDotDot;
  122.         this.date = date;
  123.     }

  124.     @Override
  125.     public AbsoluteDate getDate() {
  126.         return date;
  127.     }

  128.     @Override
  129.     public int getN4() {
  130.         return n4;
  131.     }

  132.     @Override
  133.     public int getNa() {
  134.         return nt;
  135.     }

  136.     @Override
  137.     public double getTime() {
  138.         return tb;
  139.     }

  140.     @Override
  141.     public double getXDot() {
  142.         return xDot;
  143.     }

  144.     @Override
  145.     public double getX() {
  146.         return x;
  147.     }

  148.     @Override
  149.     public double getXDotDot() {
  150.         return xDotDot;
  151.     }

  152.     @Override
  153.     public double getYDot() {
  154.         return yDot;
  155.     }

  156.     @Override
  157.     public double getY() {
  158.         return y;
  159.     }

  160.     @Override
  161.     public double getYDotDot() {
  162.         return yDotDot;
  163.     }

  164.     @Override
  165.     public double getZDot() {
  166.         return zDot;
  167.     }

  168.     @Override
  169.     public double getZ() {
  170.         return z;
  171.     }

  172.     @Override
  173.     public double getZDotDot() {
  174.         return zDotDot;
  175.     }

  176. }