Click or drag to resize

External Data

DME Component Libraries makes use of various data in order to perform accurate calculations. This topic provides an overview of the data sources, the default data shipped with the libraries, and where to obtain updated data files.

Leap Seconds

Leap seconds are periodically introduced by the International Earth Rotation Service (IERS). In DME Component Libraries, the set of leap seconds used for calculations are managed by the LeapSecondsFacet. Each release of DME Component Libraries includes the full set of leap seconds, both past and future, known at the time of the release. However, because leap seconds are added unpredictably over time, if you are building an application that you expect to be deployed long-term, you may need to plan to update the set of leap seconds used in your application, by loading an external data file which you can update without needing to rebuild.

Leap seconds can be loaded from a data file, LeapSecond.dat, which is maintained by AGI at: https://ftp.agi.com/pub/STKData/Astro/LeapSecond.dat. This file can be loaded using the following code:

Java
LeapSecondsFacet leapSeconds = LeapSecondFile.readLeapSeconds(filename);
leapSeconds.useInCurrentContext();

Alternatively, if your application has internet access, you can download the latest file from AGI using the following code:

Java
LeapSecondsFacet leapSeconds = LeapSecondFile.downloadLeapSeconds();
leapSeconds.useInCurrentContext();
Earth Orientation Parameters (EOP)

EarthOrientationParameters specify Earth polar motion coordinates and the difference between UT1 and UTC, which change over time. DME Component Libraries does not ship with this data, and by default, no EOP data is used.

This data file is maintained by AGI at: https://ftp.agi.com/pub/DynamicEarthData/EOP-v1.1.txt. This file contains observed data from the last several years, as well as several months of predicted values. A much larger file containing decades of historical data is available at: https://ftp.agi.com/pub/DynamicEarthData/EOP-All-v1.1.txt.

To load this data for use in DME Component Libraries, use EarthOrientationParametersFile to create an instance of EarthOrientationParameters, then store that object on EarthCentralBody.OrientationParameters (get / set).

Java
EarthOrientationParameters eop = EarthOrientationParametersFile.readData(new File(dataPath, "EOP-v1.1.txt").getPath());
CentralBodiesFacet.getFromContext().getEarth().setOrientationParameters(eop);

Alternatively, if your application has internet access, you can download the latest file from AGI using the following code:

Java
CentralBodiesFacet.getFromContext().getEarth().setOrientationParameters(EarthOrientationParametersFile.downloadData());
GPS Data

Several data files are used with the Navigation Accuracy Library to compute information about GPS satellites. These data files are available for download from AGI. Consult the documentation for each class for more information about each of these data files, and how to load and use the data in DME Component Libraries.

Solar Geophysical Data (Space Weather)

Some atmospheric density models in the Orbit Propagation Library use data about solar radiation and geomagnetic flux indices. This data can be loaded from data files obtained from CSSI at http://celestrak.com/spacedata/. To load this data into DME Component Libraries, construct a CssiSolarGeophysicalData object using one of the static methods on the class, then use that object to construct the desired density model.

JPL Planetary Ephemeris (JPLDE)

JPL Planetary Ephemeris files can be loaded to provide a more accurate model of the position of a CentralBody in DME Component Libraries. In particular, the Sun, Moon, planets, and Pluto can be located more accurately using this model. Ceres, Vesta, and the planetary moons require use of the JPL SPICE ephemeris system to locate them more accurately.

These data files can be downloaded from: https://ftp.agi.com/pub/STKData/Astro/PlanetEphem/lendian/. Each type of file has a corresponding class that can read the data. The most current file at the time of writing is DE 440, which can be loaded with the JplDE440 class. Once loaded, the data can be used for the positions of the centers of mass of the central bodies in the CentralBodiesFacet by calling JplDE.useForCentralBodyPositions.

Java
// Load a JplDE file using a string that represents the JplDE file
JplDE440 jplde = new JplDE440(new File(dataPath, "plneph.440").getPath());

// Use the JplDE data in a CentralBodiesFacet
CentralBodiesFacet centralBodies = CentralBodiesFacet.getFromContext();
jplde.useForCentralBodyPositions(centralBodies);

// Optional - use the JplDE data for the Lunar fixed frame
MoonCentralBody moon = centralBodies.getMoon();
moon.setFixedFrame(jplde.getMoonFixedFrame());
JPL SPICE Ephemeris

