OnBoardAntennaTurnAroundRangeModifier.java

  1. /* Copyright 2002-2019 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.estimation.measurements.modifiers;

  18. import java.util.Collections;
  19. import java.util.List;

  20. import org.hipparchus.geometry.euclidean.threed.Vector3D;
  21. import org.orekit.estimation.measurements.EstimatedMeasurement;
  22. import org.orekit.estimation.measurements.EstimationModifier;
  23. import org.orekit.estimation.measurements.TurnAroundRange;
  24. import org.orekit.frames.Transform;
  25. import org.orekit.propagation.SpacecraftState;
  26. import org.orekit.time.AbsoluteDate;
  27. import org.orekit.utils.ParameterDriver;
  28. import org.orekit.utils.TimeStampedPVCoordinates;

  29. /** On-board antenna offset effect on turn around range measurements.
  30.  * @author Luc Maisonobe
  31.  * @since 9.0
  32.  */
  33. public class OnBoardAntennaTurnAroundRangeModifier implements EstimationModifier<TurnAroundRange> {

  34.     /** Position of the Antenna Phase Center in satellite frame. */
  35.     private final Vector3D antennaPhaseCenter;

  36.     /** Simple constructor.
  37.      * @param antennaPhaseCenter position of the Antenna Phase Center in satellite frame
  38.      */
  39.     public OnBoardAntennaTurnAroundRangeModifier(final Vector3D antennaPhaseCenter) {
  40.         this.antennaPhaseCenter = antennaPhaseCenter;
  41.     }

  42.     /** {@inheritDoc} */
  43.     @Override
  44.     public List<ParameterDriver> getParametersDrivers() {
  45.         return Collections.emptyList();
  46.     }

  47.     /** {@inheritDoc} */
  48.     @Override
  49.     public void modify(final EstimatedMeasurement<TurnAroundRange> estimated) {

  50.         // the participants are master station at emission, spacecraft during leg 1,
  51.         // slave station at rebound, spacecraft during leg 2, master station at reception
  52.         final TimeStampedPVCoordinates[] participants     = estimated.getParticipants();
  53.         final Vector3D                   pMasterEmission  = participants[0].getPosition();
  54.         final AbsoluteDate               transitDateLeg1  = participants[1].getDate();
  55.         final Vector3D                   pSlaveRebound    = participants[2].getPosition();
  56.         final AbsoluteDate               transitDateLeg2  = participants[3].getDate();
  57.         final Vector3D                   pMasterReception = participants[4].getPosition();

  58.         // transforms from spacecraft to inertial frame at transit dates
  59.         final SpacecraftState refState              = estimated.getStates()[0];
  60.         final SpacecraftState transitStateLeg1      = refState.shiftedBy(transitDateLeg1.durationFrom(refState.getDate()));
  61.         final Transform       spacecraftToInertLeg1 = transitStateLeg1.toTransform().getInverse();
  62.         final SpacecraftState transitStateLeg2      = refState.shiftedBy(transitDateLeg2.durationFrom(refState.getDate()));
  63.         final Transform       spacecraftToInertLeg2 = transitStateLeg2.toTransform().getInverse();

  64.         // compute the geometrical value of the turn-around range directly from participants positions.
  65.         // Note that this may be different from the value returned by estimated.getEstimatedValue(),
  66.         // because other modifiers may already have been taken into account
  67.         final Vector3D pSpacecraftLeg1 = spacecraftToInertLeg1.transformPosition(Vector3D.ZERO);
  68.         final Vector3D pSpacecraftLeg2 = spacecraftToInertLeg2.transformPosition(Vector3D.ZERO);
  69.         final double turnAroundRangeUsingSpacecraftCenter =
  70.                         0.5 * (Vector3D.distance(pMasterEmission, pSpacecraftLeg1) +
  71.                                Vector3D.distance(pSpacecraftLeg1, pSlaveRebound)   +
  72.                                Vector3D.distance(pSlaveRebound,   pSpacecraftLeg2) +
  73.                                Vector3D.distance(pSpacecraftLeg2, pMasterReception));

  74.         // compute the geometrical value of the range replacing
  75.         // the spacecraft positions with antenna phase center positions
  76.         final Vector3D pAPCLeg1 = spacecraftToInertLeg1.transformPosition(antennaPhaseCenter);
  77.         final Vector3D pAPCLeg2 = spacecraftToInertLeg2.transformPosition(antennaPhaseCenter);
  78.         final double turnAroundRangeUsingAntennaPhaseCenter =
  79.                         0.5 * (Vector3D.distance(pMasterEmission, pAPCLeg1)      +
  80.                                Vector3D.distance(pAPCLeg1,        pSlaveRebound) +
  81.                                Vector3D.distance(pSlaveRebound,   pAPCLeg2)      +
  82.                                Vector3D.distance(pAPCLeg2,        pMasterReception));

  83.         // get the estimated value before this modifier is applied
  84.         final double[] value = estimated.getEstimatedValue();

  85.         // modify the value
  86.         value[0] += turnAroundRangeUsingAntennaPhaseCenter - turnAroundRangeUsingSpacecraftCenter;
  87.         estimated.setEstimatedValue(value);

  88.     }

  89. }