public class EarthCentralBody extends CentralBody implements IProvideNaifIdCode
CentralBodiesFacet
instance in the calculation context instead of creating one directly.
This example shows how to obtain the Earth from the calculation context:
EarthCentralBody earth = CentralBodiesFacet.getFromContext().getEarth();
See EarthCentralBody.EarthCentralBody()
for a description of the default instance of this class
that is found in the CalculationContext
.
Modifier | Constructor and Description |
---|---|
|
EarthCentralBody()
Initializes a new instance.
|
protected |
EarthCentralBody(EarthCentralBody existingInstance,
CopyContext context)
Initializes a new instance as a copy of an existing instance.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
checkForSameDefinition(CentralBody other)
Checks to determine if another instance has the same definition as this instance and
returns
true if it does. |
protected boolean |
checkForSameDefinition(EarthCentralBody other)
Checks to determine if another instance has the same definition as this instance and
returns
true if it does. |
Object |
clone(CopyContext context)
Clones this object using the specified context.
|
protected int |
computeCurrentDefinitionHashCode()
Computes a hash code based on the current properties of this object.
|
void |
enumerateDependencies(DependencyEnumerator enumerator)
Enumerates the dependencies of this object by calling
DependencyEnumerator#enumerate(T) for each object that this object directly depends upon. |
Point |
getCenterOfMassPoint()
Gets a point describing the center of mass of this central body.
|
EquationOfEquinoxes |
getEquationOfEquinoxes()
Gets the default model for the equation of the equinoxes which
defines the right ascension of the mean equinox with respect to the
true equator and equinox.
|
ReferenceFrame |
getFixedFrame()
Gets the default Fixed frame that corresponds to the surface features of this central body.
|
ReferenceFrame |
getInertialFrame()
Gets the default Inertial frame for this central body.
|
ReferenceFrame |
getInternationalCelestialReferenceFrame()
Gets the International Celestial Reference Frame.
|
ReferenceFrame |
getJ2000Frame()
Gets the J2000 Reference Frame.
|
ReferenceFrame |
getMeanEclipticMeanEquinoxFrame()
Gets the Mean Ecliptic Mean Equinox Reference Frame.
|
ReferenceFrame |
getMeanEclipticTrueEquinoxFrame()
Gets the Mean Ecliptic True Equinox Reference Frame.
|
ReferenceFrame |
getMeanEquatorMeanEquinoxFrame()
Gets the Mean Equator Mean Equinox Reference Frame, also
known as the "Mean of Date" reference frame.
|
TerrainProvider |
getMeanSeaLevel()
Gets the default mean sea level surface.
|
int |
getNaifIdCode()
Gets the NAIF identification code of this central body,
barycenter, spacecraft, ground station, or other physical
object or location.
|
String |
getName()
Gets the name of the central body.
|
NutationModel |
getNutationModel()
Gets the default nutation model used in the FK5 transformation from
J2000 to the Fixed frame.
|
EarthOrientationParameters |
getOrientationParameters()
Gets the default
EarthOrientationParameters . |
PrecessionModel |
getPrecessionModel()
Gets the default precession model used in the FK5 transformation from
J2000 to the Fixed frame.
|
ReferenceFrame |
getPrincipalFrame()
Gets the default Fixed frame that corresponds to the gravity frame of this central body.
|
ReferenceFrame |
getPseudoFixedFrame()
Gets the pseudo-fixed reference frame.
|
Ellipsoid |
getShape()
Gets the shape of this central body.
|
double |
getSlowChangingAxesUpdateInterval()
Gets the interval, in seconds, on which to recalculate slow-changing relationships between axes.
|
ReferenceFrame |
getTrueEquatorMeanEquinoxFrame()
Gets the True Equator, Mean Equinox (TEME) Reference Frame.
|
ReferenceFrame |
getTrueEquatorTrueEquinoxFrame()
Gets the True Equator True Equinox Reference Frame, also
known as the "True of Date" reference frame.
|
void |
setCenterOfMassPoint(Point value)
Sets a point describing the center of mass of this central body.
|
void |
setEquationOfEquinoxes(EquationOfEquinoxes value)
Sets the default model for the equation of the equinoxes which
defines the right ascension of the mean equinox with respect to the
true equator and equinox.
|
void |
setFixedFrame(ReferenceFrame value)
Sets the default Fixed frame that corresponds to the surface features of this central body.
|
void |
setInertialFrame(ReferenceFrame value)
Sets the default Inertial frame for this central body.
|
void |
setInternationalCelestialReferenceFrame(ReferenceFrame value)
Sets the International Celestial Reference Frame.
|
void |
setJ2000Frame(ReferenceFrame value)
Sets the J2000 Reference Frame.
|
void |
setMeanEclipticMeanEquinoxFrame(ReferenceFrame value)
Sets the Mean Ecliptic Mean Equinox Reference Frame.
|
void |
setMeanEclipticTrueEquinoxFrame(ReferenceFrame value)
Sets the Mean Ecliptic True Equinox Reference Frame.
|
void |
setMeanEquatorMeanEquinoxFrame(ReferenceFrame value)
Sets the Mean Equator Mean Equinox Reference Frame, also
known as the "Mean of Date" reference frame.
|
void |
setMeanSeaLevel(TerrainProvider value)
Sets the default mean sea level surface.
|
void |
setName(String value)
Sets the name of the central body.
|
void |
setNutationModel(NutationModel value)
Sets the default nutation model used in the FK5 transformation from
J2000 to the Fixed frame.
|
void |
setOrientationParameters(EarthOrientationParameters value)
Sets the default
EarthOrientationParameters . |
void |
setPrecessionModel(PrecessionModel value)
Sets the default precession model used in the FK5 transformation from
J2000 to the Fixed frame.
|
void |
setPrincipalFrame(ReferenceFrame value)
Sets the default Fixed frame that corresponds to the gravity frame of this central body.
|
void |
setPseudoFixedFrame(ReferenceFrame value)
Sets the pseudo-fixed reference frame.
|
void |
setShape(Ellipsoid value)
Sets the shape of this central body.
|
void |
setSlowChangingAxesUpdateInterval(double value)
Sets the interval, in seconds, on which to recalculate slow-changing relationships between axes.
|
void |
setTrueEquatorMeanEquinoxFrame(ReferenceFrame value)
Sets the True Equator, Mean Equinox (TEME) Reference Frame.
|
void |
setTrueEquatorTrueEquinoxFrame(ReferenceFrame value)
Sets the True Equator True Equinox Reference Frame, also
known as the "True of Date" reference frame.
|
void |
synchronizeOrigins()
Sets the
Origin (get / set ) of the InertialFrame (get / set ),
J2000Frame (get / set ), InternationalCelestialReferenceFrame (get / set ),
FixedFrame (get / set ), PrincipalFrame (get / set ), PseudoFixedFrame (get / set ),
MeanEquatorMeanEquinoxFrame (get / set ), MeanEclipticMeanEquinoxFrame (get / set ),
MeanEclipticTrueEquinoxFrame (get / set ), TrueEquatorTrueEquinoxFrame (get / set ),
and TrueEquatorMeanEquinoxFrame (get / set )
to the current CenterOfMassPoint (get / set ). |
checkForSameDefinition, getAzimuthElevationRangeEvaluator, getAzimuthElevationRangeEvaluator, getAzimuthElevationRangeEvaluator, getAzimuthElevationRangeEvaluator, getIsThreadSafe, getLocationPoint, getOrientationAxes, getReferenceFrame, getService, observeCartographicPoint, observeCartographicPoint
areSameDefinition, areSameDefinition, areSameDefinition, areSameDefinition, areSameDefinition, collectionItemsAreSameDefinition, collectionItemsAreSameDefinition, collectionItemsAreSameDefinition, dictionaryItemsAreSameDefinition, freeze, freezeAggregatedObjects, getCollectionHashCode, getCollectionHashCode, getCollectionHashCode, getDefinitionHashCode, getDefinitionHashCode, getDefinitionHashCode, getDefinitionHashCode, getDefinitionHashCode, getDefinitionHashCode, getDictionaryHashCode, getIsFrozen, isSameDefinition, throwIfFrozen
public EarthCentralBody()
This example shows how to obtain the Earth from the calculation context:
EarthCentralBody earth = CentralBodiesFacet.getFromContext().getEarth();
You should generally obtain an instance of this class from the
CentralBodiesFacet
instance in the calculation context instead of creating one directly.
A default-constructed instance of EarthCentralBody
has the following characteristics:
CenterOfMassPoint
(get
/ set
) is defined by Earth
(get
).
Consider using JplDE.useForCentralBodyPositions(agi.foundation.celestial.CentralBodiesFacet)
to configure this and other
central bodies with a much more accurate model of their positions using JPL DE data.
Shape
(get
/ set
) is the WGS84 ellipsoid returned by Shape
(get
).
PrecessionModel
(get
/ set
) is Iau1976Precession
configured without any caching.
NutationModel
(get
/ set
) is Updated1980NutationModel
(get
) configured without any caching.
OrientationParameters
(get
/ set
) property is initialized to a default-constructed instance of
EarthOrientationParameters
. This means that, by default, the pole is assumed not to wander
and the difference between UT1 and UTC is 0.0 seconds. For more accurate modeling of the relationship between
the Fixed and Inertial reference frames, use EarthOrientationParametersFile
to load an
up-to-date EOP file.
MeanSeaLevel
(get
/ set
) surface is not defined. Consider configuring it with an instance of EarthGravityModel96MeanSeaLevel
.
PrecessionModel
(get
/ set
), NutationModel
(get
/ set
), and OrientationParameters
(get
/ set
).
If you change any of these properties, the reference frames will use the new values.
protected EarthCentralBody(@Nonnull EarthCentralBody 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
.public Object clone(CopyContext context)
This method should be implemented to call a copy constructor on the class of the
object being cloned. The copy constructor should take the CopyContext
as a parameter
in addition to the existing instance to copy. The copy constructor should first call
CopyContext.addObjectMapping(T, T)
to identify the newly constructed instance
as a copy of the existing instance. It should then copy all fields, using
CopyContext.updateReference(T)
to copy any reference fields.
A typical implementation of ICloneWithContext
:
public static class MyClass implements ICloneWithContext {
public MyClass(MyClass existingInstance, CopyContext context) {
context.addObjectMapping(existingInstance, this);
someReference = context.updateReference(existingInstance.someReference);
}
@Override
public final Object clone(CopyContext context) {
return new MyClass(this, context);
}
private Object someReference;
}
In general, all fields that are reference types should be copied with a call to
CopyContext.updateReference(T)
. There are a couple of exceptions:
If one of these exceptions applies, the CopyContext
should be given an opportunity
to update the reference before the reference is copied explicitly. Use
CopyContext.updateReference(T)
to update the reference. If CopyContext.updateReference(T)
returns
the original object, indicating that the context does not have a replacement registered,
then copy the object manually by invoking a Clone method, a copy constructor, or by manually
constructing a new instance and copying the values.
alwaysCopy = context.updateReference(existingInstance.alwaysCopy);
if (existingInstance.alwaysCopy != null && alwaysCopy == existingInstance.alwaysCopy) {
alwaysCopy = (AlwaysCopy) existingInstance.alwaysCopy.clone(context);
}
If you are implementing an evaluator (a class that implements IEvaluator
), the
IEvaluator.updateEvaluatorReferences(agi.foundation.infrastructure.CopyContext)
method shares some responsibilities with the
copy context constructor. Code duplication can be avoided by doing the following:
CopyContext.updateReference(T)
. You should still call CopyContext.updateReference(T)
on any references to
non-evaluators.
IEvaluator.updateEvaluatorReferences(agi.foundation.infrastructure.CopyContext)
as the last line in the constructor and pass it the
same CopyContext
passed to the constructor.
IEvaluator.updateEvaluatorReferences(agi.foundation.infrastructure.CopyContext)
as normal. See the reference documentation for
IEvaluator.updateEvaluatorReferences(agi.foundation.infrastructure.CopyContext)
for more information on implementing that method.
public MyClass(MyClass existingInstance, CopyContext context) {
super(existingInstance, context);
someReference = context.updateReference(existingInstance.someReference);
evaluatorReference = existingInstance.evaluatorReference;
updateEvaluatorReferences(context);
}
@Override
public void updateEvaluatorReferences(CopyContext context) {
evaluatorReference = context.updateReference(evaluatorReference);
}
@Override
public Object clone(CopyContext context) {
return new MyClass(this, context);
}
private Object someReference;
private IEvaluator evaluatorReference;
clone
in interface ICloneWithContext
clone
in class DefinitionalObject
context
- The context to use to perform the copy.protected final boolean checkForSameDefinition(CentralBody 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 CentralBody
other
- The other instance to compare to this one.true
if the two objects are defined equivalently; otherwise false
.protected boolean checkForSameDefinition(EarthCentralBody 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()
EarthCentralBody.checkForSameDefinition(agi.foundation.celestial.CentralBody)
method.computeCurrentDefinitionHashCode
in class CentralBody
public 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 IEnumerateDependencies
enumerateDependencies
in class DefinitionalObject
enumerator
- The enumerator that is informed of the dependencies of this object.public String getName()
getName
in class CentralBody
public void setName(String value)
setName
in class CentralBody
ArgumentNullException
- Thrown when value
is null
.public Ellipsoid getShape()
By default this is the WGS84 oblate ellipsoid model of the Earth.
getShape
in class CentralBody
public void setShape(Ellipsoid value)
By default this is the WGS84 oblate ellipsoid model of the Earth.
setShape
in class CentralBody
ArgumentNullException
- Thrown when value
is null
.public Point getCenterOfMassPoint()
Setting this property will also set the origin of all of the reference frames.
getCenterOfMassPoint
in class CentralBody
public void setCenterOfMassPoint(Point value)
Setting this property will also set the origin of all of the reference frames.
setCenterOfMassPoint
in class CentralBody
ArgumentNullException
- Thrown when value
is null
.public ReferenceFrame getInertialFrame()
By default this is the same as the reference frame returned by InternationalCelestialReferenceFrame
(get
/ set
).
getInertialFrame
in class CentralBody
public void setInertialFrame(ReferenceFrame value)
By default this is the same as the reference frame returned by InternationalCelestialReferenceFrame
(get
/ set
).
setInertialFrame
in class CentralBody
ArgumentNullException
- Thrown when value
is null
.public ReferenceFrame getPrincipalFrame()
getPrincipalFrame
in class CentralBody
public void setPrincipalFrame(ReferenceFrame value)
setPrincipalFrame
in class CentralBody
ArgumentNullException
- Thrown when value
is null
.public void synchronizeOrigins()
Origin
(get
/ set
) of the InertialFrame
(get
/ set
),
J2000Frame
(get
/ set
), InternationalCelestialReferenceFrame
(get
/ set
),
FixedFrame
(get
/ set
), PrincipalFrame
(get
/ set
), PseudoFixedFrame
(get
/ set
),
MeanEquatorMeanEquinoxFrame
(get
/ set
), MeanEclipticMeanEquinoxFrame
(get
/ set
),
MeanEclipticTrueEquinoxFrame
(get
/ set
), TrueEquatorTrueEquinoxFrame
(get
/ set
),
and TrueEquatorMeanEquinoxFrame
(get
/ set
)
to the current CenterOfMassPoint
(get
/ set
).synchronizeOrigins
in class CentralBody
@Nonnull public final ReferenceFrame getJ2000Frame()
public final void setJ2000Frame(@Nonnull ReferenceFrame value)
ArgumentNullException
- Thrown when value
is null
.@Nonnull public final ReferenceFrame getInternationalCelestialReferenceFrame()
public final void setInternationalCelestialReferenceFrame(@Nonnull ReferenceFrame value)
ArgumentNullException
- Thrown when value
is null
.@Nonnull public final ReferenceFrame getMeanEquatorMeanEquinoxFrame()
public final void setMeanEquatorMeanEquinoxFrame(@Nonnull ReferenceFrame value)
ArgumentNullException
- Thrown when value
is null
.@Nonnull public final ReferenceFrame getMeanEclipticMeanEquinoxFrame()
public final void setMeanEclipticMeanEquinoxFrame(@Nonnull ReferenceFrame value)
ArgumentNullException
- Thrown when value
is null
.@Nonnull public final ReferenceFrame getMeanEclipticTrueEquinoxFrame()
public final void setMeanEclipticTrueEquinoxFrame(@Nonnull ReferenceFrame value)
ArgumentNullException
- Thrown when value
is null
.@Nonnull public final ReferenceFrame getTrueEquatorTrueEquinoxFrame()
public final void setTrueEquatorTrueEquinoxFrame(@Nonnull ReferenceFrame value)
@Nonnull public final ReferenceFrame getTrueEquatorMeanEquinoxFrame()
public final void setTrueEquatorMeanEquinoxFrame(@Nonnull ReferenceFrame value)
@Nonnull public final ReferenceFrame getPseudoFixedFrame()
EarthOrientationParameters
(EOP). If the EOP data is default
(zeros), the pseudo-fixed frame will be the same as the FixedFrame
(get
/ set
).public final void setPseudoFixedFrame(@Nonnull ReferenceFrame value)
EarthOrientationParameters
(EOP). If the EOP data is default
(zeros), the pseudo-fixed frame will be the same as the FixedFrame
(get
/ set
).ArgumentNullException
- Thrown when value
is null
.public ReferenceFrame getFixedFrame()
The transformation between the default value of this frame and the International Celestial Reference Frame (ICRF) matches the Standards of Fundamental Astronomy (SOFA) IAU 2006/2000A model to the microarcsecond level.
getFixedFrame
in class CentralBody
public void setFixedFrame(ReferenceFrame value)
The transformation between the default value of this frame and the International Celestial Reference Frame (ICRF) matches the Standards of Fundamental Astronomy (SOFA) IAU 2006/2000A model to the microarcsecond level.
setFixedFrame
in class CentralBody
ArgumentNullException
- Thrown when value
is null
.@Nonnull public final PrecessionModel getPrecessionModel()
public final void setPrecessionModel(@Nonnull PrecessionModel value)
@Nonnull public final NutationModel getNutationModel()
Updated1980NutationModel
(get
).public final void setNutationModel(@Nonnull NutationModel value)
Updated1980NutationModel
(get
).ArgumentNullException
- Thrown when value
is null
.@Nonnull public final EquationOfEquinoxes getEquationOfEquinoxes()
UpdatedEquationOfEquinoxes
(get
).public final void setEquationOfEquinoxes(@Nonnull EquationOfEquinoxes value)
UpdatedEquationOfEquinoxes
(get
).ArgumentNullException
- Thrown when value
is null
.@Nullable public final EarthOrientationParameters getOrientationParameters()
EarthOrientationParameters
.
Normally, this is initialized by default to an empty instance of EarthOrientationParameters
.
However, if the environment variable DME_COMPONENT_LIBRARIES_NO_DEFAULT_EARTH_ORIENTATION_PARAMETERS
is set,
then this will be left null
which will cause exceptions when EOP data is required.
public final void setOrientationParameters(@Nullable EarthOrientationParameters value)
EarthOrientationParameters
.
Normally, this is initialized by default to an empty instance of EarthOrientationParameters
.
However, if the environment variable DME_COMPONENT_LIBRARIES_NO_DEFAULT_EARTH_ORIENTATION_PARAMETERS
is set,
then this will be left null
which will cause exceptions when EOP data is required.
public final double getSlowChangingAxesUpdateInterval()
A number of factors, including nutation, precession, and pole wander, affect the relationship
between the FixedFrame
(get
/ set
) and InertialFrame
(get
/ set
). However, because the impact of
these factors is small, and because they change relatively slowly, it is usually unnecessary to recalculate
these parameters for each new input JulianDate
. Instead, these values can be calculated once
for a "window" of times and reused for all times within that window. This property allows the user to set
the size of the window.
By default, a window size of 0 is used, so these parameters are recomputed for every JulianDate
.
Setting it to 1800 seconds (30 minutes) results in sufficient accuracy for most applications while also
yielding much better performance when transforming between reference frames.
public final void setSlowChangingAxesUpdateInterval(double value)
A number of factors, including nutation, precession, and pole wander, affect the relationship
between the FixedFrame
(get
/ set
) and InertialFrame
(get
/ set
). However, because the impact of
these factors is small, and because they change relatively slowly, it is usually unnecessary to recalculate
these parameters for each new input JulianDate
. Instead, these values can be calculated once
for a "window" of times and reused for all times within that window. This property allows the user to set
the size of the window.
By default, a window size of 0 is used, so these parameters are recomputed for every JulianDate
.
Setting it to 1800 seconds (30 minutes) results in sufficient accuracy for most applications while also
yielding much better performance when transforming between reference frames.
@Nullable public final TerrainProvider getMeanSeaLevel()
This example shows how to create an EGM96 mean sea level surface and configure it for use by all other calculations which need MSL.
EarthCentralBody earth = CentralBodiesFacet.getFromContext().getEarth();
EarthGravityModel96MeanSeaLevel msl = new EarthGravityModel96MeanSeaLevel();
earth.setMeanSeaLevel(msl);
By default, this is null
.
public final void setMeanSeaLevel(@Nullable TerrainProvider value)
This example shows how to create an EGM96 mean sea level surface and configure it for use by all other calculations which need MSL.
EarthCentralBody earth = CentralBodiesFacet.getFromContext().getEarth();
EarthGravityModel96MeanSeaLevel msl = new EarthGravityModel96MeanSeaLevel();
earth.setMeanSeaLevel(msl);
By default, this is null
.
public final int getNaifIdCode()
Gets the NAIF identification code of this central body, barycenter, spacecraft, ground station, or other physical object or location.
A directory of NAIF IDs associated with commonly used Solar System bodies is available at the NAIF website.
getNaifIdCode
in interface IProvideNaifIdCode