Station.java

  1. /* Copyright 2002-2020 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.files.sinex;

  18. import java.util.HashMap;
  19. import java.util.Map;

  20. import org.hipparchus.geometry.euclidean.threed.Vector3D;
  21. import org.orekit.time.AbsoluteDate;

  22. /**
  23.  * Station model.
  24.  * @author Bryan Cazabonne
  25.  * @since 10.3
  26.  */
  27. public class Station {

  28.     /** Site code. */
  29.     private String siteCode;

  30.     /** DOMES number. */
  31.     private String domes;

  32.     /** Start of validity. */
  33.     private AbsoluteDate validFrom;

  34.     /** End of validity. */
  35.     private AbsoluteDate validUntil;

  36.     /** Eccentricity reference system. */
  37.     private ReferenceSystem eccRefSystem;

  38.     /** Site antenna eccentricity (m). */
  39.     private Vector3D eccentricities;

  40.     /** Station position. */
  41.     private Vector3D position;

  42.     /** Station velocity. */
  43.     private Vector3D velocity;

  44.     /** Coordinates reference epoch. */
  45.     private AbsoluteDate epoch;

  46.     /**
  47.      * Constructor.
  48.      */
  49.     public Station() {
  50.         this.eccentricities = Vector3D.ZERO;
  51.         this.position       = Vector3D.ZERO;
  52.         this.velocity       = Vector3D.ZERO;
  53.     }

  54.     /**
  55.      * Get the site code (station identifier).
  56.      * @return the site code
  57.      */
  58.     public String getSiteCode() {
  59.         return siteCode;
  60.     }

  61.     /**
  62.      * Set the site code (station identifier).
  63.      * @param siteCode the site code to set
  64.      */
  65.     public void setSiteCode(final String siteCode) {
  66.         this.siteCode = siteCode;
  67.     }

  68.     /**
  69.      * Get the site DOMES number.
  70.      * @return the DOMES number
  71.      */
  72.     public String getDomes() {
  73.         return domes;
  74.     }

  75.     /**
  76.      * Set the DOMES number.
  77.      * @param domes the DOMES number to set
  78.      */
  79.     public void setDomes(final String domes) {
  80.         this.domes = domes;
  81.     }

  82.     /**
  83.      * Get start of validity.
  84.      * @return start of validity
  85.      */
  86.     public AbsoluteDate getValidFrom() {
  87.         return validFrom;
  88.     }

  89.     /**
  90.      * Set the start of validity.
  91.      * @param validFrom the start of validity to set
  92.      */
  93.     public void setValidFrom(final AbsoluteDate validFrom) {
  94.         this.validFrom = validFrom;
  95.     }

  96.     /**
  97.      * Get end of validity.
  98.      * @return end of validity
  99.      */
  100.     public AbsoluteDate getValidUntil() {
  101.         return validUntil;
  102.     }

  103.     /**
  104.      * Set the end of validity.
  105.      * @param validUntil the end of validity to set
  106.      */
  107.     public void setValidUntil(final AbsoluteDate validUntil) {
  108.         this.validUntil = validUntil;
  109.     }

  110.     /**
  111.      * Get the reference system used to define the eccentricity vector (local or cartesian).
  112.      * @return the reference system used to define the eccentricity vector
  113.      */
  114.     public ReferenceSystem getEccRefSystem() {
  115.         return eccRefSystem;
  116.     }

  117.     /**
  118.      * Set the reference system used to define the eccentricity vector (local or cartesian).
  119.      * @param eccRefSystem the reference system used to define the eccentricity vector
  120.      */
  121.     public void setEccRefSystem(final ReferenceSystem eccRefSystem) {
  122.         this.eccRefSystem = eccRefSystem;
  123.     }

  124.     /**
  125.      * Get the station antenna eccentricities.
  126.      * <p>
  127.      * Vector convention: X-Y-Z or UP-NORTH-EAST
  128.      * </p>
  129.      * @return station antenna eccentricities (m)
  130.      */
  131.     public Vector3D getEccentricities() {
  132.         return eccentricities;
  133.     }

  134.     /**
  135.      * Set the station antenna eccentricities.
  136.      * @param eccentricities the eccenticities to set (m)
  137.      */
  138.     public void setEccentricities(final Vector3D eccentricities) {
  139.         this.eccentricities = eccentricities;
  140.     }

  141.     /**
  142.      * Get the station position.
  143.      * @return the station position (m)
  144.      */
  145.     public Vector3D getPosition() {
  146.         return position;
  147.     }

  148.     /**
  149.      * Set the station position.
  150.      * @param position the position to set
  151.      */
  152.     public void setPosition(final Vector3D position) {
  153.         this.position = position;
  154.     }

  155.     /**
  156.      * Get the station velocity.
  157.      * @return the station velocity (m/s)
  158.      */
  159.     public Vector3D getVelocity() {
  160.         return velocity;
  161.     }

  162.     /**
  163.      * Set the station velocity.
  164.      * @param velocity the velocity to set
  165.      */
  166.     public void setVelocity(final Vector3D velocity) {
  167.         this.velocity = velocity;
  168.     }

  169.     /**
  170.      * Get the coordinates reference epoch.
  171.      * @return the coordinates reference epoch
  172.      */
  173.     public AbsoluteDate getEpoch() {
  174.         return epoch;
  175.     }

  176.     /**
  177.      * Set the coordinates reference epoch.
  178.      * @param epoch the epoch to set
  179.      */
  180.     public void setEpoch(final AbsoluteDate epoch) {
  181.         this.epoch = epoch;
  182.     }

  183.     /** Eccentricity reference system. */
  184.     public enum ReferenceSystem {

  185.         /** Local reference system Up, North, East. */
  186.         UNE("UNE"),

  187.         /** Cartesian reference system X, Y, Z. */
  188.         XYZ("XYZ");

  189.         /** Codes map. */
  190.         private static final Map<String, ReferenceSystem> CODES_MAP = new HashMap<>();
  191.         static {
  192.             for (final ReferenceSystem type : values()) {
  193.                 CODES_MAP.put(type.getName(), type);
  194.             }
  195.         }

  196.         /** Name used to define the reference system in SINEX file. */
  197.         private final String name;

  198.         /**
  199.          * Constructor.
  200.          * @param name name used to define the reference system in SINEX file
  201.          */
  202.         ReferenceSystem(final String name) {
  203.             this.name = name;
  204.         }

  205.         /**
  206.          * Get the name used to define the reference system in SINEX file.
  207.          * @return the name
  208.          */
  209.         public String getName() {
  210.             return name;
  211.         }

  212.         /**
  213.          * Get the eccentricity reference system corresponding to the given value.
  214.          * @param value given value
  215.          * @return the corresponding eccentricity reference system
  216.          */
  217.         public static ReferenceSystem getEccRefSystem(final String value) {
  218.             return CODES_MAP.get(value);
  219.         }

  220.     }

  221. }