OnBoardAntennaInterSatellitesPhaseModifier.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.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.EstimatedMeasurementBase;
  22. import org.orekit.estimation.measurements.EstimationModifier;
  23. import org.orekit.estimation.measurements.gnss.InterSatellitesPhase;
  24. import org.orekit.frames.StaticTransform;
  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 inter-satellites phase measurements.
  30.  * @author Bryan Cazabonne
  31.  * @since 10.3
  32.  */
  33. public class OnBoardAntennaInterSatellitesPhaseModifier implements EstimationModifier<InterSatellitesPhase> {

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

  36.     /** Position of the Antenna Phase Center in satellite 2 frame. */
  37.     private final Vector3D antennaPhaseCenter2;

  38.     /** Simple constructor.
  39.      * @param antennaPhaseCenter1 position of the Antenna Phase Center in satellite 1 frame
  40.      * (i.e. the satellite which receives the signal and performs the measurement)
  41.      * @param antennaPhaseCenter2 position of the Antenna Phase Center in satellite 2 frame
  42.      * (i.e. the satellite which simply emits the signal in the one-way
  43.      * case, or reflects the signal in the two-way case)
  44.      */
  45.     public OnBoardAntennaInterSatellitesPhaseModifier(final Vector3D antennaPhaseCenter1,
  46.                                                       final Vector3D antennaPhaseCenter2) {
  47.         this.antennaPhaseCenter1 = antennaPhaseCenter1;
  48.         this.antennaPhaseCenter2 = antennaPhaseCenter2;
  49.     }

  50.     /** {@inheritDoc} */
  51.     @Override
  52.     public List<ParameterDriver> getParametersDrivers() {
  53.         return Collections.emptyList();
  54.     }

  55.     @Override
  56.     public void modifyWithoutDerivatives(final EstimatedMeasurementBase<InterSatellitesPhase> estimated) {

  57.         // The participants are satellite 2 at emission, satellite 1 at reception
  58.         final TimeStampedPVCoordinates[] participants  = estimated.getParticipants();
  59.         final AbsoluteDate               emissionDate  = participants[0].getDate();
  60.         final AbsoluteDate               receptionDate = participants[1].getDate();

  61.         // transforms from spacecraft to inertial frame at emission/reception dates
  62.         final SpacecraftState localState                 = estimated.getStates()[0];
  63.         final SpacecraftState receptionState             = localState.shiftedBy(receptionDate.durationFrom(localState.getDate()));
  64.         final StaticTransform receptionSpacecraftToInert = receptionState.toStaticTransform().getInverse();
  65.         final SpacecraftState remoteState                = estimated.getStates()[1];
  66.         final SpacecraftState emissionState              = remoteState.shiftedBy(emissionDate.durationFrom(remoteState.getDate()));
  67.         final StaticTransform emissionSpacecraftToInert  = emissionState.toStaticTransform().getInverse();

  68.         // Compute the geometrical value of the inter-satellites range directly from participants positions.
  69.         final Vector3D pSpacecraftReception = receptionSpacecraftToInert.transformPosition(Vector3D.ZERO);
  70.         final Vector3D pSpacecraftEmission  = emissionSpacecraftToInert.transformPosition(Vector3D.ZERO);
  71.         final double interSatellitesRangeUsingSpacecraftCenter = Vector3D.distance(pSpacecraftEmission, pSpacecraftReception);

  72.         // Compute the geometrical value of the range replacing
  73.         // The spacecraft positions with antenna phase center positions
  74.         final Vector3D pAPCReception = receptionSpacecraftToInert.transformPosition(antennaPhaseCenter1);
  75.         final Vector3D pAPCEmission  = emissionSpacecraftToInert.transformPosition(antennaPhaseCenter2);
  76.         final double interSatellitesRangeUsingAntennaPhaseCenter = Vector3D.distance(pAPCEmission, pAPCReception);

  77.         // Get the estimated value before this modifier is applied
  78.         final double[] value = estimated.getEstimatedValue();

  79.         // Modify the phase value by applying measurement wavelength
  80.         final double wavelength = estimated.getObservedMeasurement().getWavelength();
  81.         value[0] += (interSatellitesRangeUsingAntennaPhaseCenter - interSatellitesRangeUsingSpacecraftCenter) / wavelength;
  82.         estimated.setEstimatedValue(value);

  83.     }

  84. }