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  
19  import java.util.List;
20  
21  import org.orekit.estimation.measurements.ObservedMeasurement;
22  import org.orekit.orbits.Orbit;
23  import org.orekit.propagation.MatricesHarvester;
24  import org.orekit.propagation.Propagator;
25  import org.orekit.propagation.SpacecraftState;
26  import org.orekit.propagation.analytical.tle.TLEJacobiansMapper;
27  import org.orekit.propagation.analytical.tle.TLEPropagator;
28  import org.orekit.propagation.conversion.OrbitDeterminationPropagatorBuilder;
29  import org.orekit.utils.ParameterDriversList;
30  
31  /** Bridge between {@link ObservedMeasurement measurements} and {@link
32   * org.hipparchus.optim.nonlinear.vector.leastsquares.LeastSquaresProblem
33   * least squares problems}.
34   * @author Luc Maisonobe
35   * @author Bryan Cazabonne
36   * @author Thomas Paulet
37   * @since 11.0
38   * @deprecated as of 11.1, replaced by {@link BatchLSModel}
39   */
40  @Deprecated
41  public class TLEBatchLSModel extends AbstractBatchLSModel {
42  
43      /** Name of the State Transition Matrix state. */
44      private static final String STM_NAME = TLEBatchLSModel.class.getName() + "-derivatives";
45  
46      /** Simple constructor.
47       * @param propagatorBuilders builders to use for propagation
48       * @param measurements measurements
49       * @param estimatedMeasurementsParameters estimated measurements parameters
50       * @param observer observer to be notified at model calls
51       */
52      public TLEBatchLSModel(final OrbitDeterminationPropagatorBuilder[] propagatorBuilders,
53                             final List<ObservedMeasurement<?>> measurements,
54                             final ParameterDriversList estimatedMeasurementsParameters,
55                             final ModelObserver observer) {
56          // call super constructor
57          super(propagatorBuilders, measurements, estimatedMeasurementsParameters, observer);
58      }
59  
60      /** {@inheritDoc} */
61      @Override
62      protected MatricesHarvester configureHarvester(final Propagator propagator) {
63          return ((TLEPropagator) propagator).setupMatricesComputation(STM_NAME, null, null);
64      }
65  
66      /** {@inheritDoc} */
67      @Override
68      @Deprecated
69      protected TLEJacobiansMapper configureDerivatives(final Propagator propagator) {
70  
71          final org.orekit.propagation.analytical.tle.TLEPartialDerivativesEquations partials =
72                          new org.orekit.propagation.analytical.tle.TLEPartialDerivativesEquations(STM_NAME, (TLEPropagator) propagator);
73  
74          // add the derivatives to the initial state
75          final SpacecraftState rawState = propagator.getInitialState();
76          final SpacecraftState stateWithDerivatives = partials.setInitialJacobians(rawState);
77          propagator.resetInitialState(stateWithDerivatives);
78  
79          return partials.getMapper();
80  
81      }
82  
83      /** {@inheritDoc} */
84      @Override
85      protected Orbit configureOrbits(final MatricesHarvester harvester, final Propagator propagator) {
86          // Directly return the propagator's initial state
87          return propagator.getInitialState().getOrbit();
88      }
89  
90  }