PhaseCentersOneWayGNSSBaseModifier.java

  1. /* Copyright 2002-2024 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.     /** Compute distance modification for one way measurement.
  50.      * @param estimated estimated measurement to modify
  51.      * @return distance modification to add to raw measurement
  52.      */
  53.     public double oneWayDistanceModification(final EstimatedMeasurementBase<T> estimated) {

  54.         // The participants are remote satellite at emission, local satellite at reception
  55.         final TimeStampedPVCoordinates[] phaseParticipants  = estimated.getParticipants();
  56.         final AbsoluteDate               phaseEmissionDate  = phaseParticipants[0].getDate();
  57.         final AbsoluteDate               phaseReceptionDate = phaseParticipants[1].getDate();

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

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

  64.         // Transforms from spacecraft to inertial frame at emission date
  65.         final SpacecraftState refStateRemote            = new SpacecraftState(orbitRemote,
  66.                                                                               attitudeProvider.getAttitude(orbitRemote,
  67.                                                                                                            orbitRemote.getDate(),
  68.                                                                                                            orbitRemote.getFrame()));
  69.         final SpacecraftState emissionState             = refStateRemote.shiftedBy(phaseEmissionDate.durationFrom(refStateRemote.getDate()));
  70.         final StaticTransform emissionSpacecraftToInert = emissionState.toStaticTransform().getInverse();

  71.         // compute offset due to phase centers
  72.         return link.offset(emissionSpacecraftToInert, receptionSpacecraftToInert);
  73.     }

  74. }