Antenna.java

  1. /* Copyright 2002-2018 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.gnss.antenna;

  18. import java.util.Map;

  19. import org.hipparchus.geometry.euclidean.threed.Vector3D;
  20. import org.orekit.gnss.Frequency;

  21. /**
  22.  * GNSS antenna model.
  23.  *
  24.  * @author Luc Maisonobe
  25.  * @since 9.2
  26.  * @see <a href="ftp://www.igs.org/pub/station/general/antex14.txt">ANTEX: The Antenna Exchange Format, Version 1.4</a>
  27.  *
  28.  */
  29. public class Antenna {

  30.     /** Type of the antenna. */
  31.     private final String type;

  32.     /** Sinex code. */
  33.     private final String sinexCode;

  34.     /** Frequencies patterns. */
  35.     private final Map<Frequency, FrequencyPattern> patterns;

  36.     /** Simple constructor.
  37.      * @param type antenna type
  38.      * @param sinexCode sinex code
  39.      * @param patterns frequencies patterns
  40.      */
  41.     protected Antenna(final String type, final String sinexCode,
  42.                       final Map<Frequency, FrequencyPattern> patterns) {
  43.         this.type      = type;
  44.         this.sinexCode = sinexCode;
  45.         this.patterns  = patterns;
  46.     }

  47.     /** Get the type of the antenna.
  48.      * @return type of the antenna
  49.      */
  50.     public String getType() {
  51.         return type;
  52.     }

  53.     /** Get the sinex code of the antenna.
  54.      * @return sinex code of the antenna
  55.      */
  56.     public String getSinexCode() {
  57.         return sinexCode;
  58.     }

  59.     /** Get the phase center eccentricities.
  60.      * @param frequency frequency of the signal to consider
  61.      * @return phase center eccentricities (m)
  62.      */
  63.     public Vector3D getEccentricities(final Frequency frequency) {
  64.         return patterns.get(frequency).getEccentricities();
  65.     }

  66.     /** Get the value of the phase center variation in a signal direction.
  67.      * @param frequency frequency of the signal to consider
  68.      * @param direction signal direction in antenna reference frame
  69.      * @return value of the phase center variation (m)
  70.      */
  71.     public double getPhaseCenterVariation(final Frequency frequency, final Vector3D direction) {
  72.         return patterns.get(frequency).getPhaseCenterVariation(direction);
  73.     }

  74. }