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;
18  
19  import java.util.List;
20  import java.util.Map;
21  
22  import org.hipparchus.util.FastMath;
23  import org.orekit.bodies.CelestialBody;
24  import org.orekit.bodies.GeodeticPoint;
25  import org.orekit.bodies.OneAxisEllipsoid;
26  import org.orekit.estimation.measurements.GroundStation;
27  import org.orekit.forces.gravity.potential.NormalizedSphericalHarmonicsProvider;
28  import org.orekit.frames.TopocentricFrame;
29  import org.orekit.models.earth.displacement.StationDisplacement;
30  import org.orekit.orbits.PositionAngle;
31  import org.orekit.propagation.analytical.tle.TLE;
32  import org.orekit.propagation.conversion.TLEPropagatorBuilder;
33  import org.orekit.time.TimeScale;
34  import org.orekit.time.UT1Scale;
35  import org.orekit.utils.IERSConventions;
36  
37  public class TLEContext {
38      public IERSConventions                      conventions;
39      public OneAxisEllipsoid                     earth;
40      public CelestialBody                        sun;
41      public CelestialBody                        moon;
42      public NormalizedSphericalHarmonicsProvider gravity;
43      public TimeScale                            utc;
44      public UT1Scale                             ut1;
45      public TLE                                  initialTLE;
46      public StationDisplacement[]                displacements;
47      public List<GroundStation>                  stations;
48      // Stations for turn-around range
49      // Map entry = primary station
50      // Map value = secondary station associated
51      public Map<GroundStation, GroundStation>     TARstations;
52  
53      public TLEPropagatorBuilder createBuilder(final double minStep, final double maxStep, final double dP) {
54  
55          final TLEPropagatorBuilder propagatorBuilder =
56                          new TLEPropagatorBuilder(initialTLE, PositionAngle.MEAN, dP);
57  
58          return propagatorBuilder;
59  
60      }
61  
62      GroundStation createStation(double latitudeInDegrees, double longitudeInDegrees,
63                                  double altitude, String name) {
64          final GeodeticPoint gp = new GeodeticPoint(FastMath.toRadians(latitudeInDegrees),
65                                                     FastMath.toRadians(longitudeInDegrees),
66                                                     altitude);
67          return new GroundStation(new TopocentricFrame(earth, gp, name),
68                                   ut1.getEOPHistory(), displacements);
69      }
70  
71  }