KeplerianPropagatorBuilder.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.propagation.conversion;

  18. import java.util.List;

  19. import org.orekit.attitudes.AttitudeProvider;
  20. import org.orekit.attitudes.InertialProvider;
  21. import org.orekit.estimation.leastsquares.AbstractBatchLSModel;
  22. import org.orekit.estimation.leastsquares.BatchLSModel;
  23. import org.orekit.estimation.leastsquares.ModelObserver;
  24. import org.orekit.estimation.measurements.ObservedMeasurement;
  25. import org.orekit.estimation.sequential.AbstractKalmanModel;
  26. import org.orekit.estimation.sequential.CovarianceMatrixProvider;
  27. import org.orekit.estimation.sequential.KalmanModel;
  28. import org.orekit.orbits.Orbit;
  29. import org.orekit.orbits.PositionAngle;
  30. import org.orekit.propagation.Propagator;
  31. import org.orekit.propagation.analytical.KeplerianPropagator;
  32. import org.orekit.utils.ParameterDriversList;

  33. /** Builder for Keplerian propagator.
  34.  * @author Pascal Parraud
  35.  * @since 6.0
  36.  */
  37. public class KeplerianPropagatorBuilder extends AbstractPropagatorBuilder implements OrbitDeterminationPropagatorBuilder {

  38.     /** Build a new instance.
  39.      * <p>
  40.      * The template orbit is used as a model to {@link
  41.      * #createInitialOrbit() create initial orbit}. It defines the
  42.      * inertial frame, the central attraction coefficient, the orbit type, and is also
  43.      * used together with the {@code positionScale} to convert from the {@link
  44.      * org.orekit.utils.ParameterDriver#setNormalizedValue(double) normalized} parameters used by the
  45.      * callers of this builder to the real orbital parameters.
  46.      * </p>
  47.      *
  48.      * @param templateOrbit reference orbit from which real orbits will be built
  49.      * @param positionAngle position angle type to use
  50.      * @param positionScale scaling factor used for orbital parameters normalization
  51.      * (typically set to the expected standard deviation of the position)
  52.      * @since 8.0
  53.      * @see #KeplerianPropagatorBuilder(Orbit, PositionAngle, double, AttitudeProvider)
  54.      */
  55.     public KeplerianPropagatorBuilder(final Orbit templateOrbit, final PositionAngle positionAngle,
  56.                                       final double positionScale) {
  57.         this(templateOrbit, positionAngle, positionScale,
  58.                 InertialProvider.of(templateOrbit.getFrame()));
  59.     }

  60.     /** Build a new instance.
  61.      * <p>
  62.      * The template orbit is used as a model to {@link
  63.      * #createInitialOrbit() create initial orbit}. It defines the
  64.      * inertial frame, the central attraction coefficient, the orbit type, and is also
  65.      * used together with the {@code positionScale} to convert from the {@link
  66.      * org.orekit.utils.ParameterDriver#setNormalizedValue(double) normalized} parameters used by the
  67.      * callers of this builder to the real orbital parameters.
  68.      * </p>
  69.      * @param templateOrbit reference orbit from which real orbits will be built
  70.      * @param positionAngle position angle type to use
  71.      * @param positionScale scaling factor used for orbital parameters normalization
  72.      * (typically set to the expected standard deviation of the position)
  73.      * @param attitudeProvider attitude law to use.
  74.      * @since 10.1
  75.      */
  76.     public KeplerianPropagatorBuilder(final Orbit templateOrbit,
  77.                                       final PositionAngle positionAngle,
  78.                                       final double positionScale,
  79.                                       final AttitudeProvider attitudeProvider) {
  80.         super(templateOrbit, positionAngle, positionScale, true, attitudeProvider);
  81.     }

  82.     /** {@inheritDoc} */
  83.     public Propagator buildPropagator(final double[] normalizedParameters) {
  84.         setParameters(normalizedParameters);
  85.         return new KeplerianPropagator(createInitialOrbit(), getAttitudeProvider());
  86.     }

  87.     /** {@inheritDoc} */
  88.     @Override
  89.     public AbstractBatchLSModel buildLSModel(final OrbitDeterminationPropagatorBuilder[] builders,
  90.                                              final List<ObservedMeasurement<?>> measurements,
  91.                                              final ParameterDriversList estimatedMeasurementsParameters,
  92.                                              final ModelObserver observer) {
  93.         return new BatchLSModel(builders, measurements, estimatedMeasurementsParameters, observer);
  94.     }

  95.     /** {@inheritDoc} */
  96.     @Override
  97.     public AbstractKalmanModel buildKalmanModel(final List<OrbitDeterminationPropagatorBuilder> propagatorBuilders,
  98.                                                 final List<CovarianceMatrixProvider> covarianceMatricesProviders,
  99.                                                 final ParameterDriversList estimatedMeasurementsParameters,
  100.                                                 final CovarianceMatrixProvider measurementProcessNoiseMatrix) {
  101.         return new KalmanModel(propagatorBuilders, covarianceMatricesProviders, estimatedMeasurementsParameters, measurementProcessNoiseMatrix);
  102.     }

  103. }