KeplerianPropagatorBuilder.java

  1. /* Copyright 2002-2024 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.FrameAlignedProvider;
  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.orbits.Orbit;
  26. import org.orekit.orbits.PositionAngleType;
  27. import org.orekit.propagation.Propagator;
  28. import org.orekit.propagation.analytical.KeplerianPropagator;
  29. import org.orekit.utils.ParameterDriversList;

  30. /** Builder for Keplerian propagator.
  31.  * @author Pascal Parraud
  32.  * @since 6.0
  33.  */
  34. public class KeplerianPropagatorBuilder extends AbstractPropagatorBuilder {

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

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

  80.     /** {@inheritDoc} */
  81.     @Override
  82.     public KeplerianPropagatorBuilder copy() {
  83.         return new KeplerianPropagatorBuilder(createInitialOrbit(), getPositionAngleType(),
  84.                                               getPositionScale(), getAttitudeProvider());
  85.     }

  86.     /** {@inheritDoc} */
  87.     public Propagator buildPropagator(final double[] normalizedParameters) {
  88.         setParameters(normalizedParameters);
  89.         return new KeplerianPropagator(createInitialOrbit(), getAttitudeProvider());
  90.     }

  91.     /** {@inheritDoc} */
  92.     @Override
  93.     public AbstractBatchLSModel buildLeastSquaresModel(final PropagatorBuilder[] builders,
  94.                                                        final List<ObservedMeasurement<?>> measurements,
  95.                                                        final ParameterDriversList estimatedMeasurementsParameters,
  96.                                                        final ModelObserver observer) {
  97.         return new BatchLSModel(builders, measurements, estimatedMeasurementsParameters, observer);
  98.     }

  99. }