FramesFactory.java

  1. /* Copyright 2002-2019 CS Systèmes d'Information
  2.  * Licensed to CS Systèmes d'Information (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.frames;

  18. import java.io.Serializable;
  19. import java.util.ArrayList;
  20. import java.util.HashMap;
  21. import java.util.List;
  22. import java.util.Map;
  23. import java.util.SortedSet;
  24. import java.util.TreeSet;

  25. import org.hipparchus.RealFieldElement;
  26. import org.orekit.bodies.CelestialBodyFactory;
  27. import org.orekit.errors.OrekitException;
  28. import org.orekit.errors.OrekitInternalError;
  29. import org.orekit.time.AbsoluteDate;
  30. import org.orekit.time.ChronologicalComparator;
  31. import org.orekit.time.FieldAbsoluteDate;
  32. import org.orekit.utils.AngularDerivativesFilter;
  33. import org.orekit.utils.CartesianDerivativesFilter;
  34. import org.orekit.utils.Constants;
  35. import org.orekit.utils.IERSConventions;
  36. import org.orekit.utils.OrekitConfiguration;


  37. /** Factory for predefined reference frames.
  38.  *
  39.  * <h1> FramesFactory Presentation </h1>
  40.  * <p>
  41.  * Several predefined reference {@link Frame frames} are implemented in OREKIT.
  42.  * They are linked together in a tree with the <i>Geocentric
  43.  * Celestial Reference Frame</i> (GCRF) as the root of the tree.
  44.  * This factory is designed to:
  45.  * </p>
  46.  * <ul>
  47.  *   <li>build the frames tree consistently,</li>
  48.  *   <li>avoid rebuilding some frames that may be costly to recreate all the time,</li>
  49.  *   <li>set up interpolation/caching features for some frames that may induce costly computation</li>
  50.  *   <li>streamline the {@link EOPHistory Earth Orientation Parameters} history loading.</li>
  51.  * </ul>
  52.  * <h2> Reference Frames </h2>
  53.  * <p>
  54.  * The user can retrieve those reference frames using various static methods, the most
  55.  * important ones being: {@link #getFrame(Predefined)}, {@link #getGCRF()},
  56.  * {@link #getCIRF(IERSConventions, boolean)} {@link #getTIRF(IERSConventions, boolean)},
  57.  * {@link #getITRF(IERSConventions, boolean)}, {@link #getITRF(ITRFVersion, IERSConventions, boolean)},
  58.  * {@link #getEME2000()}, {@link #getMOD(IERSConventions)}, {@link #getTOD(IERSConventions, boolean)},
  59.  * {@link #getGTOD(IERSConventions, boolean)}, {@link #getITRFEquinox(IERSConventions, boolean)},
  60.  * {@link #getTEME()} and {@link #getVeis1950()}.
  61.  * </p>
  62.  * <h2> International Terrestrial Reference Frame</h2>
  63.  * <p>
  64.  * This frame is the current (as of 2013) reference realization of
  65.  * the International Terrestrial Reference System produced by IERS.
  66.  * It is described in <a href="ftp://tai.bipm.org/iers/conv2010/tn36.pdf">
  67.  * IERS conventions (2010)</a>. It replaces the Earth Centered Earth Fixed
  68.  * frame which is the reference frame for GPS satellites.
  69.  * </p>
  70.  * <p>
  71.  * This frame is used to define position on solid Earth. It rotates with
  72.  * the Earth and includes the pole motion with respect to Earth crust as
  73.  * provided by IERS {@link EOPHistory Earth Orientation Parameters}.
  74.  * Its pole axis is the IERS Reference Pole (IRP).
  75.  * </p>
  76.  * <p>
  77.  * Depending on the  {@link EOPHistory Earth Orientation Parameters} source,
  78.  * different ITRS realization may be returned by {@link #getITRF(IERSConventions, boolean)},
  79.  * and if EOP are mixed, the ITRF may even jump from one realization to another one.
  80.  * This is not a problem for most users as different ITRS realizations are very close
  81.  * to each other (a few millimeters at Earth surface). If however a specific ITRF version
  82.  * (i.e. an ITRS realization) is needed for very high accuracy, Orekit provides the
  83.  * {@link FramesFactory#getITRF(ITRFVersion, IERSConventions, boolean)} method
  84.  * to get it and take care of jumps in EOP.
  85.  * </p>
  86.  * <p>
  87.  * ITRF can be built using the new non-rotating origin paradigm
  88.  * mandated by IAU 2000 resolution B1.8 and any supported {@link IERSConventions
  89.  * IERS conventions} (even IERS 1996 can be used with non-rotating origin paradigm,
  90.  * despite the resolution was not yet adopted at conventions publication time).
  91.  * </p>
  92.  * <p>
  93.  * ITRF can also be built using the classical equinox paradigm used prior to IAU 2000
  94.  * resolution B1.8 and any supported {@link IERSConventions IERS conventions} (even
  95.  * IERS 2003 and 2010 can be used with equinox paradigm, despite the resolution is
  96.  * in effect now). The choice of paradigm (non-rotating origin or equinox) and the
  97.  * choice of IERS conventions (i.e. the choice of precession/nutation models) can
  98.  * be made independently by user, Orekit provides all alternatives.
  99.  * </p>
  100.  * <h2>Intermediate frames</h2>
  101.  * <p>
  102.  * Orekit also provides all the intermediate frames that are needed to transform
  103.  * between GCRF and ITRF, along the two paths: ITRF/TIRF/CIRF/GCRF for the
  104.  * non-rotating origin paradigm and ITRF/GTOD/TOD/MOD/EME2000/GCRF for the equinox
  105.  * paradigm.
  106.  * </p>
  107.  * <h2> Earth Orientation Parameters </h2>
  108.  * <p>
  109.  * This factory also handles loading of Earth Orientation Parameters (EOP) needed
  110.  * for accurate transformations between inertial and Earth fixed frames, using
  111.  * {@link org.orekit.data.DataProvidersManager} features. EOP are IERS conventions
  112.  * dependent, because they correspond to correction to the precession/nutation
  113.  * models. When EOP should be applied, but EOP data are not available, then a null
  114.  * (0.0) correction is used. This can occur when no EOP data is loaded, or when the
  115.  * requested date is beyond the time span of the loaded EOP data. Using a null
  116.  * correction can result in coarse accuracy. To check the time span covered by EOP data use
  117.  * {@link #getEOPHistory(IERSConventions, boolean)}, {@link EOPHistory#getStartDate()},
  118.  * and {@link EOPHistory#getEndDate()}.
  119.  * <p>
  120.  * For more information on configuring the EOP data Orekit uses see
  121.  * <a href="https://www.orekit.org/forge/projects/orekit/wiki/Configuration">
  122.  * https://www.orekit.org/forge/projects/orekit/wiki/Configuration</a>.
  123.  * <p>
  124.  * Here is a schematic representation of the predefined reference frames tree:
  125.  * </p>
  126.  * <pre>
  127.  *                                                                  GCRF
  128.  *                                                                    |
  129.  *                                                 |-----------------------------------------------
  130.  *                                                 |                         |     Frame bias     |
  131.  *                                                 |                         |                 EME2000
  132.  *                                                 |                         |                    |
  133.  *                                                 |                         | Precession effects |
  134.  *                                                 |                         |                    |
  135.  *           Bias, Precession and Nutation effects |                        MOD                  MOD  (Mean Equator Of Date)
  136.  *                                                 |                         |             w/o EOP corrections
  137.  *                                                 |                         |  Nutation effects  |
  138.  *    (Celestial Intermediate Reference Frame)   CIRF                        |                    |
  139.  *                                                 |                        TOD                  TOD  (True Equator Of Date)
  140.  *                          Earth natural rotation |                         |             w/o EOP corrections
  141.  *                                                 |-------------            |    Sidereal Time   |
  142.  *                                                 |            |            |                    |
  143.  *  (Terrestrial Intermediate Reference Frame)   TIRF         TIRF         GTOD                 GTOD  (Greenwich True Of Date)
  144.  *                                                 |    w/o tidal effects                  w/o EOP corrections
  145.  *                                     Pole motion |            |                                 |
  146.  *                                                 |            |                                 |-------------
  147.  *                                                 |            |                                 |            |
  148.  * (International Terrestrial Reference Frame)   ITRF         ITRF                              ITRF        VEIS1950
  149.  *                                                 |    w/o tidal effects                   equinox-based
  150.  *                                                 |            |
  151.  *                                           other ITRF     other ITRF
  152.  *                                                      w/o tidal effects
  153.  * </pre>
  154.  * <p>
  155.  * This is a utility class, so its constructor is private.
  156.  * </p>
  157.  * @author Guylaine Prat
  158.  * @author Luc Maisonobe
  159.  * @author Pascal Parraud
  160.  */
  161. public class FramesFactory {

  162.     /** Default regular expression for the Rapid Data and Prediction EOP columns files (IAU1980 compatibles). */
  163.     public static final String RAPID_DATA_PREDICTION_COLUMNS_1980_FILENAME = "^finals\\.[^.]*$";

  164.     /** Default regular expression for the Rapid Data and Prediction EOP XML files (IAU1980 compatibles). */
  165.     public static final String RAPID_DATA_PREDICTION_XML_1980_FILENAME = "^finals\\..*\\.xml$";

  166.     /** Default regular expression for the EOPC04 files (IAU1980 compatibles). */
  167.     public static final String EOPC04_1980_FILENAME = "^eopc04_\\d\\d\\.(\\d\\d)$";

  168.     /** Default regular expression for the BulletinB files (IAU1980 compatibles). */
  169.     public static final String BULLETINB_1980_FILENAME = "^bulletinb(_IAU1980)?((-\\d\\d\\d\\.txt)|(\\.\\d\\d\\d))$";

  170.     /** Default regular expression for the Rapid Data and Prediction EOP columns files (IAU2000 compatibles). */
  171.     public static final String RAPID_DATA_PREDICITON_COLUMNS_2000_FILENAME = "^finals2000A\\.[^.]*$";

  172.     /** Default regular expression for the Rapid Data and Prediction EOP XML files (IAU2000 compatibles). */
  173.     public static final String RAPID_DATA_PREDICITON_XML_2000_FILENAME = "^finals2000A\\..*\\.xml$";

  174.     /** Default regular expression for the EOPC04 files (IAU2000 compatibles). */
  175.     public static final String EOPC04_2000_FILENAME = "^eopc04_\\d\\d_IAU2000\\.(\\d\\d)$";

  176.     /** Default regular expression for the BulletinB files (IAU2000 compatibles). */
  177.     public static final String BULLETINB_2000_FILENAME = "^bulletinb(_IAU2000)?((-\\d\\d\\d\\.txt)|(\\.\\d\\d\\d))$";

  178.     /** Default regular expression for the BulletinA files (IAU1980 and IAU2000 compatibles). */
  179.     public static final String BULLETINA_FILENAME = "^bulletina-[ivxlcdm]+-\\d\\d\\d\\.txt$";

  180.     /** Predefined frames. */
  181.     private static transient Map<Predefined, FactoryManagedFrame> FRAMES =
  182.         new HashMap<Predefined, FactoryManagedFrame>();

  183.     /** Predefined versioned ITRF frames. */
  184.     private static transient Map<ITRFKey, VersionedITRF> VERSIONED_ITRF_FRAMES =
  185.         new HashMap<ITRFKey, VersionedITRF>();

  186.     /** Loaders for Earth Orientation parameters. */
  187.     private static final Map<IERSConventions, List<EOPHistoryLoader>> EOP_HISTORY_LOADERS =
  188.         new HashMap<IERSConventions, List<EOPHistoryLoader>>();

  189.     /** Threshold for EOP continuity. */
  190.     private static double EOP_CONTINUITY_THRESHOLD = 5 * Constants.JULIAN_DAY;

  191.     /** Private constructor.
  192.      * <p>This class is a utility class, it should neither have a public
  193.      * nor a default constructor. This private constructor prevents
  194.      * the compiler from generating one automatically.</p>
  195.      */
  196.     private FramesFactory() {
  197.     }

  198.     /** Add the default loaders EOP history (IAU 1980 precession/nutation).
  199.      * <p>
  200.      * The default loaders look for IERS EOP C04 and bulletins B files. They
  201.      * correspond to {@link IERSConventions#IERS_1996 IERS 1996} conventions.
  202.      * </p>
  203.      * @param rapidDataColumnsSupportedNames regular expression for supported
  204.      * rapid data columns EOP files names
  205.      * (may be null if the default IERS file names are used)
  206.      * @param rapidDataXMLSupportedNames regular expression for supported
  207.      * rapid data XML EOP files names
  208.      * (may be null if the default IERS file names are used)
  209.      * @param eopC04SupportedNames regular expression for supported EOP C04 files names
  210.      * (may be null if the default IERS file names are used)
  211.      * @param bulletinBSupportedNames regular expression for supported bulletin B files names
  212.      * (may be null if the default IERS file names are used)
  213.      * @param bulletinASupportedNames regular expression for supported bulletin A files names
  214.      * (may be null if the default IERS file names are used)
  215.      * @see <a href="http://hpiers.obspm.fr/eoppc/eop/eopc04/">IERS EOP C04 files</a>
  216.      * @see #addEOPHistoryLoader(IERSConventions, EOPHistoryLoader)
  217.      * @see #clearEOPHistoryLoaders()
  218.      * @see #addDefaultEOP2000HistoryLoaders(String, String, String, String, String)
  219.      */
  220.     public static void addDefaultEOP1980HistoryLoaders(final String rapidDataColumnsSupportedNames,
  221.                                                        final String rapidDataXMLSupportedNames,
  222.                                                        final String eopC04SupportedNames,
  223.                                                        final String bulletinBSupportedNames,
  224.                                                        final String bulletinASupportedNames) {
  225.         final String rapidColNames =
  226.                 (rapidDataColumnsSupportedNames == null) ?
  227.                 RAPID_DATA_PREDICTION_COLUMNS_1980_FILENAME : rapidDataColumnsSupportedNames;
  228.         addEOPHistoryLoader(IERSConventions.IERS_1996,
  229.                             new RapidDataAndPredictionColumnsLoader(false, rapidColNames));
  230.         final String rapidXmlNames =
  231.                 (rapidDataXMLSupportedNames == null) ?
  232.                 RAPID_DATA_PREDICTION_XML_1980_FILENAME : rapidDataXMLSupportedNames;
  233.         addEOPHistoryLoader(IERSConventions.IERS_1996,
  234.                             new RapidDataAndPredictionXMLLoader(rapidXmlNames));
  235.         final String eopcNames =
  236.                 (eopC04SupportedNames == null) ? EOPC04_1980_FILENAME : eopC04SupportedNames;
  237.         addEOPHistoryLoader(IERSConventions.IERS_1996,
  238.                             new EOPC04FilesLoader(eopcNames));
  239.         final String bulBNames =
  240.                 (bulletinBSupportedNames == null) ? BULLETINB_1980_FILENAME : bulletinBSupportedNames;
  241.         addEOPHistoryLoader(IERSConventions.IERS_1996,
  242.                             new BulletinBFilesLoader(bulBNames));
  243.         final String bulANames =
  244.                     (bulletinASupportedNames == null) ? BULLETINA_FILENAME : bulletinASupportedNames;
  245.         addEOPHistoryLoader(IERSConventions.IERS_1996,
  246.                             new BulletinAFilesLoader(bulANames));
  247.     }

  248.     /** Add the default loaders for EOP history (IAU 2000/2006 precession/nutation).
  249.      * <p>
  250.      * The default loaders look for IERS EOP C04 and bulletins B files. They
  251.      * correspond to both {@link IERSConventions#IERS_2003 IERS 2003} and {@link
  252.      * IERSConventions#IERS_2010 IERS 2010} conventions.
  253.      * </p>
  254.      * @param rapidDataColumnsSupportedNames regular expression for supported
  255.      * rapid data columns EOP files names
  256.      * (may be null if the default IERS file names are used)
  257.      * @param rapidDataXMLSupportedNames regular expression for supported
  258.      * rapid data XML EOP files names
  259.      * (may be null if the default IERS file names are used)
  260.      * @param eopC04SupportedNames regular expression for supported EOP C04 files names
  261.      * (may be null if the default IERS file names are used)
  262.      * @param bulletinBSupportedNames regular expression for supported bulletin B files names
  263.      * (may be null if the default IERS file names are used)
  264.      * @param bulletinASupportedNames regular expression for supported bulletin A files names
  265.      * (may be null if the default IERS file names are used)
  266.      * @see <a href="http://hpiers.obspm.fr/eoppc/eop/eopc04/">IERS EOP C04 files</a>
  267.      * @see #addEOPHistoryLoader(IERSConventions, EOPHistoryLoader)
  268.      * @see #clearEOPHistoryLoaders()
  269.      * @see #addDefaultEOP1980HistoryLoaders(String, String, String, String, String)
  270.      */
  271.     public static void addDefaultEOP2000HistoryLoaders(final String rapidDataColumnsSupportedNames,
  272.                                                        final String rapidDataXMLSupportedNames,
  273.                                                        final String eopC04SupportedNames,
  274.                                                        final String bulletinBSupportedNames,
  275.                                                        final String bulletinASupportedNames) {
  276.         final String rapidColNames =
  277.                 (rapidDataColumnsSupportedNames == null) ?
  278.                 RAPID_DATA_PREDICITON_COLUMNS_2000_FILENAME : rapidDataColumnsSupportedNames;
  279.         addEOPHistoryLoader(IERSConventions.IERS_2003,
  280.                             new RapidDataAndPredictionColumnsLoader(true, rapidColNames));
  281.         addEOPHistoryLoader(IERSConventions.IERS_2010,
  282.                             new RapidDataAndPredictionColumnsLoader(true, rapidColNames));
  283.         final String rapidXmlNames =
  284.             (rapidDataXMLSupportedNames == null) ?
  285.             RAPID_DATA_PREDICITON_XML_2000_FILENAME : rapidDataXMLSupportedNames;
  286.         addEOPHistoryLoader(IERSConventions.IERS_2003,
  287.                             new RapidDataAndPredictionXMLLoader(rapidXmlNames));
  288.         addEOPHistoryLoader(IERSConventions.IERS_2010,
  289.                             new RapidDataAndPredictionXMLLoader(rapidXmlNames));
  290.         final String eopcNames =
  291.             (eopC04SupportedNames == null) ? EOPC04_2000_FILENAME : eopC04SupportedNames;
  292.         addEOPHistoryLoader(IERSConventions.IERS_2003,
  293.                             new EOPC04FilesLoader(eopcNames));
  294.         addEOPHistoryLoader(IERSConventions.IERS_2010,
  295.                             new EOPC04FilesLoader(eopcNames));
  296.         final String bulBNames =
  297.             (bulletinBSupportedNames == null) ? BULLETINB_2000_FILENAME : bulletinBSupportedNames;
  298.         addEOPHistoryLoader(IERSConventions.IERS_2003,
  299.                             new BulletinBFilesLoader(bulBNames));
  300.         addEOPHistoryLoader(IERSConventions.IERS_2010,
  301.                             new BulletinBFilesLoader(bulBNames));
  302.         final String bulANames =
  303.                 (bulletinASupportedNames == null) ? BULLETINA_FILENAME : bulletinASupportedNames;
  304.         addEOPHistoryLoader(IERSConventions.IERS_2003,
  305.                             new BulletinAFilesLoader(bulANames));
  306.         addEOPHistoryLoader(IERSConventions.IERS_2010,
  307.                             new BulletinAFilesLoader(bulANames));
  308.     }

  309.     /** Add a loader for Earth Orientation Parameters history.
  310.      * @param conventions IERS conventions to which EOP history applies
  311.      * @param loader custom loader to add for the EOP history
  312.      * @see #addDefaultEOP1980HistoryLoaders(String, String, String, String, String)
  313.      * @see #clearEOPHistoryLoaders()
  314.      */
  315.     public static void addEOPHistoryLoader(final IERSConventions conventions, final EOPHistoryLoader loader) {
  316.         synchronized (EOP_HISTORY_LOADERS) {
  317.             if (!EOP_HISTORY_LOADERS.containsKey(conventions)) {
  318.                 EOP_HISTORY_LOADERS.put(conventions, new ArrayList<EOPHistoryLoader>());
  319.             }
  320.             EOP_HISTORY_LOADERS.get(conventions).add(loader);
  321.         }
  322.     }

  323.     /** Clear loaders for Earth Orientation Parameters history.
  324.      * @see #addEOPHistoryLoader(IERSConventions, EOPHistoryLoader)
  325.      * @see #addDefaultEOP1980HistoryLoaders(String, String, String, String, String)
  326.      */
  327.     public static void clearEOPHistoryLoaders() {
  328.         synchronized (EOP_HISTORY_LOADERS) {
  329.             EOP_HISTORY_LOADERS.clear();
  330.         }
  331.     }

  332.     /** Set the threshold to check EOP continuity.
  333.      * <p>
  334.      * The default threshold (used if this method is never called)
  335.      * is 5 Julian days. If after loading EOP entries some holes
  336.      * between entries exceed this threshold, an exception will
  337.      * be triggered.
  338.      * </p>
  339.      * <p>
  340.      * One case when calling this method is really useful is for
  341.      * applications that use a single Bulletin A, as these bulletins
  342.      * have a roughly one month wide hole for the first bulletin of
  343.      * each month, which contains older final data in addition to the
  344.      * rapid data and the predicted data.
  345.      * </p>
  346.      * @param threshold threshold to use for checking EOP continuity (in seconds)
  347.      */
  348.     public static void setEOPContinuityThreshold(final double threshold) {
  349.         EOP_CONTINUITY_THRESHOLD = threshold;
  350.     }

  351.     /** Get Earth Orientation Parameters history.
  352.      * <p>
  353.      * If no {@link EOPHistoryLoader} has been added by calling {@link
  354.      * #addEOPHistoryLoader(IERSConventions, EOPHistoryLoader) addEOPHistoryLoader}
  355.      * or if {@link #clearEOPHistoryLoaders() clearEOPHistoryLoaders} has been
  356.      * called afterwards, the {@link #addDefaultEOP1980HistoryLoaders(String, String,
  357.      * String, String, String)} and {@link #addDefaultEOP2000HistoryLoaders(String,
  358.      * String, String, String, String)} methods will be called automatically with
  359.      * supported file names parameters all set to null, in order to get the default
  360.      * loaders configuration.
  361.      * </p>
  362.      * @param conventions conventions for which EOP history is requested
  363.      * @param simpleEOP if true, tidal effects are ignored when interpolating EOP
  364.      * @return Earth Orientation Parameters history
  365.      */
  366.     public static EOPHistory getEOPHistory(final IERSConventions conventions, final boolean simpleEOP) {

  367.         synchronized (EOP_HISTORY_LOADERS) {

  368.             if (EOP_HISTORY_LOADERS.isEmpty()) {
  369.                 // set up using default loaders
  370.                 addDefaultEOP2000HistoryLoaders(null, null, null, null, null);
  371.                 addDefaultEOP1980HistoryLoaders(null, null, null, null, null);
  372.             }

  373.             // TimeStamped based set needed to remove duplicates
  374.             OrekitException pendingException = null;
  375.             final SortedSet<EOPEntry> data = new TreeSet<EOPEntry>(new ChronologicalComparator());

  376.             // try to load canonical data if available
  377.             if (EOP_HISTORY_LOADERS.containsKey(conventions)) {
  378.                 for (final EOPHistoryLoader loader : EOP_HISTORY_LOADERS.get(conventions)) {
  379.                     try {
  380.                         loader.fillHistory(conventions.getNutationCorrectionConverter(), data);
  381.                     } catch (OrekitException oe) {
  382.                         pendingException = oe;
  383.                     }
  384.                 }
  385.             }

  386.             if (data.isEmpty() && pendingException != null) {
  387.                 throw pendingException;
  388.             }

  389.             final EOPHistory history = new EOPHistory(conventions, data, simpleEOP);
  390.             history.checkEOPContinuity(EOP_CONTINUITY_THRESHOLD);
  391.             return history;

  392.         }

  393.     }

  394.     /** Get one of the predefined frames.
  395.      * @param factoryKey key of the frame within the factory
  396.      * @return the predefined frame
  397.      */
  398.     public static Frame getFrame(final Predefined factoryKey) {
  399.         switch (factoryKey) {
  400.             case GCRF :
  401.                 return getGCRF();
  402.             case ICRF :
  403.                 return getICRF();
  404.             case ECLIPTIC_CONVENTIONS_1996 :
  405.                 return getEcliptic(IERSConventions.IERS_1996);
  406.             case ECLIPTIC_CONVENTIONS_2003 :
  407.                 return getEcliptic(IERSConventions.IERS_2003);
  408.             case ECLIPTIC_CONVENTIONS_2010 :
  409.                 return getEcliptic(IERSConventions.IERS_2010);
  410.             case EME2000 :
  411.                 return getEME2000();
  412.             case ITRF_CIO_CONV_2010_SIMPLE_EOP :
  413.                 return getITRF(IERSConventions.IERS_2010, true);
  414.             case ITRF_CIO_CONV_2010_ACCURATE_EOP :
  415.                 return getITRF(IERSConventions.IERS_2010, false);
  416.             case ITRF_CIO_CONV_2003_SIMPLE_EOP :
  417.                 return getITRF(IERSConventions.IERS_2003, true);
  418.             case ITRF_CIO_CONV_2003_ACCURATE_EOP :
  419.                 return getITRF(IERSConventions.IERS_2003, false);
  420.             case ITRF_CIO_CONV_1996_SIMPLE_EOP :
  421.                 return getITRF(IERSConventions.IERS_1996, true);
  422.             case ITRF_CIO_CONV_1996_ACCURATE_EOP :
  423.                 return getITRF(IERSConventions.IERS_1996, false);
  424.             case ITRF_EQUINOX_CONV_2010_SIMPLE_EOP :
  425.                 return getITRFEquinox(IERSConventions.IERS_2010, true);
  426.             case ITRF_EQUINOX_CONV_2010_ACCURATE_EOP :
  427.                 return getITRFEquinox(IERSConventions.IERS_2010, false);
  428.             case ITRF_EQUINOX_CONV_2003_SIMPLE_EOP :
  429.                 return getITRFEquinox(IERSConventions.IERS_2003, true);
  430.             case ITRF_EQUINOX_CONV_2003_ACCURATE_EOP :
  431.                 return getITRFEquinox(IERSConventions.IERS_2003, false);
  432.             case ITRF_EQUINOX_CONV_1996_SIMPLE_EOP :
  433.                 return getITRFEquinox(IERSConventions.IERS_1996, true);
  434.             case ITRF_EQUINOX_CONV_1996_ACCURATE_EOP :
  435.                 return getITRFEquinox(IERSConventions.IERS_1996, false);
  436.             case TIRF_CONVENTIONS_2010_SIMPLE_EOP :
  437.                 return getTIRF(IERSConventions.IERS_2010, true);
  438.             case TIRF_CONVENTIONS_2010_ACCURATE_EOP :
  439.                 return getTIRF(IERSConventions.IERS_2010, false);
  440.             case TIRF_CONVENTIONS_2003_SIMPLE_EOP :
  441.                 return getTIRF(IERSConventions.IERS_2003, true);
  442.             case TIRF_CONVENTIONS_2003_ACCURATE_EOP :
  443.                 return getTIRF(IERSConventions.IERS_2003, false);
  444.             case TIRF_CONVENTIONS_1996_SIMPLE_EOP :
  445.                 return getTIRF(IERSConventions.IERS_1996, true);
  446.             case TIRF_CONVENTIONS_1996_ACCURATE_EOP :
  447.                 return getTIRF(IERSConventions.IERS_1996, false);
  448.             case CIRF_CONVENTIONS_2010_ACCURATE_EOP :
  449.                 return getCIRF(IERSConventions.IERS_2010, false);
  450.             case CIRF_CONVENTIONS_2010_SIMPLE_EOP :
  451.                 return getCIRF(IERSConventions.IERS_2010, true);
  452.             case CIRF_CONVENTIONS_2003_ACCURATE_EOP :
  453.                 return getCIRF(IERSConventions.IERS_2003, false);
  454.             case CIRF_CONVENTIONS_2003_SIMPLE_EOP :
  455.                 return getCIRF(IERSConventions.IERS_2003, true);
  456.             case CIRF_CONVENTIONS_1996_ACCURATE_EOP :
  457.                 return getCIRF(IERSConventions.IERS_1996, false);
  458.             case CIRF_CONVENTIONS_1996_SIMPLE_EOP :
  459.                 return getCIRF(IERSConventions.IERS_1996, true);
  460.             case VEIS_1950 :
  461.                 return getVeis1950();
  462.             case GTOD_WITHOUT_EOP_CORRECTIONS :
  463.                 return getGTOD(IERSConventions.IERS_1996, false, true);
  464.             case GTOD_CONVENTIONS_2010_ACCURATE_EOP :
  465.                 return getGTOD(IERSConventions.IERS_2010, true, false);
  466.             case GTOD_CONVENTIONS_2010_SIMPLE_EOP :
  467.                 return getGTOD(IERSConventions.IERS_2010, true, true);
  468.             case GTOD_CONVENTIONS_2003_ACCURATE_EOP :
  469.                 return getGTOD(IERSConventions.IERS_2003, true, false);
  470.             case GTOD_CONVENTIONS_2003_SIMPLE_EOP :
  471.                 return getGTOD(IERSConventions.IERS_2003, true, true);
  472.             case GTOD_CONVENTIONS_1996_ACCURATE_EOP :
  473.                 return getGTOD(IERSConventions.IERS_1996, true, false);
  474.             case GTOD_CONVENTIONS_1996_SIMPLE_EOP :
  475.                 return getGTOD(IERSConventions.IERS_1996, true, true);
  476.             case TOD_WITHOUT_EOP_CORRECTIONS :
  477.                 return getTOD(IERSConventions.IERS_1996, false, true);
  478.             case TOD_CONVENTIONS_2010_ACCURATE_EOP :
  479.                 return getTOD(IERSConventions.IERS_2010, true, false);
  480.             case TOD_CONVENTIONS_2010_SIMPLE_EOP :
  481.                 return getTOD(IERSConventions.IERS_2010, true, true);
  482.             case TOD_CONVENTIONS_2003_ACCURATE_EOP :
  483.                 return getTOD(IERSConventions.IERS_2003, true, false);
  484.             case TOD_CONVENTIONS_2003_SIMPLE_EOP :
  485.                 return getTOD(IERSConventions.IERS_2003, true, true);
  486.             case TOD_CONVENTIONS_1996_ACCURATE_EOP :
  487.                 return getTOD(IERSConventions.IERS_1996, true, false);
  488.             case TOD_CONVENTIONS_1996_SIMPLE_EOP :
  489.                 return getTOD(IERSConventions.IERS_1996, true, true);
  490.             case MOD_WITHOUT_EOP_CORRECTIONS :
  491.                 return getMOD(IERSConventions.IERS_1996, false);
  492.             case MOD_CONVENTIONS_2010 :
  493.                 return getMOD(IERSConventions.IERS_2010, true);
  494.             case MOD_CONVENTIONS_2003 :
  495.                 return getMOD(IERSConventions.IERS_2003, true);
  496.             case MOD_CONVENTIONS_1996 :
  497.                 return getMOD(IERSConventions.IERS_1996, true);
  498.             case TEME :
  499.                 return getTEME();
  500.             default :
  501.                 // this should never happen
  502.                 throw new OrekitInternalError(null);
  503.         }
  504.     }

  505.     /** Get the unique GCRF frame.
  506.      * <p>The GCRF frame is the root frame in the frame tree.</p>
  507.      * @return the unique instance of the GCRF frame
  508.      */
  509.     public static Frame getGCRF() {
  510.         return Frame.getRoot();
  511.     }

  512.     /** Get the unique ICRF frame.
  513.      * <p>The ICRF frame is centered at solar system barycenter and aligned
  514.      * with GCRF.</p>
  515.      * @return the unique instance of the ICRF frame
  516.      */
  517.     public static Frame getICRF() {
  518.         return CelestialBodyFactory.getSolarSystemBarycenter().getInertiallyOrientedFrame();
  519.     }

  520.     /** Get the ecliptic frame.
  521.      * The IAU defines the ecliptic as "the plane perpendicular to the mean heliocentric
  522.      * orbital angular momentum vector of the Earth-Moon barycentre in the BCRS (IAU 2006
  523.      * Resolution B1)." The +z axis is aligned with the angular momentum vector, and the +x
  524.      * axis is aligned with +x axis of {@link FramesFactory#getMOD(IERSConventions) MOD}.
  525.      *
  526.      * <p> This implementation agrees with the JPL 406 ephemerides to within 0.5 arc seconds.
  527.      * @param conventions IERS conventions to apply
  528.      * @return the selected reference frame singleton.
  529.      */
  530.     public static Frame getEcliptic(final IERSConventions conventions) {
  531.         synchronized (FramesFactory.class) {

  532.             final Predefined factoryKey;
  533.             switch (conventions) {
  534.                 case IERS_1996 :
  535.                     factoryKey = Predefined.ECLIPTIC_CONVENTIONS_1996;
  536.                     break;
  537.                 case IERS_2003 :
  538.                     factoryKey = Predefined.ECLIPTIC_CONVENTIONS_2003;
  539.                     break;
  540.                 case IERS_2010 :
  541.                     factoryKey = Predefined.ECLIPTIC_CONVENTIONS_2010;
  542.                     break;
  543.                 default :
  544.                     // this should never happen
  545.                     throw new OrekitInternalError(null);
  546.             }
  547.             final Frame parent = getMOD(conventions);

  548.             // try to find an already built frame
  549.             FactoryManagedFrame frame = FRAMES.get(factoryKey);

  550.             if (frame == null) {
  551.                 // it's the first time we need this frame, build it and store it
  552.                 frame = new FactoryManagedFrame(parent, new EclipticProvider(conventions),
  553.                                                 true, factoryKey);
  554.                 FRAMES.put(factoryKey, frame);
  555.             }

  556.             return frame;

  557.         }
  558.     }

  559.     /** Get the unique EME2000 frame.
  560.      * <p>The EME2000 frame is also called the J2000 frame.
  561.      * The former denomination is preferred in Orekit.</p>
  562.      * @return the unique instance of the EME2000 frame
  563.      */
  564.     public static FactoryManagedFrame getEME2000() {
  565.         synchronized (FramesFactory.class) {

  566.             // try to find an already built frame
  567.             FactoryManagedFrame frame = FRAMES.get(Predefined.EME2000);

  568.             if (frame == null) {
  569.                 // it's the first time we need this frame, build it and store it
  570.                 frame = new FactoryManagedFrame(getGCRF(), new EME2000Provider(), true, Predefined.EME2000);
  571.                 FRAMES.put(Predefined.EME2000, frame);
  572.             }

  573.             return frame;

  574.         }
  575.     }

  576.     /** Get an unspecified International Terrestrial Reference Frame.
  577.      * <p>
  578.      * The frame returned uses the {@link EOPEntry Earth Orientation Parameters}
  579.      * blindly. So if for example one loads only EOP 14 C04 files to retrieve
  580.      * the parameters, the frame will be an {@link ITRFVersion#ITRF_2014}. However,
  581.      * if parameters are loaded from different files types, or even for file
  582.      * types that changed their reference (like Bulletin A switching from
  583.      * {@link ITRFVersion#ITRF_2008} to {@link ITRFVersion#ITRF_2014} starting
  584.      * with Vol. XXXI No. 013 published on 2018-03-29), then the ITRF returned
  585.      * by this method will jump from one version to another version.
  586.      * </p>
  587.      * <p>
  588.      * IF a specific version of ITRF is needed, then {@link #getITRF(ITRFVersion,
  589.      * IERSConventions, boolean)} should be used instead.
  590.      * </p>
  591.      * @param conventions IERS conventions to apply
  592.      * @param simpleEOP if true, tidal effects are ignored when interpolating EOP
  593.      * @return the selected reference frame singleton.
  594.           * @see #getITRF(ITRFVersion, IERSConventions, boolean)
  595.      * @since 6.1
  596.      */
  597.     public static FactoryManagedFrame getITRF(final IERSConventions conventions,
  598.                                               final boolean simpleEOP) {
  599.         synchronized (FramesFactory.class) {

  600.             // try to find an already built frame
  601.             final Predefined factoryKey;
  602.             switch (conventions) {
  603.                 case IERS_1996 :
  604.                     factoryKey = simpleEOP ?
  605.                                  Predefined.ITRF_CIO_CONV_1996_SIMPLE_EOP :
  606.                                  Predefined.ITRF_CIO_CONV_1996_ACCURATE_EOP;
  607.                     break;
  608.                 case IERS_2003 :
  609.                     factoryKey = simpleEOP ?
  610.                                  Predefined.ITRF_CIO_CONV_2003_SIMPLE_EOP :
  611.                                  Predefined.ITRF_CIO_CONV_2003_ACCURATE_EOP;
  612.                     break;
  613.                 case IERS_2010 :
  614.                     factoryKey = simpleEOP ?
  615.                                  Predefined.ITRF_CIO_CONV_2010_SIMPLE_EOP :
  616.                                  Predefined.ITRF_CIO_CONV_2010_ACCURATE_EOP;
  617.                     break;
  618.                 default :
  619.                     // this should never happen
  620.                     throw new OrekitInternalError(null);
  621.             }
  622.             FactoryManagedFrame frame = FRAMES.get(factoryKey);

  623.             if (frame == null) {
  624.                 // it's the first time we need this frame, build it and store it
  625.                 final Frame tirfFrame = getTIRF(conventions, simpleEOP);
  626.                 final TIRFProvider tirfProvider = (TIRFProvider) tirfFrame.getTransformProvider();
  627.                 frame = new FactoryManagedFrame(tirfFrame,
  628.                                                 new ITRFProvider(tirfProvider.getEOPHistory()),
  629.                                                 false, factoryKey);
  630.                 FRAMES.put(factoryKey, frame);
  631.             }

  632.             return frame;

  633.         }
  634.     }

  635.     /** Get the TIRF reference frame, ignoring tidal effects.
  636.      * @param conventions IERS conventions to apply
  637.      * @return the selected reference frame singleton.
  638.           * library cannot be read.
  639.      */
  640.     public static FactoryManagedFrame getTIRF(final IERSConventions conventions) {
  641.         return getTIRF(conventions, true);
  642.     }

  643.     /** Get an specific International Terrestrial Reference Frame.
  644.      * <p>
  645.      * Note that if a specific version of ITRF is required, then {@code simpleEOP}
  646.      * should most probably be set to {@code false}, as ignoring tidal effects
  647.      * has an effect of the same order of magnitude as the differences between
  648.      * the various {@link ITRFVersion ITRF versions}.
  649.      * </p>
  650.      * @param version ITRF version
  651.      * @param conventions IERS conventions to apply
  652.      * @param simpleEOP if true, tidal effects are ignored when interpolating EOP
  653.      * @return the selected reference frame singleton.
  654.           * @since 9.2
  655.      */
  656.     public static VersionedITRF getITRF(final ITRFVersion version,
  657.                                         final IERSConventions conventions,
  658.                                         final boolean simpleEOP) {
  659.         synchronized (FramesFactory.class) {
  660.             // try to find an already built frame
  661.             final ITRFKey key = new ITRFKey(version, conventions, simpleEOP);
  662.             VersionedITRF frame = VERSIONED_ITRF_FRAMES.get(key);

  663.             if (frame == null) {
  664.                 // it's the first time we need this frame, build it and store it
  665.                 final FactoryManagedFrame rawITRF = getITRF(conventions, simpleEOP);
  666.                 frame = new VersionedITRF(rawITRF.getParent(), version,
  667.                                           (ITRFProvider) rawITRF.getTransformProvider(),
  668.                                           version.toString().replace('_', '-') +
  669.                                           "/" +
  670.                                           rawITRF.getName());
  671.                 VERSIONED_ITRF_FRAMES.put(key, frame);
  672.             }

  673.             return frame;

  674.         }
  675.     }

  676.     /** Get the TIRF reference frame.
  677.      * @param conventions IERS conventions to apply
  678.      * @param simpleEOP if true, tidal effects are ignored when interpolating EOP
  679.      * @return the selected reference frame singleton.
  680.      * @since 6.1
  681.      */
  682.     public static FactoryManagedFrame getTIRF(final IERSConventions conventions,
  683.                                               final boolean simpleEOP) {
  684.         synchronized (FramesFactory.class) {

  685.             // try to find an already built frame
  686.             final Predefined factoryKey;
  687.             switch (conventions) {
  688.                 case IERS_1996 :
  689.                     factoryKey = simpleEOP ?
  690.                                  Predefined.TIRF_CONVENTIONS_1996_SIMPLE_EOP :
  691.                                  Predefined.TIRF_CONVENTIONS_1996_ACCURATE_EOP;
  692.                     break;
  693.                 case IERS_2003 :
  694.                     factoryKey = simpleEOP ?
  695.                                  Predefined.TIRF_CONVENTIONS_2003_SIMPLE_EOP :
  696.                                  Predefined.TIRF_CONVENTIONS_2003_ACCURATE_EOP;
  697.                     break;
  698.                 case IERS_2010 :
  699.                     factoryKey = simpleEOP ?
  700.                                  Predefined.TIRF_CONVENTIONS_2010_SIMPLE_EOP :
  701.                                  Predefined.TIRF_CONVENTIONS_2010_ACCURATE_EOP;
  702.                     break;
  703.                 default :
  704.                     // this should never happen
  705.                     throw new OrekitInternalError(null);
  706.             }
  707.             FactoryManagedFrame frame = FRAMES.get(factoryKey);

  708.             if (frame == null) {
  709.                 // it's the first time we need this frame, build it and store it
  710.                 final Frame cirf = getCIRF(conventions, simpleEOP);
  711.                 final ShiftingTransformProvider cirfInterpolating =
  712.                         (ShiftingTransformProvider) cirf.getTransformProvider();
  713.                 final CIRFProvider cirfRaw = (CIRFProvider) cirfInterpolating.getRawProvider();
  714.                 final EOPHistory eopHistory = cirfRaw.getEOPHistory();
  715.                 frame = new FactoryManagedFrame(cirf, new TIRFProvider(eopHistory), false, factoryKey);
  716.                 FRAMES.put(factoryKey, frame);
  717.             }

  718.             return frame;

  719.         }
  720.     }

  721.     /** Get the CIRF2000 reference frame.
  722.      * @param conventions IERS conventions to apply
  723.      * @param simpleEOP if true, tidal effects are ignored when interpolating EOP
  724.      * @return the selected reference frame singleton.
  725.      */
  726.     public static FactoryManagedFrame getCIRF(final IERSConventions conventions,
  727.                                               final boolean simpleEOP) {
  728.         synchronized (FramesFactory.class) {

  729.             // try to find an already built frame
  730.             final Predefined factoryKey;
  731.             switch (conventions) {
  732.                 case IERS_1996 :
  733.                     factoryKey = simpleEOP ?
  734.                                  Predefined.CIRF_CONVENTIONS_1996_SIMPLE_EOP :
  735.                                  Predefined.CIRF_CONVENTIONS_1996_ACCURATE_EOP;
  736.                     break;
  737.                 case IERS_2003 :
  738.                     factoryKey = simpleEOP ?
  739.                                  Predefined.CIRF_CONVENTIONS_2003_SIMPLE_EOP :
  740.                                  Predefined.CIRF_CONVENTIONS_2003_ACCURATE_EOP;
  741.                     break;
  742.                 case IERS_2010 :
  743.                     factoryKey = simpleEOP ?
  744.                                  Predefined.CIRF_CONVENTIONS_2010_SIMPLE_EOP :
  745.                                  Predefined.CIRF_CONVENTIONS_2010_ACCURATE_EOP;
  746.                     break;
  747.                 default :
  748.                     // this should never happen
  749.                     throw new OrekitInternalError(null);
  750.             }
  751.             FactoryManagedFrame frame = FRAMES.get(factoryKey);

  752.             if (frame == null) {
  753.                 // it's the first time we need this frame, build it and store it
  754.                 final EOPHistory eopHistory = FramesFactory.getEOPHistory(conventions, simpleEOP);
  755.                 final TransformProvider shifting =
  756.                         new ShiftingTransformProvider(new CIRFProvider(eopHistory),
  757.                                                       CartesianDerivativesFilter.USE_PVA,
  758.                                                       AngularDerivativesFilter.USE_R,
  759.                                                       6, Constants.JULIAN_DAY / 24,
  760.                                                       OrekitConfiguration.getCacheSlotsNumber(),
  761.                                                       Constants.JULIAN_YEAR, 30 * Constants.JULIAN_DAY);
  762.                 frame = new FactoryManagedFrame(getGCRF(), shifting, true, factoryKey);
  763.                 FRAMES.put(factoryKey, frame);
  764.             }

  765.             return frame;

  766.         }
  767.     }

  768.     /** Get the VEIS 1950 reference frame.
  769.      * <p>Its parent frame is the GTOD frame with IERS 1996 conventions without EOP corrections.<p>
  770.      * @return the selected reference frame singleton.
  771.      */
  772.     public static FactoryManagedFrame getVeis1950() {
  773.         synchronized (FramesFactory.class) {

  774.             // try to find an already built frame
  775.             final Predefined factoryKey = Predefined.VEIS_1950;
  776.             FactoryManagedFrame frame = FRAMES.get(factoryKey);

  777.             if (frame == null) {
  778.                 // it's the first time we need this frame, build it and store it
  779.                 frame = new FactoryManagedFrame(FramesFactory.getGTOD(IERSConventions.IERS_1996, false, true),
  780.                                                 new VEISProvider(), true, factoryKey);
  781.                 FRAMES.put(factoryKey, frame);
  782.             }

  783.             return frame;

  784.         }
  785.     }

  786.     /** Get the equinox-based ITRF reference frame.
  787.      * @param conventions IERS conventions to apply
  788.      * @param simpleEOP if true, tidal effects are ignored when interpolating EOP
  789.      * @return the selected reference frame singleton.
  790.           * @since 6.1
  791.      */
  792.     public static FactoryManagedFrame getITRFEquinox(final IERSConventions conventions,
  793.                                                      final boolean simpleEOP) {
  794.         synchronized (FramesFactory.class) {

  795.             // try to find an already built frame
  796.             final Predefined factoryKey;
  797.             switch (conventions) {
  798.                 case IERS_1996 :
  799.                     factoryKey = simpleEOP ?
  800.                                  Predefined.ITRF_EQUINOX_CONV_1996_SIMPLE_EOP :
  801.                                  Predefined.ITRF_EQUINOX_CONV_1996_ACCURATE_EOP;
  802.                     break;
  803.                 case IERS_2003 :
  804.                     factoryKey = simpleEOP ?
  805.                                  Predefined.ITRF_EQUINOX_CONV_2003_SIMPLE_EOP :
  806.                                  Predefined.ITRF_EQUINOX_CONV_2003_ACCURATE_EOP;
  807.                     break;
  808.                 case IERS_2010 :
  809.                     factoryKey = simpleEOP ?
  810.                                  Predefined.ITRF_EQUINOX_CONV_2010_SIMPLE_EOP :
  811.                                  Predefined.ITRF_EQUINOX_CONV_2010_ACCURATE_EOP;
  812.                     break;
  813.                 default :
  814.                     // this should never happen
  815.                     throw new OrekitInternalError(null);
  816.             }
  817.             FactoryManagedFrame frame = FRAMES.get(factoryKey);

  818.             if (frame == null) {
  819.                 // it's the first time we need this frame, build it and store it
  820.                 final Frame gtod = getGTOD(conventions, true, simpleEOP);
  821.                 final ShiftingTransformProvider gtodShifting =
  822.                         (ShiftingTransformProvider) gtod.getTransformProvider();
  823.                 final GTODProvider gtodRaw    = (GTODProvider) gtodShifting.getRawProvider();
  824.                 final EOPHistory   eopHistory = gtodRaw.getEOPHistory();
  825.                 frame = new FactoryManagedFrame(gtod, new ITRFProvider(eopHistory), false, factoryKey);
  826.                 FRAMES.put(factoryKey, frame);
  827.             }

  828.             return frame;

  829.         }
  830.     }

  831.     /** Get the GTOD reference frame.
  832.      * <p>
  833.      * The applyEOPCorr parameter is available mainly for testing purposes or for
  834.      * consistency with legacy software that don't handle EOP correction parameters.
  835.      * Beware that setting this parameter to {@code false} leads to crude accuracy
  836.      * (order of magnitudes for errors might be above 250m in LEO and 1400m in GEO).
  837.      * For this reason, setting this parameter to false is restricted to {@link
  838.      * IERSConventions#IERS_1996 IERS 1996} conventions, and hence the {@link
  839.      * IERSConventions IERS conventions} cannot be freely chosen here.
  840.      * </p>
  841.      * @param applyEOPCorr if true, EOP corrections are applied (here, dut1 and lod)
  842.      * @return the selected reference frame singleton.
  843.      */
  844.     public static FactoryManagedFrame getGTOD(final boolean applyEOPCorr) {
  845.         return getGTOD(IERSConventions.IERS_1996, applyEOPCorr, true);
  846.     }

  847.     /** Get the GTOD reference frame.
  848.      * @param conventions IERS conventions to apply
  849.      * @param simpleEOP if true, tidal effects are ignored when interpolating EOP
  850.      * @return the selected reference frame singleton.
  851.      */
  852.     public static FactoryManagedFrame getGTOD(final IERSConventions conventions,
  853.                                               final boolean simpleEOP) {
  854.         return getGTOD(conventions, true, simpleEOP);
  855.     }

  856.     /** Get the GTOD reference frame.
  857.      * <p>
  858.      * The applyEOPCorr parameter is available mainly for testing purposes or for
  859.      * consistency with legacy software that don't handle EOP correction parameters.
  860.      * Beware that setting this parameter to {@code false} leads to crude accuracy
  861.      * (order of magnitudes for errors might be above 250m in LEO and 1400m in GEO).
  862.      * For this reason, setting this parameter to false is restricted to {@link
  863.      * IERSConventions#IERS_1996 IERS 1996} conventions, and hence this method is private.
  864.      * </p>
  865.      * @param conventions IERS conventions to apply
  866.      * @param applyEOPCorr if true, EOP corrections are applied (here, dut1 and lod)
  867.      * @param simpleEOP if true, tidal effects are ignored when interpolating EOP
  868.      * @return the selected reference frame singleton.
  869.      */
  870.     private static FactoryManagedFrame getGTOD(final IERSConventions conventions,
  871.                                                final boolean applyEOPCorr,
  872.                                                final boolean simpleEOP) {

  873.         synchronized (FramesFactory.class) {

  874.             // try to find an already built frame
  875.             final Predefined factoryKey;
  876.             switch (conventions) {
  877.                 case IERS_1996 :
  878.                     factoryKey = applyEOPCorr ?
  879.                                  (simpleEOP ? Predefined.GTOD_CONVENTIONS_1996_SIMPLE_EOP : Predefined.GTOD_CONVENTIONS_1996_ACCURATE_EOP) :
  880.                                  Predefined.GTOD_WITHOUT_EOP_CORRECTIONS;
  881.                     break;
  882.                 case IERS_2003 :
  883.                     factoryKey = simpleEOP ?
  884.                                  Predefined.GTOD_CONVENTIONS_2003_SIMPLE_EOP :
  885.                                  Predefined.GTOD_CONVENTIONS_2003_ACCURATE_EOP;
  886.                     break;
  887.                 case IERS_2010 :
  888.                     factoryKey = simpleEOP ? Predefined.GTOD_CONVENTIONS_2010_SIMPLE_EOP :
  889.                                              Predefined.GTOD_CONVENTIONS_2010_ACCURATE_EOP;
  890.                     break;
  891.                 default :
  892.                     // this should never happen
  893.                     throw new OrekitInternalError(null);
  894.             }
  895.             FactoryManagedFrame frame = FRAMES.get(factoryKey);

  896.             if (frame == null) {
  897.                 // it's the first time we need this frame, build it and store it
  898.                 final Frame tod = getTOD(conventions, applyEOPCorr, simpleEOP);
  899.                 final ShiftingTransformProvider todInterpolating =
  900.                         (ShiftingTransformProvider) tod.getTransformProvider();
  901.                 final TODProvider       todRaw     = (TODProvider) todInterpolating.getRawProvider();
  902.                 final EOPHistory        eopHistory = todRaw.getEOPHistory();
  903.                 final GTODProvider      gtodRaw    = new GTODProvider(conventions, eopHistory);
  904.                 final TransformProvider gtodShifting =
  905.                         new ShiftingTransformProvider(gtodRaw,
  906.                                                       CartesianDerivativesFilter.USE_PVA,
  907.                                                       AngularDerivativesFilter.USE_R,
  908.                                                       todInterpolating.getGridPoints(), todInterpolating.getStep(),
  909.                                                       OrekitConfiguration.getCacheSlotsNumber(),
  910.                                                       Constants.JULIAN_YEAR, 30 * Constants.JULIAN_DAY);
  911.                 frame = new FactoryManagedFrame(tod, gtodShifting, false, factoryKey);
  912.                 FRAMES.put(factoryKey, frame);
  913.             }

  914.             return frame;

  915.         }
  916.     }

  917.     /** Get the TOD reference frame.
  918.      * <p>
  919.      * The applyEOPCorr parameter is available mainly for testing purposes or for
  920.      * consistency with legacy software that don't handle EOP correction parameters.
  921.      * Beware that setting this parameter to {@code false} leads to crude accuracy
  922.      * (order of magnitudes for errors might be above 1m in LEO and 10m in GEO).
  923.      * For this reason, setting this parameter to false is restricted to {@link
  924.      * IERSConventions#IERS_1996 IERS 1996} conventions, and hence the {@link
  925.      * IERSConventions IERS conventions} cannot be freely chosen here.
  926.      * </p>
  927.      * @param applyEOPCorr if true, EOP corrections are applied (here, nutation)
  928.      * @return the selected reference frame singleton.
  929.      */
  930.     public static FactoryManagedFrame getTOD(final boolean applyEOPCorr) {
  931.         return getTOD(IERSConventions.IERS_1996, applyEOPCorr, false);
  932.     }

  933.     /** Get the TOD reference frame.
  934.      * @param conventions IERS conventions to apply
  935.      * @param simpleEOP if true, tidal effects are ignored when interpolating EOP
  936.      * @return the selected reference frame singleton.
  937.      */
  938.     public static FactoryManagedFrame getTOD(final IERSConventions conventions,
  939.                                              final boolean simpleEOP) {
  940.         return getTOD(conventions, true, simpleEOP);
  941.     }

  942.     /** Get the TOD reference frame.
  943.      * <p>
  944.      * The applyEOPCorr parameter is available mainly for testing purposes or for
  945.      * consistency with legacy software that don't handle EOP correction parameters.
  946.      * Beware that setting this parameter to {@code false} leads to crude accuracy
  947.      * (order of magnitudes for errors might be above 1m in LEO and 10m in GEO).
  948.      * For this reason, setting this parameter to false is restricted to {@link
  949.      * IERSConventions#IERS_1996 IERS 1996} conventions, and hence this method is private.
  950.      * </p>
  951.      * @param conventions IERS conventions to apply
  952.      * @param applyEOPCorr if true, EOP corrections are applied (here, nutation)
  953.      * @param simpleEOP if true, tidal effects are ignored when interpolating EOP
  954.      * @return the selected reference frame singleton.
  955.      */
  956.     private static FactoryManagedFrame getTOD(final IERSConventions conventions,
  957.                                               final boolean applyEOPCorr,
  958.                                               final boolean simpleEOP) {

  959.         synchronized (FramesFactory.class) {

  960.             // try to find an already built frame
  961.             final Predefined factoryKey;
  962.             switch (conventions) {
  963.                 case IERS_1996 :
  964.                     factoryKey = applyEOPCorr ?
  965.                                  (simpleEOP ? Predefined.TOD_CONVENTIONS_1996_SIMPLE_EOP : Predefined.TOD_CONVENTIONS_1996_ACCURATE_EOP) :
  966.                                  Predefined.TOD_WITHOUT_EOP_CORRECTIONS;
  967.                     break;
  968.                 case IERS_2003 :
  969.                     factoryKey = simpleEOP ?
  970.                                  Predefined.TOD_CONVENTIONS_2003_SIMPLE_EOP :
  971.                                      Predefined.TOD_CONVENTIONS_2003_ACCURATE_EOP;
  972.                     break;
  973.                 case IERS_2010 :
  974.                     factoryKey = simpleEOP ?
  975.                                  Predefined.TOD_CONVENTIONS_2010_SIMPLE_EOP :
  976.                                  Predefined.TOD_CONVENTIONS_2010_ACCURATE_EOP;
  977.                     break;
  978.                 default :
  979.                     // this should never happen
  980.                     throw new OrekitInternalError(null);
  981.             }
  982.             final int interpolationPoints;
  983.             final int pointsPerDay;
  984.             if (applyEOPCorr) {
  985.                 interpolationPoints = 6;
  986.                 pointsPerDay        = 24;
  987.             } else {
  988.                 interpolationPoints = 6;
  989.                 pointsPerDay        = 8;
  990.             }
  991.             FactoryManagedFrame frame = FRAMES.get(factoryKey);

  992.             if (frame == null) {
  993.                 // it's the first time we need this frame, build it and store it
  994.                 final EOPHistory eopHistory = applyEOPCorr ? getEOPHistory(conventions, simpleEOP) : null;
  995.                 final TransformProvider shifting =
  996.                         new ShiftingTransformProvider(new TODProvider(conventions, eopHistory),
  997.                                                       CartesianDerivativesFilter.USE_PVA,
  998.                                                       AngularDerivativesFilter.USE_R,
  999.                                                       interpolationPoints, Constants.JULIAN_DAY / pointsPerDay,
  1000.                                                       OrekitConfiguration.getCacheSlotsNumber(),
  1001.                                                       Constants.JULIAN_YEAR, 30 * Constants.JULIAN_DAY);
  1002.                 frame = new FactoryManagedFrame(getMOD(conventions, applyEOPCorr), shifting, true, factoryKey);
  1003.                 FRAMES.put(factoryKey, frame);
  1004.             }

  1005.             return frame;

  1006.         }
  1007.     }

  1008.     /** Get the MOD reference frame.
  1009.      * <p>
  1010.      * The applyEOPCorr parameter is available mainly for testing purposes or for
  1011.      * consistency with legacy software that don't handle EOP correction parameters.
  1012.      * Beware that setting this parameter to {@code false} leads to crude accuracy
  1013.      * (order of magnitudes for errors might be above 1m in LEO and 10m in GEO).
  1014.      * For this reason, setting this parameter to false is restricted to {@link
  1015.      * IERSConventions#IERS_1996 IERS 1996} conventions, and hence the {@link
  1016.      * IERSConventions IERS conventions} cannot be freely chosen here.
  1017.      * </p>
  1018.      * @param applyEOPCorr if true, EOP corrections are applied (EME2000/GCRF bias compensation)
  1019.      * @return the selected reference frame singleton.
  1020.      */
  1021.     public static FactoryManagedFrame getMOD(final boolean applyEOPCorr) {
  1022.         return getMOD(IERSConventions.IERS_1996, applyEOPCorr);
  1023.     }

  1024.     /** Get the MOD reference frame.
  1025.      * @param conventions IERS conventions to apply
  1026.      * @return the selected reference frame singleton.
  1027.      */
  1028.     public static FactoryManagedFrame getMOD(final IERSConventions conventions) {
  1029.         return getMOD(conventions, true);
  1030.     }

  1031.     /** Get the MOD reference frame.
  1032.      * <p>
  1033.      * The applyEOPCorr parameter is available mainly for testing purposes or for
  1034.      * consistency with legacy software that don't handle EOP correction parameters.
  1035.      * Beware that setting this parameter to {@code false} leads to crude accuracy
  1036.      * (order of magnitudes for errors might be above 1m in LEO and 10m in GEO).
  1037.      * For this reason, setting this parameter to false is restricted to {@link
  1038.      * IERSConventions#IERS_1996 IERS 1996} conventions, and hence this method is private.
  1039.      * </p>
  1040.      * @param conventions IERS conventions to apply
  1041.      * @param applyEOPCorr if true, EOP corrections are applied (EME2000/GCRF bias compensation)
  1042.      * @return the selected reference frame singleton.
  1043.      */
  1044.     private static FactoryManagedFrame getMOD(final IERSConventions conventions, final boolean applyEOPCorr) {

  1045.         synchronized (FramesFactory.class) {

  1046.             final Predefined factoryKey;
  1047.             final Frame parent;
  1048.             switch (conventions) {
  1049.                 case IERS_1996 :
  1050.                     factoryKey = applyEOPCorr ? Predefined.MOD_CONVENTIONS_1996 : Predefined.MOD_WITHOUT_EOP_CORRECTIONS;
  1051.                     parent     = applyEOPCorr ? FramesFactory.getGCRF() : FramesFactory.getEME2000();
  1052.                     break;
  1053.                 case IERS_2003 :
  1054.                     factoryKey = Predefined.MOD_CONVENTIONS_2003;
  1055.                     // in IERS conventions 2003, the precession angles zetaA, thetaA and zA
  1056.                     // from equation 33 are computed from EME2000, not from GCRF
  1057.                     parent     = FramesFactory.getEME2000();
  1058.                     break;
  1059.                 case IERS_2010 :
  1060.                     factoryKey = Predefined.MOD_CONVENTIONS_2010;
  1061.                     // precession angles epsilon0, psiA, omegaA and chiA
  1062.                     // from equations 5.39 and 5.40 are computed from EME2000
  1063.                     parent     = FramesFactory.getEME2000();
  1064.                     break;
  1065.                 default :
  1066.                     // this should never happen
  1067.                     throw new OrekitInternalError(null);
  1068.             }

  1069.             // try to find an already built frame
  1070.             FactoryManagedFrame frame = FRAMES.get(factoryKey);

  1071.             if (frame == null) {
  1072.                 // it's the first time we need this frame, build it and store it
  1073.                 frame = new FactoryManagedFrame(parent, new MODProvider(conventions), true, factoryKey);
  1074.                 FRAMES.put(factoryKey, frame);
  1075.             }

  1076.             return frame;

  1077.         }
  1078.     }

  1079.     /** Get the TEME reference frame.
  1080.      * <p>
  1081.      * The TEME frame is used for the SGP4 model in TLE propagation. This frame has <em>no</em>
  1082.      * official definition and there are some ambiguities about whether it should be used
  1083.      * as "of date" or "of epoch". This frame should therefore be used <em>only</em> for
  1084.      * TLE propagation and not for anything else, as recommended by the CCSDS Orbit Data Message
  1085.      * blue book.
  1086.      * </p>
  1087.      * @return the selected reference frame singleton.
  1088.      */
  1089.     public static FactoryManagedFrame getTEME() {
  1090.         synchronized (FramesFactory.class) {

  1091.             // try to find an already built frame
  1092.             final Predefined factoryKey = Predefined.TEME;
  1093.             FactoryManagedFrame frame = FRAMES.get(factoryKey);

  1094.             if (frame == null) {
  1095.                 // it's the first time we need this frame, build it and store it
  1096.                 final Frame tod = getTOD(IERSConventions.IERS_1996, false, true);
  1097.                 final ShiftingTransformProvider todShifting =
  1098.                         (ShiftingTransformProvider) tod.getTransformProvider();
  1099.                 final TEMEProvider temeRaw = new TEMEProvider(IERSConventions.IERS_1996, null);
  1100.                 final TransformProvider temeShifting =
  1101.                         new ShiftingTransformProvider(temeRaw,
  1102.                                                       CartesianDerivativesFilter.USE_PVA,
  1103.                                                       AngularDerivativesFilter.USE_R,
  1104.                                                       todShifting.getGridPoints(), todShifting.getStep(),
  1105.                                                       OrekitConfiguration.getCacheSlotsNumber(),
  1106.                                                       Constants.JULIAN_YEAR, 30 * Constants.JULIAN_DAY);

  1107.                 frame = new FactoryManagedFrame(tod, temeShifting, true, factoryKey);
  1108.                 FRAMES.put(factoryKey, frame);
  1109.             }

  1110.             return frame;

  1111.         }
  1112.     }

  1113.     /** Get the transform between two frames, suppressing all interpolation.
  1114.      * <p>
  1115.      * This method is similar to {@link Frame#getTransformTo(Frame, AbsoluteDate)}
  1116.      * except it removes the performance enhancing interpolation features that are
  1117.      * added by the {@link FramesFactory factory} to some frames, in order to focus
  1118.      * on accuracy. The interpolation features are intended to save processing time
  1119.      * by avoiding doing some lengthy computation like nutation evaluation at each
  1120.      * time step and caching some results. This method can be used to avoid this,
  1121.      * when very high accuracy is desired, or for testing purposes. It should be
  1122.      * used with care, as doing the full computation is <em>really</em> costly for
  1123.      * some frames.
  1124.      * </p>
  1125.      * @param from frame from which transformation starts
  1126.      * @param to frame to which transformation ends
  1127.      * @param date date of the transform
  1128.      * @return transform between the two frames, avoiding interpolation
  1129.      */
  1130.     public static Transform getNonInterpolatingTransform(final Frame from, final Frame to,
  1131.                                                          final AbsoluteDate date) {

  1132.         // common ancestor to both frames in the frames tree
  1133.         Frame currentF = from.getDepth() > to.getDepth() ? from.getAncestor(from.getDepth() - to.getDepth()) : from;
  1134.         Frame currentT = from.getDepth() > to.getDepth() ? to : to.getAncestor(to.getDepth() - from.getDepth());
  1135.         while (currentF != currentT) {
  1136.             currentF = currentF.getParent();
  1137.             currentT = currentT.getParent();
  1138.         }
  1139.         final Frame common = currentF;

  1140.         // transform from common to origin
  1141.         Transform commonToOrigin = Transform.IDENTITY;
  1142.         for (Frame frame = from; frame != common; frame = frame.getParent()) {
  1143.             commonToOrigin = new Transform(date,
  1144.                                              peel(frame.getTransformProvider()).getTransform(date),
  1145.                                              commonToOrigin);
  1146.         }

  1147.         // transform from destination up to common
  1148.         Transform commonToDestination = Transform.IDENTITY;
  1149.         for (Frame frame = to; frame != common; frame = frame.getParent()) {
  1150.             commonToDestination = new Transform(date,
  1151.                                                 peel(frame.getTransformProvider()).getTransform(date),
  1152.                                                 commonToDestination);
  1153.         }

  1154.         // transform from origin to destination via common
  1155.         return new Transform(date, commonToOrigin.getInverse(), commonToDestination);

  1156.     }

  1157.     /** Get the transform between two frames, suppressing all interpolation.
  1158.      * <p>
  1159.      * This method is similar to {@link Frame#getTransformTo(Frame, AbsoluteDate)}
  1160.      * except it removes the performance enhancing interpolation features that are
  1161.      * added by the {@link FramesFactory factory} to some frames, in order to focus
  1162.      * on accuracy. The interpolation features are intended to save processing time
  1163.      * by avoiding doing some lengthy computation like nutation evaluation at each
  1164.      * time step and caching some results. This method can be used to avoid this,
  1165.      * when very high accuracy is desired, or for testing purposes. It should be
  1166.      * used with care, as doing the full computation is <em>really</em> costly for
  1167.      * some frames.
  1168.      * </p>
  1169.      * @param from frame from which transformation starts
  1170.      * @param to frame to which transformation ends
  1171.      * @param date date of the transform
  1172.      * @param <T> type of the field elements
  1173.      * @return transform between the two frames, avoiding interpolation
  1174.      * @since 9.0
  1175.      */
  1176.     public static <T extends RealFieldElement<T>> FieldTransform<T> getNonInterpolatingTransform(final Frame from, final Frame to,
  1177.                                                                                                  final FieldAbsoluteDate<T> date) {

  1178.         // common ancestor to both frames in the frames tree
  1179.         Frame currentF = from.getDepth() > to.getDepth() ? from.getAncestor(from.getDepth() - to.getDepth()) : from;
  1180.         Frame currentT = from.getDepth() > to.getDepth() ? to : to.getAncestor(to.getDepth() - from.getDepth());
  1181.         while (currentF != currentT) {
  1182.             currentF = currentF.getParent();
  1183.             currentT = currentT.getParent();
  1184.         }
  1185.         final Frame common = currentF;

  1186.         // transform from common to origin
  1187.         FieldTransform<T> commonToOrigin = FieldTransform.getIdentity(date.getField());
  1188.         for (Frame frame = from; frame != common; frame = frame.getParent()) {
  1189.             commonToOrigin = new FieldTransform<>(date,
  1190.                                                    peel(frame.getTransformProvider()).getTransform(date),
  1191.                                                    commonToOrigin);
  1192.         }

  1193.         // transform from destination up to common
  1194.         FieldTransform<T> commonToDestination = FieldTransform.getIdentity(date.getField());
  1195.         for (Frame frame = to; frame != common; frame = frame.getParent()) {
  1196.             commonToDestination = new FieldTransform<>(date,
  1197.                                                        peel(frame.getTransformProvider()).getTransform(date),
  1198.                                                        commonToDestination);
  1199.         }

  1200.         // transform from origin to destination via common
  1201.         return new FieldTransform<>(date, commonToOrigin.getInverse(), commonToDestination);

  1202.     }

  1203.     /** Retrieve EOP from a frame hierarchy.
  1204.      * <p>
  1205.      * The frame hierarchy tree is walked from specified frame up to root
  1206.      * goind though parent frames, and the providers are checked to see if they
  1207.      * reference EOP history.the first EOP history found is returned.
  1208.      * </p>
  1209.      * @param start frame from which to start search, will typically be some
  1210.      * Earth related frame, like a topocentric frame or an ITRF frame
  1211.      * @return EOP history found while walking the frames tree, or null if
  1212.      * no EOP history is found
  1213.      * @since 9.1
  1214.      */
  1215.     public static EOPHistory findEOP(final Frame start) {

  1216.         for (Frame frame = start; frame != null; frame = frame.getParent()) {

  1217.             TransformProvider peeled = frame.getTransformProvider();

  1218.             boolean peeling = true;
  1219.             while (peeling) {
  1220.                 if (peeled instanceof InterpolatingTransformProvider) {
  1221.                     peeled = ((InterpolatingTransformProvider) peeled).getRawProvider();
  1222.                 } else if (peeled instanceof ShiftingTransformProvider) {
  1223.                     peeled = ((ShiftingTransformProvider) peeled).getRawProvider();
  1224.                 } else if (peeled instanceof EOPBasedTransformProvider &&
  1225.                            ((EOPBasedTransformProvider) peeled).getEOPHistory() != null) {
  1226.                     return ((EOPBasedTransformProvider) peeled).getEOPHistory();
  1227.                 } else {
  1228.                     peeling = false;
  1229.                 }
  1230.             }

  1231.         }

  1232.         // no history found
  1233.         return null;

  1234.     }

  1235.     /** Peel interpolation and shifting from a transform provider.
  1236.      * @param provider transform provider to peel
  1237.      * @return peeled transform provider
  1238.      */
  1239.     private static TransformProvider peel(final TransformProvider provider) {

  1240.         TransformProvider peeled = provider;

  1241.         boolean peeling = true;
  1242.         while (peeling) {
  1243.             if (peeled instanceof InterpolatingTransformProvider) {
  1244.                 peeled = ((InterpolatingTransformProvider) peeled).getRawProvider();
  1245.             } else if (peeled instanceof ShiftingTransformProvider) {
  1246.                 peeled = ((ShiftingTransformProvider) peeled).getRawProvider();
  1247.             } else if (peeled instanceof EOPBasedTransformProvider &&
  1248.                        ((EOPBasedTransformProvider) peeled).getEOPHistory() != null &&
  1249.                        ((EOPBasedTransformProvider) peeled).getEOPHistory().usesInterpolation()) {
  1250.                 peeled = ((EOPBasedTransformProvider) peeled).getNonInterpolatingProvider();
  1251.             } else {
  1252.                 peeling = false;
  1253.             }
  1254.         }

  1255.         return peeled;

  1256.     }

  1257.     /** Local class for different ITRF versions keys.
  1258.      * @since 9.2
  1259.      */
  1260.     private static class ITRFKey implements Serializable {

  1261.         /** Serialized UID. */
  1262.         private static final long serialVersionUID = 20180412L;

  1263.         /** ITRF version. */
  1264.         private final ITRFVersion version;

  1265.         /** IERS conventions to apply. */
  1266.         private final IERSConventions conventions;

  1267.         /** Tidal effects flag. */
  1268.         private final boolean simpleEOP;

  1269.         /** Simple constructor.
  1270.          * @param version ITRF version
  1271.          * @param conventions IERS conventions to apply
  1272.          * @param simpleEOP if true, tidal effects are ignored when interpolating EOP
  1273.          */
  1274.         ITRFKey(final ITRFVersion version, final IERSConventions conventions, final boolean simpleEOP) {
  1275.             this.version     = version;
  1276.             this.conventions = conventions;
  1277.             this.simpleEOP   = simpleEOP;
  1278.         }

  1279.         /** {@inheritDoc} */
  1280.         @Override
  1281.         public int hashCode() {
  1282.             return (version.ordinal()     << 5) +
  1283.                    (conventions.ordinal() << 1) +
  1284.                    (simpleEOP ? 0 : 1);
  1285.         }

  1286.         /** {@inheritDoc} */
  1287.         @Override
  1288.         public boolean equals(final Object other) {

  1289.             if (this == other) {
  1290.                 return true;
  1291.             }

  1292.             if (other instanceof ITRFKey) {
  1293.                 final ITRFKey key = (ITRFKey) other;
  1294.                 return version     == key.version     &&
  1295.                        conventions == key.conventions &&
  1296.                        simpleEOP   == key.simpleEOP;
  1297.             }

  1298.             return false;
  1299.         }

  1300.     }

  1301. }