TLEBatchLSModel.java

  1. /* Copyright 2002-2021 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.Propagator;
  22. import org.orekit.propagation.SpacecraftState;
  23. import org.orekit.propagation.analytical.tle.TLEJacobiansMapper;
  24. import org.orekit.propagation.analytical.tle.TLEPartialDerivativesEquations;
  25. import org.orekit.propagation.analytical.tle.TLEPropagator;
  26. import org.orekit.propagation.conversion.OrbitDeterminationPropagatorBuilder;
  27. import org.orekit.propagation.integration.AbstractJacobiansMapper;
  28. import org.orekit.utils.ParameterDriversList;

  29. /** Bridge between {@link ObservedMeasurement measurements} and {@link
  30.  * org.hipparchus.optim.nonlinear.vector.leastsquares.LeastSquaresProblem
  31.  * least squares problems}.
  32.  * <p>
  33.  * This class is an adaption of the {@link BatchLSModel} class
  34.  * but for the {@link TLEPropagator TLE propagator}.
  35.  * </p>
  36.  * @author Luc Maisonobe
  37.  * @author Bryan Cazabonne
  38.  * @author Thomas Paulet
  39.  * @since 11.0
  40.  *
  41.  */
  42. public class TLEBatchLSModel extends AbstractBatchLSModel {

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

  57.     /** {@inheritDoc} */
  58.     @Override
  59.     protected TLEJacobiansMapper configureDerivatives(final Propagator propagator) {

  60.         final String equationName = TLEBatchLSModel.class.getName() + "-derivatives";

  61.         final TLEPartialDerivativesEquations partials = new TLEPartialDerivativesEquations(equationName, (TLEPropagator) propagator);

  62.         // add the derivatives to the initial state
  63.         final SpacecraftState rawState = propagator.getInitialState();
  64.         final SpacecraftState stateWithDerivatives = partials.setInitialJacobians(rawState);
  65.         propagator.resetInitialState(stateWithDerivatives);

  66.         return partials.getMapper();

  67.     }

  68.     /** {@inheritDoc} */
  69.     @Override
  70.     protected Orbit configureOrbits(final AbstractJacobiansMapper mapper,
  71.                                     final Propagator propagator) {
  72.         // Directly return the propagator's initial state
  73.         return propagator.getInitialState().getOrbit();
  74.     }

  75. }