PhaseCentersInterSatellitesBaseModifier.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.estimation.measurements.AbstractMeasurement;
  19. import org.orekit.estimation.measurements.EstimatedMeasurementBase;
  20. import org.orekit.estimation.measurements.InterSatellitesRange;
  21. import org.orekit.frames.StaticTransform;
  22. import org.orekit.gnss.antenna.FrequencyPattern;
  23. import org.orekit.propagation.SpacecraftState;
  24. import org.orekit.time.AbsoluteDate;
  25. import org.orekit.utils.TimeStampedPVCoordinates;

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

  32.     /** Uplink offset model. */
  33.     private final PhaseCentersOffsetComputer uplink;

  34.     /** Downlink offset model. */
  35.     private final PhaseCentersOffsetComputer downlink;

  36.     /** Simple constructor.
  37.      * @param pattern1 pattern for satellite 1
  38.      * (i.e. the satellite which receives the signal and performs the measurement)
  39.      * @param pattern2  pattern for satellite 2
  40.      * (i.e. the satellite which simply emits the signal in the one-way
  41.      * case, or reflects the signal in the two-way case)
  42.      */
  43.     public PhaseCentersInterSatellitesBaseModifier(final FrequencyPattern pattern1,
  44.                                                    final FrequencyPattern pattern2) {
  45.         this.uplink   = new PhaseCentersOffsetComputer(pattern1, pattern2);
  46.         this.downlink = new PhaseCentersOffsetComputer(pattern2, pattern1);
  47.     }

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

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

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

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

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

  73.     }

  74.     /** Compute distance modification for two way measurement.
  75.      * @param estimated estimated measurement to modify
  76.      * @return distance modification to add to raw measurement
  77.      */
  78.     public double twoWayDistanceModification(final EstimatedMeasurementBase<InterSatellitesRange> estimated) {

  79.         // the participants are satellite 1 at emission, satellite 2 at transit, satellite 1 at reception
  80.         final TimeStampedPVCoordinates[] participants  = estimated.getParticipants();
  81.         final AbsoluteDate               emissionDate  = participants[0].getDate();
  82.         final AbsoluteDate               transitDate   = participants[1].getDate();
  83.         final AbsoluteDate               receptionDate = participants[2].getDate();

  84.         // transforms from spacecraft to inertial frame at emission/reception dates
  85.         final SpacecraftState refState1                  = estimated.getStates()[0];
  86.         final SpacecraftState receptionState             = refState1.shiftedBy(receptionDate.durationFrom(refState1.getDate()));
  87.         final StaticTransform receptionSpacecraftToInert = receptionState.toStaticTransform().getInverse();
  88.         final SpacecraftState refState2                  = estimated.getStates()[1];
  89.         final SpacecraftState transitState               = refState2.shiftedBy(transitDate.durationFrom(refState2.getDate()));
  90.         final StaticTransform transitSpacecraftToInert   = transitState.toStaticTransform().getInverse();
  91.         final SpacecraftState emissionState              = refState1.shiftedBy(emissionDate.durationFrom(refState1.getDate()));
  92.         final StaticTransform emissionSpacecraftToInert  = emissionState.toStaticTransform().getInverse();

  93.         // compute offsets due to phase centers
  94.         final double uplinkOffset   = uplink.offset(emissionSpacecraftToInert, transitSpacecraftToInert);
  95.         final double downlinkOffset = downlink.offset(transitSpacecraftToInert, receptionSpacecraftToInert);

  96.         return 0.5 * (uplinkOffset + downlinkOffset);

  97.     }

  98. }