PhaseCentersOneWayGNSSBaseModifier.java

  1. /* Copyright 2022-2025 Thales Alenia Space
  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.orekit.attitudes.AttitudeProvider;
  19. import org.orekit.estimation.measurements.AbstractMeasurement;
  20. import org.orekit.estimation.measurements.EstimatedMeasurementBase;
  21. import org.orekit.frames.StaticTransform;
  22. import org.orekit.gnss.antenna.FrequencyPattern;
  23. import org.orekit.orbits.CartesianOrbit;
  24. import org.orekit.orbits.Orbit;
  25. import org.orekit.propagation.SpacecraftState;
  26. import org.orekit.time.AbsoluteDate;
  27. import org.orekit.utils.TimeStampedPVCoordinates;

  28. /** On-board antenna offset effect on inter-satellites phase measurements.
  29.  * @param <T> type of the measurement
  30.  * @author Luc Maisonobe
  31.  * @since 12.1
  32.  */
  33. public class PhaseCentersOneWayGNSSBaseModifier<T extends AbstractMeasurement<T>> {

  34.     /** Link offset model. */
  35.     private final PhaseCentersOffsetComputer link;

  36.     /** Attitude provider of the emitting satellite. */
  37.     private final AttitudeProvider attitudeProvider;

  38.     /** Simple constructor.
  39.      * @param receiverPattern pattern for receiver satellite
  40.      * @param emitterPattern  pattern for emitter satellite
  41.      * @param attitudeProvider attitude provider of the emitting satellite
  42.      */
  43.     public PhaseCentersOneWayGNSSBaseModifier(final FrequencyPattern receiverPattern,
  44.                                               final FrequencyPattern emitterPattern,
  45.                                               final AttitudeProvider attitudeProvider) {
  46.         this.link             = new PhaseCentersOffsetComputer(emitterPattern, receiverPattern);
  47.         this.attitudeProvider = attitudeProvider;
  48.     }

  49.     /** Get the name of the effect modifying the measurement.
  50.      * @return name of the effect modifying the measurement
  51.      * @since 13.0
  52.      */
  53.     public String getEffectName() {
  54.         return "mean phase center";
  55.     }

  56.     /** Compute distance modification for one way measurement.
  57.      * @param estimated estimated measurement to modify
  58.      * @return distance modification to add to raw measurement
  59.      */
  60.     public double oneWayDistanceModification(final EstimatedMeasurementBase<T> estimated) {

  61.         // The participants are remote satellite at emission, local satellite at reception
  62.         final TimeStampedPVCoordinates[] phaseParticipants  = estimated.getParticipants();
  63.         final AbsoluteDate               phaseEmissionDate  = phaseParticipants[0].getDate();
  64.         final AbsoluteDate               phaseReceptionDate = phaseParticipants[1].getDate();

  65.         // Transforms from spacecraft to inertial frame at reception date
  66.         final SpacecraftState refStateLocal              = estimated.getStates()[0];
  67.         final SpacecraftState receptionState             = refStateLocal.shiftedBy(phaseReceptionDate.durationFrom(refStateLocal.getDate()));
  68.         final StaticTransform receptionSpacecraftToInert = receptionState.toStaticTransform().getInverse();

  69.         // Orbit of the remote satellite
  70.         final Orbit orbitRemote = new CartesianOrbit(phaseParticipants[0], refStateLocal.getFrame(), receptionState.getOrbit().getMu());

  71.         // Transforms from spacecraft to inertial frame at emission date
  72.         final SpacecraftState refStateRemote            = new SpacecraftState(orbitRemote).withAttitude(
  73.                                                                               attitudeProvider.getAttitude(orbitRemote,
  74.                                                                                                            orbitRemote.getDate(),
  75.                                                                                                            orbitRemote.getFrame()));
  76.         final SpacecraftState emissionState             = refStateRemote.shiftedBy(phaseEmissionDate.durationFrom(refStateRemote.getDate()));
  77.         final StaticTransform emissionSpacecraftToInert = emissionState.toStaticTransform().getInverse();

  78.         // compute offset due to phase centers
  79.         return link.offset(emissionSpacecraftToInert, receptionSpacecraftToInert);
  80.     }

  81. }