|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.nrao.sss.astronomy.PolynomialPositionTable
public class PolynomialPositionTable
A table of polynomial positions
.
This table is sorted according to the natural order of
PolynomialPosition
, which will result in positions with the
earliest valid time intervals preceding those with later intervals.
This table is kept in sorted order at all times.
Version Info:
$Revision: 1156 $ |
$Date: 2008-03-12 11:43:13 -0600 (Wed, 12 Mar 2008) $ |
$Author: dharland $ |
Constructor Summary | |
---|---|
PolynomialPositionTable()
Creates a new instance. |
Method Summary | |
---|---|
boolean |
add(PolynomialPosition newPosition)
Adds newPosition to this table. |
PolynomialPositionTable |
clone()
Returns a copy of this table. |
boolean |
equals(Object o)
Returns true if o is equal to this table. |
PolynomialPosition |
get(Date time)
Returns a position for which time is a valid time. |
PolynomialPosition |
get(int index)
Returns the position at index . |
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 from an origin. |
Distance |
getDistance(Date time)
Returns the distance of this position at the given point in time. |
Distance |
getDistanceUncertainty()
Returns the uncertainty in the distance of this position. |
List<PolynomialPosition> |
getEntries()
Returns a new list that contains references to all the entries in this table. |
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 |
getLatitudeUncertainty()
Returns the uncertainty in the latitude of this position. |
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 |
getLongitudeUncertainty()
Returns the uncertainty in the longitude of this position. |
String |
getOriginOfInformation()
Returns the origin of this position's information. |
SkyPositionType |
getType()
Provides a hint as to how this position stores its information. |
int |
hashCode()
Returns a hash code value for this table. |
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 table has one or more positions for which time is a valid time. |
boolean |
isWellFormed()
Returns true if the valid time intervals of the positions of this table do not overlap and do not contain gaps. |
PolynomialPosition |
remove(int index)
Removes the index th position from this table. |
boolean |
remove(PolynomialPosition unwantedPosition)
Removes the first occurrence of the unwanted position from this table. |
void |
reset()
Clears all entries from this table. |
PolynomialPosition |
set(int index,
PolynomialPosition replacement)
Replaces the position currently at index with
replacement . |
void |
setCoordinateSystem(CelestialCoordinateSystem newSystem)
Sets the coordinate system of all entries in this table. |
void |
setEpoch(Epoch newEpoch)
Sets the epoch of all entries in this table. |
void |
setOriginOfInformation(String newOrigin)
Sets the origin of information of all entries in this table. |
int |
size()
Returns the number of entries in this table. |
void |
sort()
Sorts this table so that its entries are in their natural order. |
void |
sort(Comparator<PolynomialPosition> comparator)
Sorts this table so that its entries are in the order dictated by comparator . |
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 PolynomialPositionTable()
Method Detail |
---|
public void reset()
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 void setCoordinateSystem(CelestialCoordinateSystem newSystem)
newSystem
is null, this method does nothing.
newSystem
- the new coordinate system for all entries in this table.public void setEpoch(Epoch newEpoch)
newEpoch
is null, this method does nothing.
newEpoch
- the new epoch for all entries in this table.public void setOriginOfInformation(String newOrigin)
newOrigin
is null, this method does nothing.
newOrigin
- the new origin of information for all entries
in this table.public boolean add(PolynomialPosition newPosition)
newPosition
to this table.
If newPosition
is null, this method does nothing.
Otherwise this table will hold a reference to newPosition
.
This means that any changes made to newPosition
after
a call to this method will be reflected in this object.
newPosition
- a new position to be added to this table.
newPosition
was added to this table.public boolean remove(PolynomialPosition unwantedPosition)
unwantedPosition
- a position to be removed from this table.
public PolynomialPosition remove(int index)
index
th position from this table.
index
- to index of the position to be removed.
index
.public PolynomialPosition set(int index, PolynomialPosition replacement)
index
with
replacement
.
If newPosition
is null, this method does nothing.
Otherwise this table will hold a reference to newPosition
.
This means that any changes made to newPosition
after
a call to this method will be reflected in this object.
index
- the index of the position to be replaced.replacement
- the new position for the index
th
slot in this table.
index
.public PolynomialPosition get(int index)
index
.
Note that the returned position is the one actually held by this table. This means that any changes made to it after a call to this method will be reflected in this object.
index
- the index of the desired position.
index
.public PolynomialPosition get(Date time)
time
is a valid time.
If this table has no such position, null is returned. If this table has more than one such position, the one held at the index of lowest value will be returned. Just which position that is depends on whether, and how, this table was most recently sorted by its clients.
Note that the returned position is the one actually held by this table. This means that any changes made to it after a call to this method will be reflected in this object.
time
- the time for which a position is desired. The returned
position, unless it is null will have a valid time
interval that contains this value.
time
is a valid time, or
null if this table has no such position.public List<PolynomialPosition> getEntries()
public int size()
public boolean isValidFor(Date time)
time
is a valid time.
time
- the time for which a valid position is sought.
time
is a valid time.public boolean isWellFormed()
public void sort()
public void sort(Comparator<PolynomialPosition> comparator)
comparator
.
public SkyPositionType getType()
SkyPosition
getType
in interface SkyPosition
public CelestialCoordinateSystem getCoordinateSystem()
SkyPosition
getCoordinateSystem
in interface SkyPosition
public Epoch getEpoch()
SkyPosition
getEpoch
in interface SkyPosition
public String getOriginOfInformation()
SkyPosition
getOriginOfInformation
in interface SkyPosition
public Longitude getLongitude()
SphericalPosition
Classes that implement this interface are free to choose whether to return a reference to their internal longitudes, or to provide copies thereof. This means that clients of this interface should not write code that manipulates the returned object and relies on those changes being reflected in this object, unless they know they are using an implementation that returns internal references.
getLongitude
in interface SphericalPosition
public Latitude getLatitude()
SphericalPosition
Classes that implement this interface are free to choose whether to return a reference to their internal latitudes, or to provide copies thereof. This means that clients of this interface should not write code that manipulates the returned object and relies on those changes being reflected in this object, unless they know they are using an implementation that returns internal references.
getLatitude
in interface SphericalPosition
public Distance getDistance()
SphericalPosition
Classes that implement this interface are free to choose whether to return a reference to their internal distances, or to provide copies thereof. This means that clients of this interface should not write code that manipulates the returned object and relies on those changes being reflected in this object, unless they know they are using an implementation that returns internal references.
getDistance
in interface SphericalPosition
public Longitude getLongitude(Date time)
SkyPosition
Classes that implement this interface are free to choose whether to return a reference to their internal longitudes, or to provide copies thereof. This means that clients of this interface should not write code that manipulates the returned object and relies on those changes being reflected in this object, unless they know they are using an implementation that returns internal references.
getLongitude
in interface SkyPosition
time
- the point in time for which the longitude is sought.
public Latitude getLatitude(Date time)
SkyPosition
Classes that implement this interface are free to choose whether to return a reference to their internal latitudes, or to provide copies thereof. This means that clients of this interface should not write code that manipulates the returned object and relies on those changes being reflected in this object, unless they know they are using an implementation that returns internal references.
getLatitude
in interface SkyPosition
time
- the point in time for which the latitude is sought.
public Distance getDistance(Date time)
SkyPosition
Classes that implement this interface are free to choose whether to return a reference to their internal distances, or to provide copies thereof. This means that clients of this interface should not write code that manipulates the returned object and relies on those changes being reflected in this object, unless they know they are using an implementation that returns internal references.
getDistance
in interface SkyPosition
time
- the point in time for which the distance is sought.
public Longitude getLongitudeUncertainty()
SphericalPosition
Classes that implement this interface are free to choose whether to return a reference to their internal uncertainties, or to provide copies thereof. This means that clients of this interface should not write code that manipulates the returned object and relies on those changes being reflected in this object, unless they know they are using an implementation that returns internal references.
getLongitudeUncertainty
in interface SphericalPosition
public Latitude getLatitudeUncertainty()
SphericalPosition
Classes that implement this interface are free to choose whether to return a reference to their internal uncertainties, or to provide copies thereof. This means that clients of this interface should not write code that manipulates the returned object and relies on those changes being reflected in this object, unless they know they are using an implementation that returns internal references.
getLatitudeUncertainty
in interface SphericalPosition
public Distance getDistanceUncertainty()
SphericalPosition
Classes that implement this interface are free to choose whether to return a reference to their internal uncertainties, or to provide copies thereof. This means that clients of this interface should not write code that manipulates the returned object and relies on those changes being reflected in this object, unless they know they are using an implementation that returns internal references.
getDistanceUncertainty
in interface SphericalPosition
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
.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 PolynomialPositionTable clone()
If anything goes wrong during the cloning procedure,
a RuntimeException
will be thrown.
clone
in interface SkyPosition
clone
in interface SphericalPosition
clone
in class Object
public boolean equals(Object o)
o
is equal to this table.
equals
in class Object
public int hashCode()
hashCode
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |