KeplerianPropagatorBuilder.java

  1. /* Copyright 2002-2020 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 org.orekit.annotation.DefaultDataContext;
  19. import org.orekit.attitudes.AttitudeProvider;
  20. import org.orekit.data.DataContext;
  21. import org.orekit.orbits.Orbit;
  22. import org.orekit.orbits.PositionAngle;
  23. import org.orekit.propagation.Propagator;
  24. import org.orekit.propagation.analytical.KeplerianPropagator;

  25. /** Builder for Keplerian propagator.
  26.  * @author Pascal Parraud
  27.  * @since 6.0
  28.  */
  29. public class KeplerianPropagatorBuilder extends AbstractPropagatorBuilder {

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

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

  77.     /** {@inheritDoc} */
  78.     public Propagator buildPropagator(final double[] normalizedParameters) {
  79.         setParameters(normalizedParameters);
  80.         return new KeplerianPropagator(createInitialOrbit(), getAttitudeProvider());
  81.     }

  82. }