|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.nrao.sss.astronomy.PolynomialPosition
public class PolynomialPosition
A position of an astronomical source that is described by a collection of polynomial equations.
The viewpoint of this class is that the position of a source may be described by its location (right ascension, declination, and distance) at a particular reference time and a set of equations that describe the motions of the source away from that location.
Version Info:
$Revision: 1707 $ |
$Date: 2008-11-14 10:23:59 -0700 (Fri, 14 Nov 2008) $ |
$Author: dharland $ |
Constructor Summary | |
---|---|
PolynomialPosition()
Creates a new instance. |
Method Summary | |
---|---|
PolynomialPosition |
clone()
Returns a copy of this polynomial position. |
int |
compareTo(PolynomialPosition other)
Compares this position to other for order. |
boolean |
equals(Object o)
Returns true if o is equal to this position. |
Angle |
getAngularSeparation(SphericalPosition other)
Calculates the current angular separation between this position and other . |
Angle |
getAngularSeparation(SphericalPosition other,
Date time)
Calculates current angular separation between this position and other at the given time. |
CelestialCoordinateSystem |
getCoordinateSystem()
Returns the coordinate system to use when interpreting the latitude and longitude values of this position. |
Distance |
getDistance()
Returns the current distance of this position. |
Distance |
getDistance(Date time)
Returns the distance of this position at the given point in time. |
Distance |
getDistanceAtTimeZero()
Returns the distance of this position as of the reference time. |
Distance |
getDistanceUncertainty()
Returns the uncertainty in the distance of this position. |
Epoch |
getEpoch()
Returns the epoch on which this position is based. |
Latitude |
getLatitude()
Returns the current latitude of this position. |
Latitude |
getLatitude(Date time)
Returns the latitude of this position at the given point in time. |
Latitude |
getLatitudeAtTimeZero()
Returns the latitude of this position as of the reference time. |
Polynomial |
getLatitudeMotion()
Returns the polynomial, in delta-t, for calculating change in the latitude of this position since the reference time. |
Latitude |
getLatitudeUncertainty()
Returns the uncertainty in the latitude of this position. |
AngularVelocityUnits |
getLatitudeVelocityUnits()
Returns the units that will be used to interpret the the latitude motion polynomial. |
Longitude |
getLongitude()
Returns the current longitude of this position. |
Longitude |
getLongitude(Date time)
Returns the longitude of this position at the given point in time. |
Longitude |
getLongitudeAtTimeZero()
Returns the longitude of this position as of the reference time. |
Polynomial |
getLongitudeMotion()
Returns the polynomial, in delta-t, for calculating change in the longitude of this position since the reference time. |
Longitude |
getLongitudeUncertainty()
Returns the uncertainty in the longitude of this position. |
AngularVelocityUnits |
getLongitudeVelocityUnits()
Returns the units that will be used to interpret the the longitude motion polynomial. |
String |
getOriginOfInformation()
Returns the origin of this position's information. |
Polynomial |
getRadialMotion()
Returns the polynomial, in delta-t, for calculating change in the distance of this position since the reference time. |
LinearVelocityUnits |
getRadialVelocityUnits()
Returns the units that will be used to interpret the the distance motion polynomial. |
Date |
getReferenceTime()
Returns the time at which the delta-t terms in the motion polynomials evaluate to zero. |
SkyPositionType |
getType()
Provides a hint as to how this position stores its information. |
TimeInterval |
getValidTime()
Returns the interval of time for which this position is valid. |
int |
hashCode()
Returns a hash code value for this position. |
boolean |
isMoving()
Returns true if this position has different properties at time T than it does at time U ≠ T. |
boolean |
isValidFor(Date time)
Returns true if this position is valid for the given point in time. |
void |
reset()
Resets this position to its initial state. |
void |
setCoordinateSystem(CelestialCoordinateSystem newSystem)
Sets the system of latitude and longitude on which this position is based. |
void |
setDistanceAtTimeZero(Distance distance)
Sets the distance of this position as of the reference time. |
void |
setDistanceUncertainty(Distance uncertainty)
Sets the uncertainty level in the distance of this position. |
void |
setEpoch(Epoch newEpoch)
Sets the epoch on which this position is based. |
void |
setLatitudeAtTimeZero(Latitude latitude)
Sets the latitude of this position as of the reference time. |
void |
setLatitudeMotion(Polynomial latitudeEqn)
Sets this position's latitude motion equation to latitudeEqn . |
void |
setLatitudeUncertainty(Latitude uncertainty)
Sets the uncertainty level in the latitude of this position. |
void |
setLatitudeVelocityUnits(AngularVelocityUnits units)
Sets the units that will be used to interpret the declination motion polynomial. |
void |
setLongitudeAtTimeZero(Longitude longitude)
Sets the longitude of this position as of the reference time. |
void |
setLongitudeMotion(Polynomial longitudeEqn)
Sets this position's longitude motion equation to longitudeEqn . |
void |
setLongitudeUncertainty(Longitude uncertainty)
Sets the uncertainty level in the longitude of this position. |
void |
setLongitudeVelocityUnits(AngularVelocityUnits units)
Sets the units that will be used to interpret the longitude motion polynomial. |
void |
setOriginOfInformation(String origin)
Sets the origin of this position's information. |
void |
setRadialMotion(Polynomial distanceEquation)
Sets this position's distance motion equation to distanceEquation . |
void |
setRadialVelocityUnits(LinearVelocityUnits units)
Sets the units that will be used to interpret the distance motion polynomial. |
void |
setReferenceTime(Date referenceTime)
Sets the time at which the delta-t terms in the motion polynomials evaluate to zero. |
void |
setValidTime(TimeInterval interval)
Sets the interval of time for which this position is valid. |
SkyPosition |
toPosition(CelestialCoordinateSystem system,
Epoch epoch,
EarthPosition observer,
LocalSiderealTime lst)
Returns a new position expressed in the given coordinate system and epoch that is equivalent to this position. |
SkyPosition |
toPosition(CelestialCoordinateSystem system,
Epoch epoch,
EarthPosition observer,
LocalSiderealTime lst,
CelestialCoordinateConverter converter)
Returns a new position expressed in the given coordinate system and epoch that is equivalent to this position. |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PolynomialPosition()
Method Detail |
---|
public void reset()
PolynomialPosition()
constructor.
public boolean isMoving()
SkyPosition
The determination of motion will be made with respect to the coordinate system in which this position is expressed. For example, a position that is expressed in the equatorial system, and that is holding steady at its position in that system, will said to be not moving, even though in other coordinate systems it may be moving quite rapidly.
isMoving
in interface SkyPosition
public SkyPositionType getType()
SkyPosition
getType
in interface SkyPosition
public void setReferenceTime(Date referenceTime)
The motion polynomials are returned by the methods
getLatitudeMotion()
,
getLongitudeMotion()
, and
getRadialMotion()
.
At the reference time t0, these equations should
evaluate to zero.
If referenceTime
is null, an
IllegalArgumentException
will be thrown.
referenceTime
- t0 for the motion terms.public Date getReferenceTime()
setReferenceTime(Date)
for more information.
public void setValidTime(TimeInterval interval)
If interval
is null, it will be treated as
an non-null interval of zero length.
interval
- the interval of time for which this position is valid.public TimeInterval getValidTime()
public boolean isValidFor(Date time)
time
- the point in time to be checked.public Polynomial getLongitudeMotion()
The independent variable should be delta-t, with time measured in
units determined by the value sent to
setLongitudeVelocityUnits(AngularVelocityUnits)
.
The polynomial returned is the one held by this source position,
so any changes made to it will be reflected here.
Note that this means that client objects need never use the set
method. Instead, they may just use this method and manipulate the
polynomial.
public void setLongitudeMotion(Polynomial longitudeEqn)
longitudeEqn
.
See getLongitudeMotion()
for an explanation of the
independent variable and its coefficients.
This method will save a reference to longitudeEqn
; it will
not make and store a clone. This means that any changes made
to longitudeEqn
after calling this method will be reflected
in this position.
Note that it is not necessary to use this set
method; clients
may choose to interact only with the get
method and manipulate
the returned polynomial.
If longitudeEqn
is null, a new empty polynomial will be
created and used for this motion.
longitudeEqn
- the longitude motion equation for this position.public Polynomial getLatitudeMotion()
The independent variable should be delta-t, with time measured in
units determined by the value sent to
setLatitudeVelocityUnits(AngularVelocityUnits)
.
The polynomial returned is the one held by this source position,
so any changes made to it will be reflected here.
Note that this means that client objects need never use the set
method. Instead, they may just use this method and manipulate the
polynomial.
public void setLatitudeMotion(Polynomial latitudeEqn)
latitudeEqn
.
See getLatitudeMotion()
for an explanation of the
independent variable and its coefficients.
This method will save a reference to latitudeEqn
; it will
not make and store a clone. This means that any changes made
to latitudeEqn
after calling this method will be reflected
in this position.
Note that it is not necessary to use this set
method; clients
may choose to interact only with the get
method and manipulate
the returned polynomial.
If latitudeEqn
is null, a new empty polynomial will be
created and used for this motion.
latitudeEqn
- the latitude motion equation for this position.public Polynomial getRadialMotion()
The independent variable should be delta-t, with time measured in
units determined by the value sent to
setRadialVelocityUnits(LinearVelocityUnits)
.
The polynomial returned is the one held by this source position,
so any changes made to it will be reflected here.
Note that this means that client objects need never use the set
method. Instead, they may just use this method and manipulate the
polynomial.
public void setRadialMotion(Polynomial distanceEquation)
distanceEquation
.
See getRadialMotion()
for an explanation of the
independent variable and its coefficients.
This method will save a reference to distanceEquation
; it will
not make and store a clone. This means that any changes made
to distanceEquation
after calling this method will be reflected
in this position.
Note that it is not necessary to use this set
method; clients
may choose to interact only with the get
method and manipulate
the returned polynomial.
If distanceEquation
is null, a new empty polynomial will be
created and used for this motion.
distanceEquation
- the distance motion equation for this position.public void setLongitudeVelocityUnits(AngularVelocityUnits units)
AngularVelocityUnits.MILLI_ARC_SECONDS_PER_YEAR
.
This property will be used by the
getLongitude
methods.
Those methods will assume that all terms
will be based on the logical extension of these units.
units
- the units to use when interpreting the longitude
motion polynomial. If units
is null,
this method will do nothing.public void setLatitudeVelocityUnits(AngularVelocityUnits units)
AngularVelocityUnits.MILLI_ARC_SECONDS_PER_YEAR
.
This property will be used by the
getLatitude
methods.
Those methods will assume that all terms
will be based on the logical extension of these units.
units
- the units to use when interpreting the declination
motion polynomial. If units
is null,
this method will do nothing.public void setRadialVelocityUnits(LinearVelocityUnits units)
LinearVelocityUnits.KILOMETERS_PER_SECOND
.
This property will be used by the
getDistance
methods.
Those methods will assume that all terms
will be based on the logical extension of these units.
units
- the units to use when interpreting the distance
motion polynomial. If units
is null,
it will be replaced by a non-null default type.public AngularVelocityUnits getLongitudeVelocityUnits()
setLongitudeVelocityUnits(AngularVelocityUnits)
public AngularVelocityUnits getLatitudeVelocityUnits()
setLatitudeVelocityUnits(AngularVelocityUnits)
public LinearVelocityUnits getRadialVelocityUnits()
setRadialVelocityUnits(LinearVelocityUnits)
public void setLongitudeAtTimeZero(Longitude longitude)
This method will save a reference to longitude
; it will
not make and store a clone. This means that any changes made
to longitude
after calling this method will be reflected
in this position.
longitude
- the longitude of this position as of the reference time.
If this value is null it will be treated
as a new longitude built via the no-argument
constructor.public Longitude getLongitudeAtTimeZero()
public void setLatitudeAtTimeZero(Latitude latitude)
This method will save a reference to latitude
; it will
not make and store a clone. This means that any changes made
to latitude
after calling this method will be reflected
in this position.
latitude
- the latitude of this position as of the reference time.
If this value is null it will be treated
as a new latitude built via the no-argument
constructor.public Latitude getLatitudeAtTimeZero()
public void setDistanceAtTimeZero(Distance distance)
This method will save a reference to distance
; it will
not make and store a clone. This means that any changes made
to distance
after calling this method will be reflected
in this position.
distance
- the distance of this position as of the reference time.
If this value is null it will be treated
as a new distance built via the no-argument
constructor.public Distance getDistanceAtTimeZero()
public Longitude getLongitude(Date time)
The returned value is guaranteed to be non-null. Note that the object returned is not held internally by this position. This means that any changes made to the returned object by clients will not be reflected in this position.
getLongitude
in interface SkyPosition
time
- the point in time for which the longitude is sought.
public Latitude getLatitude(Date time)
The returned value is guaranteed to be non-null. Note that the object returned is not held internally by this position. This means that any changes made to the returned object by clients will not be reflected in this position.
getLatitude
in interface SkyPosition
time
- the point in time for which the latitude is sought.
public Distance getDistance(Date time)
The returned value is guaranteed to be non-null. Note that the object returned is not held internally by this position. This means that any changes made to the returned object by clients will not be reflected in this position.
getDistance
in interface SkyPosition
time
- the point in time for which the distance is sought.
public void setLongitudeUncertainty(Longitude uncertainty)
Note that, unless uncertainty
is null, this position
will hold a reference to uncertainty
. That is, this method
will not make a copy of uncertainty
. This means that any
changes made to uncertainty
will be reflected here. Note, too,
that this method is not strictly required. Clients could instead
call getLongitudeUncertainty()
and operate on the returned
object.
uncertainty
- the uncertainty level in the longitude of
this position. An uncertainty
of null
will be treated as an uncertainty of zero.public void setLatitudeUncertainty(Latitude uncertainty)
Note that, unless uncertainty
is null, this position
will hold a reference to uncertainty
. That is, this method
will not make a copy of uncertainty
. This means that any
changes made to uncertainty
will be reflected here. Note, too,
that this method is not strictly required. Clients could instead
call getLatitudeUncertainty()
and operate on the returned
object.
uncertainty
- the uncertainty level in the latitude of
this position. An uncertainty
of null
will be treated as an uncertainty of zero.public void setDistanceUncertainty(Distance uncertainty)
Note that, unless uncertainty
is null, this position
will hold a reference to uncertainty
. That is, this method
will not make a copy of uncertainty
. This means that any
changes made to uncertainty
will be reflected here. Note, too,
that this method is not strictly required. Clients could instead
call getDistanceUncertainty()
and operate on the returned
object.
uncertainty
- the uncertainty level in the distance of
this position. An uncertainty
of null
will be treated as an uncertainty of zero.public Longitude getLongitudeUncertainty()
The returned object is guaranteed to be non-null and is also a reference to the internal uncertainty held by this position. This means any changes made by clients to the returned object will be reflected in this position.
getLongitudeUncertainty
in interface SphericalPosition
public Latitude getLatitudeUncertainty()
The returned object is guaranteed to be non-null and is also a reference to the internal uncertainty held by this position. This means any changes made by clients to the returned object will be reflected in this position.
getLatitudeUncertainty
in interface SphericalPosition
public Distance getDistanceUncertainty()
The returned object is guaranteed to be non-null and is also a reference to the internal uncertainty held by this position. This means any changes made by clients to the returned object will be reflected in this position.
getDistanceUncertainty
in interface SphericalPosition
public PolynomialPosition clone()
If anything goes wrong during the cloning procedure,
a RuntimeException
will be thrown.
clone
in interface SkyPosition
clone
in interface SphericalPosition
public boolean equals(Object o)
o
is equal to this position.
public int hashCode()
public int compareTo(PolynomialPosition other)
other
for order.
One position is deemed to be "less than" the other if it has a valid time range that is less than that of the other. In the case that two positions have the same valid time range, the reference time is used as a tie-breaker. If these are the same other attributes are compared until a difference is found. If none are found, the return value is zero.
compareTo
in interface Comparable<PolynomialPosition>
other
- the time interval to which this one is compared.
public void setCoordinateSystem(CelestialCoordinateSystem newSystem)
newSystem
is null, this method does nothing.
newSystem
- the system of latitude and longitude on which this
position is based.public CelestialCoordinateSystem getCoordinateSystem()
SkyPosition
getCoordinateSystem
in interface SkyPosition
public void setEpoch(Epoch newEpoch)
newEpoch
is null, this method does nothing.
newEpoch
- the epoch on which this position is based.public Epoch getEpoch()
SkyPosition
getEpoch
in interface SkyPosition
public void setOriginOfInformation(String origin)
origin
- the origin of this position's information. A value of
null will be replaced by a non-null default value.public String getOriginOfInformation()
SkyPosition
getOriginOfInformation
in interface SkyPosition
public Longitude getLongitude()
This is convenience method equivalent to getLongitude(new Date())
.
As such, whether or not the returned longitude is a reference to an
internally held object depends upon the behavior of
getLongitude(Date)
.
getLongitude
in interface SphericalPosition
public Latitude getLatitude()
This is convenience method equivalent to getLatitude(new Date())
.
As such, whether or not the returned latitude is a reference to an
internally held object depends upon the behavior of
getLatitude(Date)
.
getLatitude
in interface SphericalPosition
public Distance getDistance()
This is convenience method equivalent to getDistance(new Date())
.
As such, whether or not the returned distance is a reference to an
internally held object depends upon the behavior of
getDistance(Date)
.
getDistance
in interface SphericalPosition
public SkyPosition toPosition(CelestialCoordinateSystem system, Epoch epoch, EarthPosition observer, LocalSiderealTime lst) throws CoordinateConversionException
SkyPosition
toPosition
in interface SkyPosition
system
- the celestial coordinate system of the returned position.epoch
- the epoch of the returned position.observer
- the location of the observer. This value is used almost exclusively for
conversions to or from the HORIZONTAL (az/el) coordinate system.
If a given conversion does not require this parameter, a null
value will do no harm.lst
- the local sidereal time at the observer's location. This parameter
serves two purposes. First, it is integral in conversions to or from
the HORIZONTAL (az/el) coordinate system. Second, even for
conversions that do not depend on the observer's location, the conversion
method will use the UTC time represented by this LST to determine the
exact location of this position before converting it to another
system. When used this way the location associated with the LST is
immaterial. If this value is null it will be replaced with
the current time. Using a null value is not recommended when
dealing with the HORIZONTAL system because the LST may not
be for the location of interest.
system
, and
epoch of epoch
, and coordinates that represent a conversion
from those of this position.
CoordinateConversionException
- if anything goes wrong with the conversion.public SkyPosition toPosition(CelestialCoordinateSystem system, Epoch epoch, EarthPosition observer, LocalSiderealTime lst, CelestialCoordinateConverter converter) throws CoordinateConversionException
SkyPosition
toPosition
in interface SkyPosition
system
- the celestial coordinate system of the returned position.epoch
- the epoch of the returned position.observer
- the location of the observer. This value is used almost exclusively for
conversions to or from the HORIZONTAL (az/el) coordinate system.lst
- the local sidereal time at the observer's location. This parameter
serves two purposes. First, it is integral in conversions to or from
the HORIZONTAL (az/el) coordinate system. Second, even for
conversions that do not depend on the observer's location, the conversion
method will use the UTC time represented by this LST to determine the
exact location of this position before converting it to another
system. When used this way the location associated with the LST is
immaterial. If this value is null it will be replaced with
the current time. Using a null value is not recommended when
dealing with the HORIZONTAL system because the LST may not
be for the location of interest.converter
- the converter used to perform the transformation.
system
, and
epoch of epoch
, and coordinates that represent a conversion
from those of this position.
CoordinateConversionException
- if anything goes wrong with the conversion.public Angle getAngularSeparation(SphericalPosition other)
SphericalPosition
other
.
The distances of the positions from the center of the sphere are
not considered. The returned angle is the smallest possible
such angle. It is the angular size of the arc of a great circle that
passes through both the ray from the orgin to this position and the
ray from the origin to other
.
The returned value is never negative. This means that the returned angle does not contain directional information. That is, the angle from A to B is exactly equal to the angle from B to A.
getAngularSeparation
in interface SphericalPosition
other
- a position from which this one is separated by the
returned angle.
other
.public Angle getAngularSeparation(SphericalPosition other, Date time)
SkyPosition
other
at the given time.
The distances of the positions from the center of the sphere are
not considered. The returned angle is the smallest possible
such angle. It is the angular size of the arc of a great circle that
passes through both the ray from the orgin to this position and the
ray from the origin to other
.
The returned value is never negative. This means that the returned angle does not contain directional information. That is, the angle from A to B is exactly equal to the angle from B to A.
getAngularSeparation
in interface SkyPosition
other
- a position from which this one is separated by the
returned angle.time
- the point in time for which the separation is sought.
other
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |