|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.nrao.sss.astronomy.SimpleSkyPosition
public class SimpleSkyPosition
A very basic implementation of a sky position
.
Version Info:
$Revision: 1156 $ |
$Date: 2008-03-12 11:43:13 -0600 (Wed, 12 Mar 2008) $ |
$Author: dharland $ |
Constructor Summary | |
---|---|
SimpleSkyPosition()
Creates a new equatorial, J2000, position. |
|
SimpleSkyPosition(CelestialCoordinateSystem system,
Epoch epoch)
Creates a new instance with the given properties. |
Method Summary | |
---|---|
SimpleSkyPosition |
clone()
Returns a copy of this sky position. |
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 |
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 |
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 position. |
boolean |
isMoving()
Returns true if this position has different properties at time T than it does at time U ≠ T. |
void |
reset()
Puts this instance into the same state as one newly created via the no-argument constructor. |
void |
setCoordinateSystem(CelestialCoordinateSystem newSystem)
Sets the system of latitude and longitude on which this position is based. |
void |
setDistance(Distance newDistance)
Sets the distance of this position. |
void |
setDistanceUncertainty(Distance newUncertainty)
Sets the uncertainty in the distance of this position. |
void |
setEpoch(Epoch newEpoch)
Sets the epoch on which this position is based. |
void |
setLatitude(Latitude newLatitude)
Sets the latitude of this position. |
void |
setLatitudeUncertainty(Latitude newUncertainty)
Sets the uncertainty in the latitude of this position. |
void |
setLongitude(Longitude newLongitude)
Sets the longitude of this position. |
void |
setLongitudeUncertainty(Longitude newUncertainty)
Sets the uncertainty in the longitude of this position. |
void |
setOriginOfInformation(String origin)
Sets the origin of this position's information. |
PolynomialPosition |
toPolynomialPosition()
Creates and returns a new polynomial position whose time-zero values are the same as those of this position. |
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. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SimpleSkyPosition()
public SimpleSkyPosition(CelestialCoordinateSystem system, Epoch epoch)
Method Detail |
---|
public void reset()
public SkyPositionType getType()
SkyPosition
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.
public void setLongitude(Longitude newLongitude)
If newLongitude
is null, this method creates, and saves a
reference to, a new longitude object. Otherwise it saves a reference
to newLongitude
. This means that any changes made to
(a non-null) newLongitude
by clients after this call
will be reflected in this position.
newLongitude
- a new longitude for this position.public Longitude getLongitude()
The returned object is guaranteed to be non-null and is also a reference to the internal longitude held by this position. This means any changes made by clients to the returned object will be reflected in this position.
getLongitude
in interface SphericalPosition
public void setLatitude(Latitude newLatitude)
If newLatitude
is null, this method creates, and saves a
reference to, a new latitude object. Otherwise it saves a reference
to newLatitude
. This means that any changes made to
(a non-null) newLatitude
by clients after this call
will be reflected in this position.
newLatitude
- a new latitude for this position.public Latitude getLatitude()
The returned object is guaranteed to be non-null and is also a reference to the internal latitude held by this position. This means any changes made by clients to the returned object will be reflected in this position.
getLatitude
in interface SphericalPosition
public void setDistance(Distance newDistance)
If newDistance
is null, this method creates, and saves a
reference to, a new distance object. Otherwise it saves a reference
to newDistance
. This means that any changes made to
(a non-null) newDistance
by clients after this call
will be reflected in this position.
newDistance
- a new distance for this position.public Distance getDistance()
The returned object is guaranteed to be non-null and is also a reference to the internal distance held by this position. This means any changes made by clients to the returned object will be reflected in this position.
getDistance
in interface SphericalPosition
public Longitude getLongitude(Date time)
The returned object is guaranteed to be non-null and is also a reference to the internal longitude held by this position. This means any changes made by clients to the returned object will be reflected in this position.
Since this class has no concept of time, the value returned here will be the same as that returned by the corresponding no-argument method.
time
- the point in time for which the longitude is sought.
public Latitude getLatitude(Date time)
The returned object is guaranteed to be non-null and is also a reference to the internal latitude held by this position. This means any changes made by clients to the returned object will be reflected in this position.
Since this class has no concept of time, the value returned here will be the same as that returned by the corresponding no-argument method.
time
- the point in time for which the latitude is sought.
public Distance getDistance(Date time)
The returned object is guaranteed to be non-null and is also a reference to the internal distance held by this position. This means any changes made by clients to the returned object will be reflected in this position.
Since this class has no concept of time, the value returned here will be the same as that returned by the corresponding no-argument method.
time
- the point in time for which the distance is sought.
public void setLongitudeUncertainty(Longitude newUncertainty)
If newUncertainty
is null, this method creates, and saves a
reference to, a new longitude object. Otherwise it saves a reference
to newUncertainty
. This means that any changes made to
(a non-null) newUncertainty
by clients after this call
will be reflected in this position.
newUncertainty
- a new value for the uncertainty of the longitude of
this position.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 void setLatitudeUncertainty(Latitude newUncertainty)
If newUncertainty
is null, this method creates, and saves a
reference to, a new latitude object. Otherwise it saves a reference
to newUncertainty
. This means that any changes made to
(a non-null) newUncertainty
by clients after this call
will be reflected in this position.
newUncertainty
- a new value for the uncertainty of the latitude of
this position.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 void setDistanceUncertainty(Distance newUncertainty)
If newUncertainty
is null, this method creates, and saves a
reference to, a new distance object. Otherwise it saves a reference
to newUncertainty
. This means that any changes made to
(a non-null) newUncertainty
by clients after this call
will be reflected in this position.
newUncertainty
- a new value for the uncertainty of the distance of
this position.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 toPolynomialPosition()
public String toString()
toString
in class Object
public SimpleSkyPosition 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 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 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 |