FrequencyPattern.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.gnss.antenna;

  18. import org.hipparchus.geometry.euclidean.threed.Vector3D;
  19. import org.hipparchus.util.FastMath;

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

  29.     /** Phase center eccentricities (m). */
  30.     private final Vector3D eccentricities;

  31.     /** Phase center variation function. */
  32.     private final PhaseCenterVariationFunction phaseCenterVariationFunction;

  33.     /** Simple constructor.
  34.      * @param eccentricities phase center eccentricities (m)
  35.      * @param phaseCenterVariationFunction phase center variation function
  36.      */
  37.     protected FrequencyPattern(final Vector3D eccentricities,
  38.                                final PhaseCenterVariationFunction phaseCenterVariationFunction) {
  39.         this.eccentricities               = eccentricities;
  40.         this.phaseCenterVariationFunction = phaseCenterVariationFunction;
  41.     }

  42.     /** Get the phase center eccentricities.
  43.      * @return phase center eccentricities (m)
  44.      */
  45.     public Vector3D getEccentricities() {
  46.         return eccentricities;
  47.     }

  48.     /** Get the value of the phase center variation in a signal direction.
  49.      * @param direction signal direction in antenna reference frame
  50.      * @return value of the phase center variation
  51.      */
  52.     public double getPhaseCenterVariation(final Vector3D direction) {
  53.         return phaseCenterVariationFunction.value(0.5 * FastMath.PI - direction.getDelta(),
  54.                                                   direction.getAlpha());
  55.     }

  56. }