TLEBatchLSModel.java

  1. /* Copyright 2002-2022 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.leastsquares;

  18. import java.util.List;

  19. import org.orekit.estimation.measurements.ObservedMeasurement;
  20. import org.orekit.orbits.Orbit;
  21. import org.orekit.propagation.MatricesHarvester;
  22. import org.orekit.propagation.Propagator;
  23. import org.orekit.propagation.SpacecraftState;
  24. import org.orekit.propagation.analytical.tle.TLEJacobiansMapper;
  25. import org.orekit.propagation.analytical.tle.TLEPropagator;
  26. import org.orekit.propagation.conversion.OrbitDeterminationPropagatorBuilder;
  27. import org.orekit.utils.ParameterDriversList;

  28. /** Bridge between {@link ObservedMeasurement measurements} and {@link
  29.  * org.hipparchus.optim.nonlinear.vector.leastsquares.LeastSquaresProblem
  30.  * least squares problems}.
  31.  * @author Luc Maisonobe
  32.  * @author Bryan Cazabonne
  33.  * @author Thomas Paulet
  34.  * @since 11.0
  35.  * @deprecated as of 11.1, replaced by {@link BatchLSModel}
  36.  */
  37. @Deprecated
  38. public class TLEBatchLSModel extends AbstractBatchLSModel {

  39.     /** Name of the State Transition Matrix state. */
  40.     private static final String STM_NAME = TLEBatchLSModel.class.getName() + "-derivatives";

  41.     /** Simple constructor.
  42.      * @param propagatorBuilders builders to use for propagation
  43.      * @param measurements measurements
  44.      * @param estimatedMeasurementsParameters estimated measurements parameters
  45.      * @param observer observer to be notified at model calls
  46.      */
  47.     public TLEBatchLSModel(final OrbitDeterminationPropagatorBuilder[] propagatorBuilders,
  48.                            final List<ObservedMeasurement<?>> measurements,
  49.                            final ParameterDriversList estimatedMeasurementsParameters,
  50.                            final ModelObserver observer) {
  51.         // call super constructor
  52.         super(propagatorBuilders, measurements, estimatedMeasurementsParameters, observer);
  53.     }

  54.     /** {@inheritDoc} */
  55.     @Override
  56.     protected MatricesHarvester configureHarvester(final Propagator propagator) {
  57.         return ((TLEPropagator) propagator).setupMatricesComputation(STM_NAME, null, null);
  58.     }

  59.     /** {@inheritDoc} */
  60.     @Override
  61.     @Deprecated
  62.     protected TLEJacobiansMapper configureDerivatives(final Propagator propagator) {

  63.         final org.orekit.propagation.analytical.tle.TLEPartialDerivativesEquations partials =
  64.                         new org.orekit.propagation.analytical.tle.TLEPartialDerivativesEquations(STM_NAME, (TLEPropagator) propagator);

  65.         // add the derivatives to the initial state
  66.         final SpacecraftState rawState = propagator.getInitialState();
  67.         final SpacecraftState stateWithDerivatives = partials.setInitialJacobians(rawState);
  68.         propagator.resetInitialState(stateWithDerivatives);

  69.         return partials.getMapper();

  70.     }

  71.     /** {@inheritDoc} */
  72.     @Override
  73.     protected Orbit configureOrbits(final MatricesHarvester harvester, final Propagator propagator) {
  74.         // Directly return the propagator's initial state
  75.         return propagator.getInitialState().getOrbit();
  76.     }

  77. }