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

  53.         // The participants are satellite 2 at emission, satellite 1 at reception
  54.         final TimeStampedPVCoordinates[] participants  = estimated.getParticipants();
  55.         final AbsoluteDate               emissionDate  = participants[0].getDate();
  56.         final AbsoluteDate               receptionDate = participants[1].getDate();

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

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

  66.     }

  67.     /** Compute distance modification for two way measurement.
  68.      * @param estimated estimated measurement to modify
  69.      * @return distance modification to add to raw measurement
  70.      */
  71.     public double twoWayDistanceModification(final EstimatedMeasurementBase<InterSatellitesRange> estimated) {

  72.         // the participants are satellite 1 at emission, satellite 2 at transit, satellite 1 at reception
  73.         final TimeStampedPVCoordinates[] participants  = estimated.getParticipants();
  74.         final AbsoluteDate               emissionDate  = participants[0].getDate();
  75.         final AbsoluteDate               transitDate   = participants[1].getDate();
  76.         final AbsoluteDate               receptionDate = participants[2].getDate();

  77.         // transforms from spacecraft to inertial frame at emission/reception dates
  78.         final SpacecraftState refState1                  = estimated.getStates()[0];
  79.         final SpacecraftState receptionState             = refState1.shiftedBy(receptionDate.durationFrom(refState1.getDate()));
  80.         final StaticTransform receptionSpacecraftToInert = receptionState.toStaticTransform().getInverse();
  81.         final SpacecraftState refState2                  = estimated.getStates()[1];
  82.         final SpacecraftState transitState               = refState2.shiftedBy(transitDate.durationFrom(refState2.getDate()));
  83.         final StaticTransform transitSpacecraftToInert   = transitState.toStaticTransform().getInverse();
  84.         final SpacecraftState emissionState              = refState1.shiftedBy(emissionDate.durationFrom(refState1.getDate()));
  85.         final StaticTransform emissionSpacecraftToInert  = emissionState.toStaticTransform().getInverse();

  86.         // compute offsets due to phase centers
  87.         final double uplinkOffset   = uplink.offset(emissionSpacecraftToInert, transitSpacecraftToInert);
  88.         final double downlinkOffset = downlink.offset(transitSpacecraftToInert, receptionSpacecraftToInert);

  89.         return 0.5 * (uplinkOffset + downlinkOffset);

  90.     }

  91. }