FrequencyPattern.java

  1. /* Copyright 2002-2024 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.MathUtils;

  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.     /** Pattern with zero correction (i.e. zero eccentricities and no variations).
  30.      * @since 12.0
  31.      */
  32.     public static final FrequencyPattern ZERO_CORRECTION = new FrequencyPattern(Vector3D.ZERO, null);

  33.     /** Phase center eccentricities (m). */
  34.     private final Vector3D eccentricities;

  35.     /** Phase center variation function (may be null if phase center does not depend on signal direction). */
  36.     private final PhaseCenterVariationFunction phaseCenterVariationFunction;

  37.     /** Simple constructor.
  38.      * @param eccentricities phase center eccentricities (m)
  39.      * @param phaseCenterVariationFunction phase center variation function
  40.      * (may be null if phase center does not depend on signal direction)
  41.      */
  42.     public FrequencyPattern(final Vector3D eccentricities,
  43.                             final PhaseCenterVariationFunction phaseCenterVariationFunction) {
  44.         this.eccentricities               = eccentricities;
  45.         this.phaseCenterVariationFunction = phaseCenterVariationFunction;
  46.     }

  47.     /** Get the phase center eccentricities.
  48.      * @return phase center eccentricities (m)
  49.      */
  50.     public Vector3D getEccentricities() {
  51.         return eccentricities;
  52.     }

  53.     /** Get the phase center variation function.
  54.      * @return phase center variation function (may be null if phase center does not depend on signal direction)
  55.      * @since 12.0
  56.      */
  57.     public PhaseCenterVariationFunction getPhaseCenterVariationFunction() {
  58.         return phaseCenterVariationFunction;
  59.     }

  60.     /** Get the value of the phase center variation in a signal direction.
  61.      * @param direction signal direction in antenna reference frame
  62.      * @return value of the phase center variation
  63.      */
  64.     public double getPhaseCenterVariation(final Vector3D direction) {
  65.         if (phaseCenterVariationFunction == null) {
  66.             return 0.0;
  67.         } else {
  68.             return phaseCenterVariationFunction.value(MathUtils.SEMI_PI - direction.getDelta(),
  69.                                                       direction.getAlpha());
  70.         }
  71.     }

  72. }