public abstract class JplDE extends DefinitionalObject
JPL Planetary Ephemeris files can be downloaded from https://ftp.agi.com/pub/STKData/Astro/PlanetEphem/lendian/.
| Modifier | Constructor and Description |
|---|---|
protected |
JplDE(JplDE existingInstance,
CopyContext context)
Initializes a new instance as a copy of an existing instance.
|
protected |
JplDE(JplDEFile file)
Initializes an instance using the specified
JplDEFile instance. |
protected |
JplDE(StreamFactory streamFactory)
Initializes a new instance with the specified stream factory.
|
protected |
JplDE(String fileName)
Initializes an instance using the specified JPL DE filename.
|
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
checkForSameDefinition(DefinitionalObject other)
Checks to determine if another instance has the same definition as this instance and
returns
true if it does. |
protected abstract boolean |
checkForSameDefinition(JplDE other)
Checks to determine if another instance has the same definition as this instance and
returns
true if it does. |
protected int |
computeCurrentDefinitionHashCode()
Computes a hash code based on the current properties of this object.
|
Point |
createEarthMoonBarycenterPoint()
Creates a
Point that represents the position of
the Earth-Moon barycenter calculated from the data in this class. |
void |
enumerateDependencies(DependencyEnumerator enumerator)
Enumerates the dependencies of this object by calling
DependencyEnumerator#enumerate(T) for each object that this object directly depends upon. |
protected void |
freezeAggregatedObjects()
Called by
DefinitionalObject.freeze() to also freeze any objects that are considered to be a part of this object. |
JplDECenterOfMassPoint |
getCenterOfMassPoint(JplDECentralBody centralBody)
Gets a point which represents the center of mass of the given
JplDECentralBody. |
double |
getEarthMoonMassRatio()
Gets the ratio of the mass of the earth to the mass of the moon.
|
NutationModel |
getEarthNutationModel()
Creates a
NutationModel which uses this JPL DE data for the nutation of the Earth. |
JplDEFile |
getFile()
Gets the raw JPL DE file represented by this instance.
|
JulianDate |
getFinalEpoch()
Gets the last epoch for which ephemeris data is available.
|
double |
getGravitationalParameter(JplDECentralBody centralBody)
Gets the gravitational parameter of a central body in SI units (m^3/s^2).
|
double |
getGravitationalParameterNative(JplDECentralBody centralBody)
Gets the gravitational parameter of a central body in AU^3/day^2.
|
JulianDate |
getInitialEpoch()
Gets the first epoch for which ephemeris data is available.
|
double |
getKilometersPerAstronomicalUnit()
Gets the number of kilometers (km) in one astronomical unit (AU).
|
int |
getLunarEphemerisNumber()
Gets the number indicating the source of the data.
|
int |
getPlanetaryEphemerisNumber()
Gets the number indicating the source of the data.
|
double |
getSpeedOfLight()
Gets the speed of light in km/s.
|
List<String> |
getTitles()
Gets the collection of titles.
|
void |
useForCentralBodyPositions(CentralBodiesFacet centralBodiesFacet)
Uses this JPL DE data for the positions of the centers of mass of the central bodies
in the specified
CentralBodiesFacet instance. |
areSameDefinition, areSameDefinition, areSameDefinition, areSameDefinition, areSameDefinition, clone, collectionItemsAreSameDefinition, collectionItemsAreSameDefinition, collectionItemsAreSameDefinition, dictionaryItemsAreSameDefinition, freeze, getCollectionHashCode, getCollectionHashCode, getCollectionHashCode, getDefinitionHashCode, getDefinitionHashCode, getDefinitionHashCode, getDefinitionHashCode, getDefinitionHashCode, getDefinitionHashCode, getDictionaryHashCode, getIsFrozen, isSameDefinition, throwIfFrozenprotected JplDE(@Nonnull String fileName)
fileName - The full path and filename of the JPL DE file.ArgumentNullException - Thrown when fileName is null.protected JplDE(@Nonnull StreamFactory streamFactory)
The streams created by streamFactory must support seeking.
This means that the streams must implement
ISeekableStream or
FileInputStream.
streamFactory - The factory to use to create streams to read the JPL DE data.ArgumentNullException - Thrown when streamFactory is null.protected JplDE(@Nonnull JplDEFile file)
JplDEFile instance.file - The JplDEFile instance to use.ArgumentNullException - Thrown when file is null.protected JplDE(@Nonnull JplDE existingInstance, @Nonnull CopyContext context)
See ICloneWithContext.clone(CopyContext) for more information about how to implement this constructor
in a derived class.
existingInstance - The existing instance to copy.context - A CopyContext that controls the depth of the copy.ArgumentNullException - Thrown when existingInstance or context is null.protected final boolean checkForSameDefinition(DefinitionalObject other)
true if it does. Derived classes MUST override this method and check
all new fields introduced by the derived class for definitional equivalence. It is NOT necessary
to check base class fields because the base class will already have done that. When overriding this method,
you should NOT call the base implementation because it will return false for all derived-class instances.
Derived classes should check the type of other to preserve the symmetric nature of IEquatableDefinition.isSameDefinition(java.lang.Object).checkForSameDefinition in class DefinitionalObjectother - The other instance to compare to this one.true if the two objects are defined equivalently; otherwise false.protected abstract boolean checkForSameDefinition(JplDE other)
true if it does. Derived classes MUST override this method and check
all new fields introduced by the derived class for definitional equivalence. It is NOT necessary
to check base class fields because the base class will already have done that. When overriding this method,
you should NOT call the base implementation because it will return false for all derived-class instances.
Derived classes should check the type of other to preserve the symmetric nature of IEquatableDefinition.isSameDefinition(java.lang.Object).other - The other instance to compare to this one.true if the two objects are defined equivalently; otherwise false.protected int computeCurrentDefinitionHashCode()
JplDE.checkForSameDefinition(agi.foundation.infrastructure.DefinitionalObject) method.computeCurrentDefinitionHashCode in class DefinitionalObjectpublic void enumerateDependencies(DependencyEnumerator enumerator)
DependencyEnumerator#enumerate(T) for each object that this object directly depends upon.
Derived classes which contain additional dependencies MUST override this method, call the base
implementation, and enumerate dependencies introduced by the derived class.enumerateDependencies in interface IEnumerateDependenciesenumerateDependencies in class DefinitionalObjectenumerator - The enumerator that is informed of the dependencies of this object.protected final void freezeAggregatedObjects()
DefinitionalObject.freeze() to also freeze any objects that are considered to be a part of this object.
Derived classes which contain additional aggregated objects MUST override this method, call the base
implementation, and freeze aggregated objects introduced by the derived class. The objects that need to be
frozen in this method are frequently created in this object's constructor and are not settable via
properties.freezeAggregatedObjects in class DefinitionalObjectpublic final int getPlanetaryEphemerisNumber()
public final int getLunarEphemerisNumber()
public final double getSpeedOfLight()
public final double getKilometersPerAstronomicalUnit()
public final double getEarthMoonMassRatio()
@Nonnull public final JulianDate getInitialEpoch()
@Nonnull public final JulianDate getFinalEpoch()
public final double getGravitationalParameterNative(@Nonnull JplDECentralBody centralBody)
centralBody - The central body for which to retrieve information.public final double getGravitationalParameter(@Nonnull JplDECentralBody centralBody)
centralBody - The central body for which to retrieve information.@Nonnull public final JplDECenterOfMassPoint getCenterOfMassPoint(@Nonnull JplDECentralBody centralBody)
JplDECentralBody.centralBody - An enumeration indicating the central body to create.@Nonnull public final NutationModel getEarthNutationModel()
NutationModel which uses this JPL DE data for the nutation of the Earth.public final void useForCentralBodyPositions(@Nonnull CentralBodiesFacet centralBodiesFacet)
Uses this JPL DE data for the positions of the centers of mass of the central bodies
in the specified CentralBodiesFacet instance. This also sets the
positions of all the PlanetarySystemBarycenters.
In particular, the EarthMoonBarycenter is calculated using the
EarthMoonMassRatio (get) and the updated positions of
EarthCentralBody and MoonCentralBody. The other planetary
system barycenters are set to exactly the same positions as their respective planets
because technically the JPL DE data provides the barycenter positions rather than the physical
positions of those planets.
The following example shows how to load a JPL DE file and use its data for the positions
of the centers of mass of the central bodies in a CentralBodiesFacet:
// 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());
To use JPL DE data for a single central body, use JplDECenterOfMassPoint.
This method also calls CentralBody.synchronizeOrigins() on the bodies.
centralBodiesFacet - The central bodies to update to use this JPL DE data.ArgumentNullException - Thrown when centralBodiesFacet is null.@Nonnull public final Point createEarthMoonBarycenterPoint()
Point that represents the position of
the Earth-Moon barycenter calculated from the data in this class.