JPL SPICE files can be loaded to provide a more accurate model of some planetary moons, Ceres, and Vesta. They also allow the centers of mass of the outer planets to be modeled more accurately with respect to their planetary system barycenters. (JPLDE assumes that all planets other than Earth are located at their planetary system barycenters.)

The .bsp file format is used to locate these central bodies. Detailed instructions for how to acquire the necessary .bsp files are given in the documentation for JplSpkEphemerisProvider and its derived classes. The following code samples assume that the files have already been downloaded:

  • Setting up the Solar System using the Planetary Data Supplement: Use modelSolarSystemUsingPlanetaryDataSupplement to set up the Solar System.

    Java
    // Create JplSpkEphemerisProvider types that allow the Solar System to be modeled.
    // Each path should point to the corresponding .bsp file (e.g. planetsPath points to planets.bsp).
    PlanetsBspEphemerisProvider planetsEphemerisProvider = new PlanetsBspEphemerisProvider(planetsPath);
    AsteroidsBspEphemerisProvider asteroidsEphemerisProvider = new AsteroidsBspEphemerisProvider(asteroidsPath);
    MarsBspEphemerisProvider marsEphemerisProvider = new MarsBspEphemerisProvider(marsPath,
            planetsEphemerisProvider.getMarsSystemBarycenter());
    JupiterBspEphemerisProvider jupiterEphemerisProvider = new JupiterBspEphemerisProvider(jupiterPath,
            planetsEphemerisProvider.getJupiterSystemBarycenter());
    SaturnBspEphemerisProvider saturnEphemerisProvider = new SaturnBspEphemerisProvider(saturnPath,
            planetsEphemerisProvider.getSaturnSystemBarycenter());
    UranusBspEphemerisProvider uranusEphemerisProvider = new UranusBspEphemerisProvider(uranusPath,
            planetsEphemerisProvider.getUranusSystemBarycenter());
    NeptuneBspEphemerisProvider neptuneEphemerisProvider = new NeptuneBspEphemerisProvider(neptunePath,
            planetsEphemerisProvider.getNeptuneSystemBarycenter());
    PlutoBspEphemerisProvider plutoEphemerisProvider = new PlutoBspEphemerisProvider(plutoPath,
            planetsEphemerisProvider.getPlutoSystemBarycenter());
    
    // Get the current CentralBodiesFacet to allow it to be updated to use the
    // more accurate ephemeris data.
    CentralBodiesFacet centralBodiesFacet = CentralBodiesFacet.getFromContext();
    
    // Update the CentralBodiesFacet so that its CentralBodies and Barycenters
    // use more accurate CenterOfMassPoint locations.
    JplSpkEphemerisProvider.modelSolarSystemUsingPlanetaryDataSupplement(centralBodiesFacet,
            planetsEphemerisProvider, asteroidsEphemerisProvider, marsEphemerisProvider,
            jupiterEphemerisProvider, saturnEphemerisProvider, uranusEphemerisProvider,
            neptuneEphemerisProvider, plutoEphemerisProvider);
    
    
  • Setting up the Solar System using the Public JPL Data: Use modelSolarSystemUsingPublicJplData to set up the Solar System.

    Java
    // A JplDE instance (such as JplDE440) is used in conjunction with .bsp files to localize
    // the Solar System using public JPL data. This path should point to a plneph.440 file.
    JplDE440 jplDe440 = new JplDE440(jplDE440Path);
    
    // Create JplSpkEphemerisProvider types that allow the Solar System to be modeled.
    // Each path should point to the corresponding .bsp file (e.g. jup365Path points to jup365.bsp).
    CeresBspEphemerisProvider ceresEphemerisProvider = new CeresBspEphemerisProvider(ceresPath,
            jplDe440.getCenterOfMassPoint(JplDECentralBody.SUN));
    VestaBspEphemerisProvider vestaEphemerisProvider = new VestaBspEphemerisProvider(vestaPath,
            jplDe440.getCenterOfMassPoint(JplDECentralBody.SUN));
    MarsBspEphemerisProvider mar097EphemerisProvider = new MarsBspEphemerisProvider(mar097Path,
            jplDe440.getCenterOfMassPoint(JplDECentralBody.MARS));
    Jup365BspEphemerisProvider jup365EphemerisProvider = new Jup365BspEphemerisProvider(jup365Path,
            jplDe440.getCenterOfMassPoint(JplDECentralBody.JUPITER));
    Sat441BspEphemerisProvider sat441EphemerisProvider = new Sat441BspEphemerisProvider(sat441Path,
            jplDe440.getCenterOfMassPoint(JplDECentralBody.SATURN));
    Ura111BspEphemerisProvider ura111EphemerisProvider = new Ura111BspEphemerisProvider(ura111Path,
            jplDe440.getCenterOfMassPoint(JplDECentralBody.URANUS));
    Nep097BspEphemerisProvider nep097EphemerisProvider = new Nep097BspEphemerisProvider(nep097Path,
            jplDe440.getCenterOfMassPoint(JplDECentralBody.NEPTUNE));
    Plu058BspEphemerisProvider plu058EphemerisProvider = new Plu058BspEphemerisProvider(plu058Path,
            jplDe440.getCenterOfMassPoint(JplDECentralBody.PLUTO));
    
    // Get the current CentralBodiesFacet to allow it to be updated to use the
    // more accurate ephemeris data.
    CentralBodiesFacet centralBodiesFacet = CentralBodiesFacet.getFromContext();
    
    // Update the CentralBodiesFacet so that its CentralBodies and Barycenters
    // use more accurate CenterOfMassPoint locations.
    JplSpkEphemerisProvider.modelSolarSystemUsingPublicJplData(centralBodiesFacet, jplDe440, ceresEphemerisProvider,
            vestaEphemerisProvider, mar097EphemerisProvider, jup365EphemerisProvider, sat441EphemerisProvider,
            ura111EphemerisProvider, nep097EphemerisProvider, plu058EphemerisProvider);
    
    
  • Manually read SPICE files to locate celestial bodies: Use getTargetPoint to create Point objects that represent the position of one celestial body with respect to another celestial body or barycenter. The method getNaifIdsOfAvailableTargetPointsAndCenterPoints can be used to determine which celestial bodies and barycenters are available in a given SPICE file.

    Java
    // The planets.bsp file is read manually to illustrate how
    // to manually read .bsp files using the JplSpkFile type.
    JplSpkFile planetsBspFile = new JplSpkFile(planetsPath);
    
    // All of the CentralBodies available in planets.bsp are ultimately defined with
    // respect to the Solar System barycenter, the net center of mass of all of the
    // Solar System bodies.
    Point solarSystemBarycenter = CentralBodiesFacet.getFromContext().getSolarSystemBarycenter().getCenterOfMassPoint();
    
    // Integer NAIF ID codes are used to get target points with respect to center points.
    // https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/FORTRAN/req/naif_ids.html
    // is a good reference for how JPL defines CentralBodies and other points as NAIF ID codes.
    
    // In particular, the NAIF ID code 10 represents the Sun (which technically orbits the Solar
    // System barycenter), and the NAIF ID code 0 represents the Solar System barycenter.
    Point sunPoint = planetsBspFile.getTargetPoint(10, 0, solarSystemBarycenter);
    
    // NAIF ID codes 1 and 2 represent the Mercury and Venus system barycenters. Mercury and Venus
    // do not have any moons, so their system barycenters are co-located with their centers of
    // mass. Thus, Mercury and Venus are modeled as orbiting the Solar System barycenter directly.
    Point mercuryPoint = planetsBspFile.getTargetPoint(1, 0, solarSystemBarycenter);
    Point venusPoint = planetsBspFile.getTargetPoint(2, 0, solarSystemBarycenter);
    
    // NAIF ID code 3 represents the Earth-Moon barycenter, which is the center of mass of the Earth-Moon
    // system. This is modeled as orbiting the Solar System barycenter. The Earth (NAIF ID code 399)
    // and the Moon (NAIF ID code 301) are modeled as orbiting the Earth-Moon barycenter.
    Point earthMoonBarycenter = planetsBspFile.getTargetPoint(3, 0, solarSystemBarycenter);
    Point earthPoint = planetsBspFile.getTargetPoint(399, 3, earthMoonBarycenter);
    Point moonPoint = planetsBspFile.getTargetPoint(301, 3, earthMoonBarycenter);
    
    // NAIF ID code 4 represents the Mars system barycenter. Since the Martian moons Phobos and Deimos
    // have such low masses, this is within centimeters of the location of the center of mass of Mars
    // itself (NAIF ID code 499). Thus, the Mars system barycenter point can simply be cloned to get
    // a point for Mars itself.
    Point marsSystemBarycenter = planetsBspFile.getTargetPoint(4, 0, solarSystemBarycenter);
    Point marsPoint = (Point) marsSystemBarycenter.clone(new CopyContext());
    
    // NAIF ID code 5 represents the Jupiter system barycenter. Io, Europa, Ganymede, and Callisto
    // have substantial enough mass compared to Jupiter that Jupiter itself (NAIF ID code 599) must be
    // modeled as orbiting the Jupiter system barycenter in order to correctly define its position.
    Point jupiterSystemBarycenter = planetsBspFile.getTargetPoint(5, 0, solarSystemBarycenter);
    Point jupiterPoint = planetsBspFile.getTargetPoint(599, 5, jupiterSystemBarycenter);
    
    // NAIF ID code 6 represents the Saturn system barycenter. Titan and the smaller moons of Saturn
    // have substantial enough mass compared to Saturn that Saturn itself (NAIF ID code 699) must be
    // modeled as orbiting the Saturn system barycenter in order to correctly define its position.
    Point saturnSystemBarycenter = planetsBspFile.getTargetPoint(6, 0, solarSystemBarycenter);
    Point saturnPoint = planetsBspFile.getTargetPoint(699, 6, saturnSystemBarycenter);
    
    // NAIF ID code 7 represents the Uranus system barycenter. The major moons of Uranus
    // have substantial enough mass compared to Uranus that Uranus itself (NAIF ID code 799) must be
    // modeled as orbiting the Uranus system barycenter in order to correctly define its position.
    Point uranusSystemBarycenter = planetsBspFile.getTargetPoint(7, 0, solarSystemBarycenter);
    Point uranusPoint = planetsBspFile.getTargetPoint(799, 7, uranusSystemBarycenter);
    
    // NAIF ID code 8 represents the Neptune system barycenter. Triton and the smaller moons of Neptune
    // have substantial enough mass compared to Neptune that Neptune itself (NAIF ID code 899) must be
    // modeled as orbiting the Neptune system barycenter in order to correctly define its position.
    Point neptuneSystemBarycenter = planetsBspFile.getTargetPoint(8, 0, solarSystemBarycenter);
    Point neptunePoint = planetsBspFile.getTargetPoint(899, 8, neptuneSystemBarycenter);
    
    // NAIF ID code 9 represents the Pluto system barycenter. Charon has substantial enough mass
    // compared to Pluto that Pluto itself (NAIF ID code 999) must be modeled as orbiting the
    // Pluto system barycenter in order to correctly define its position.
    Point plutoSystemBarycenter = planetsBspFile.getTargetPoint(9, 0, solarSystemBarycenter);
    Point plutoPoint = planetsBspFile.getTargetPoint(999, 9, plutoSystemBarycenter);
    
    // The planetary moons (besides the Moon of Earth) are in separate .bsp files and their positions
    // are defined in terms of the system barycenters. For example, jupiter.bsp can be manually read
    // to get the positions of Io, Europa, Ganymede, and Callisto with respect to the Jupiter system
    // barycenter Point that was defined earlier.
    JplSpkFile jupiterBspFile = new JplSpkFile(jupiterPath);
    Point ioPoint = jupiterBspFile.getTargetPoint(501, 5, jupiterSystemBarycenter);
    Point europaPoint = jupiterBspFile.getTargetPoint(502, 5, jupiterSystemBarycenter);
    Point ganymedePoint = jupiterBspFile.getTargetPoint(503, 5, jupiterSystemBarycenter);
    Point callistoPoint = jupiterBspFile.getTargetPoint(504, 5, jupiterSystemBarycenter);
    
    // Finally, Ceres, Vesta, and 28 other asteroids are defined in the asteroids.bsp file with respect
    // to the Solar System barycenter.
    JplSpkFile asteroidsBspFile = new JplSpkFile(asteroidsPath);
    Point ceresPoint = asteroidsBspFile.getTargetPoint(2000001, 0, solarSystemBarycenter);
    Point vestaPoint = asteroidsBspFile.getTargetPoint(2000004, 0, solarSystemBarycenter);
    Point erosPoint = asteroidsBspFile.getTargetPoint(2000433, 0, solarSystemBarycenter);