PhaseCentersOffsetComputer.java

  1. /* Copyright 2022-2025 Luc Maisonobe
  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.estimation.measurements.modifiers;

  18. import org.hipparchus.geometry.euclidean.threed.Vector3D;
  19. import org.orekit.frames.StaticTransform;
  20. import org.orekit.gnss.antenna.FrequencyPattern;

  21. /** Compute phase centers offset on an emitter-receiver link.
  22.  * @author Luc Maisonobe
  23.  * @since 12.0
  24.  */
  25. public class PhaseCentersOffsetComputer {

  26.     /** Emitter pattern. */
  27.     private final FrequencyPattern emitterPattern;

  28.     /** Receiver pattern. */
  29.     private final FrequencyPattern receiverPattern;

  30.     /** Simple constructor.
  31.      * @param emitterPattern emitter pattern
  32.      * @param receiverPattern receiver pattern
  33.      */
  34.     public PhaseCentersOffsetComputer(final FrequencyPattern emitterPattern,
  35.                                       final FrequencyPattern receiverPattern) {
  36.         this.emitterPattern  = emitterPattern;
  37.         this.receiverPattern = receiverPattern;
  38.     }

  39.     /** Compute distance offset to be added to the distance between antennas reference points.
  40.      * @param emitterToInert transform from emitter to inertial frame at emission date
  41.      * @param receiverToInert transform from receiver to inertial frame at reception date
  42.      * @return offset to be added to distance between origins, in order to get distance between phase centers
  43.      */
  44.     public double offset(final StaticTransform emitterToInert, final StaticTransform receiverToInert) {

  45.         // compute the relative positions of frames origins
  46.         final Vector3D emitterOrigin  = emitterToInert.transformPosition(Vector3D.ZERO);
  47.         final Vector3D receiverOrigin = receiverToInert.transformPosition(Vector3D.ZERO);
  48.         final Vector3D deltaOrigins   = receiverOrigin.subtract(emitterOrigin);

  49.         // compute the relative positions of mean phase centers
  50.         final Vector3D emitterMean    = emitterToInert.transformPosition(emitterPattern.getEccentricities());
  51.         final Vector3D receiverMean   = receiverToInert.transformPosition(receiverPattern.getEccentricities());
  52.         final Vector3D deltaMeans     = receiverMean.subtract(emitterMean);

  53.         // compute the phase variation at emission
  54.         final Vector3D emitterLos = emitterToInert.getRotation().applyInverseTo(deltaMeans);
  55.         final double   emitterPCV = emitterPattern.getPhaseCenterVariation(emitterLos);

  56.         // compute the phase variation at reception
  57.         final Vector3D receiverLos = receiverToInert.getRotation().applyInverseTo(deltaMeans.negate());
  58.         final double   receiverPCV = receiverPattern.getPhaseCenterVariation(receiverLos);

  59.         // compute the total offset resulting from both antennas phase centers
  60.         return deltaMeans.getNorm() - deltaOrigins.getNorm() + emitterPCV + receiverPCV;

  61.     }

  62. }