|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.nrao.sss.geom.EarthPosition
public class EarthPosition
A position on, in, or above the earth. The most common use of this class is for surface positions, where the position is given in terms of longitude, latitude, and elevation above mean sea level. The time zone for this position may also be specified.
Instances of this class are immutable. The mutable objects contained within this class are always cloned before being accepted or passed out.
Version Info:
$Revision: 1625 $ |
$Date: 2008-10-16 09:28:49 -0600 (Thu, 16 Oct 2008) $ |
$Author: dharland $ (last person to modify) |
Constructor Summary | |
---|---|
EarthPosition()
Creates a null-like position in which all component values are zero. |
|
EarthPosition(Longitude longitude,
Latitude latitude,
Distance distance,
TimeZone timeZone)
Creates a new position at the given location. |
|
EarthPosition(Longitude lon,
Latitude lat,
Distance dist,
TimeZone tz,
Longitude lonUncertainty,
Latitude latUncertainty,
Distance distUncertainty)
Creates a new position at the given location. |
|
EarthPosition(Longitude longitude,
Latitude latitude,
TimeZone timeZone)
Creates a new position at the given location. |
Method Summary | |
---|---|
static LinearVelocity |
calcRevolutionVelocityToward(uk.ac.starlink.pal.AngleDR positionOfDate,
Date calcDate,
boolean useHelio)
Calculates the velocity in the direction of the given sky position due to the revolution of the earth around the sun or barycenter. |
static Angle |
calculateAngularSeparation(Latitude latitude1,
Latitude latitude2,
Longitude longitude1,
Longitude longitude2)
Calculates the angular separation between two positions. |
LinearVelocity |
calcVelocityRelativeTo(SkyPosition skyPosition,
Date calcTime,
VelocityFrame referenceFrame)
Returns the velocity of this position to the given sky position at a particular point in time and with respect to the given frame of reference. |
EarthPosition |
clone()
Returns a copy of this 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 . |
Distance |
getDistance()
Returns a copy of this position's distance. |
Distance |
getDistanceUncertainty()
Returns a copy of the uncertainty in this position's distance. |
Latitude |
getLatitude()
Returns a copy of this position's latitude. |
Latitude |
getLatitudeUncertainty()
Returns a copy of the uncertainty in this position's latitude. |
LocalSiderealTime |
getLocalSiderealTime()
Returns the current local sidereal time at this location. |
Longitude |
getLongitude()
Returns a copy of this position's longitude. |
Longitude |
getLongitudeUncertainty()
Returns a copy of the uncertainty in this position's longitude. |
Angle |
getParallacticAngle(Longitude rightAscension,
Latitude declination,
Date dateTime)
Returns the parallactic angle to the given sky coordinates from this location at the specified time. |
TimeZone |
getTimeZone()
Returns a copy of the time zone in effect at this position. |
int |
hashCode()
Returns a hash code value for this position. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public EarthPosition(Longitude lon, Latitude lat, Distance dist, TimeZone tz, Longitude lonUncertainty, Latitude latUncertainty, Distance distUncertainty)
Any parameter that is null will be treated as a value of zero. Values that are not null will be copied into this class, not referenced. This means changes made to a parameter object after creation of an instance of this class will not be reflected herein.
lon
- the longitude of this position.
A value of null will be treated as a value of zero.lat
- the latitude of this position.
A value of null will be treated as a value of zero.dist
- the distance (normally a height above or below sea level) of this
position.
A value of null will be treated as a value of zero.tz
- the time zone of this position.
If this value is null, a simple algorithm based on the
longitude will be used to create a time zone value. It is
very likely that this calculated time zone will not be the
true time zone of this position.lonUncertainty
- the uncertainty in the longitude of this position.
A value of null will be treated as a value of zero.latUncertainty
- the uncertainty in the latitude of this position.
A value of null will be treated as a value of zero.distUncertainty
- the uncertainty in the distance of this position.
A value of null will be treated as a value of zero.public EarthPosition(Longitude longitude, Latitude latitude, Distance distance, TimeZone timeZone)
longitude
- the longitude of this position.
A value of null will be treated as a value of zero.latitude
- the latitude of this position.
A value of null will be treated as a value of zero.distance
- the distance (normally a height above or below sea level) of this
position.
A value of null will be treated as a value of zero.timeZone
- the time zone of this position.
If this value is null, a simple algorithm based on the
longitude will be used to create a time zone value. It is
very likely that this calculated time zone will not be the
true time zone of this position.public EarthPosition(Longitude longitude, Latitude latitude, TimeZone timeZone)
longitude
- the longitude of this position.
A value of null will be treated as a value of zero.latitude
- the latitude of this position.
A value of null will be treated as a value of zero.timeZone
- the time zone of this position.
If this value is null, a simple algorithm based on the
longitude will be used to create a time zone value. It is
very likely that this calculated time zone will not be the
true time zone of this position.public EarthPosition()
Method Detail |
---|
public Longitude getLongitude()
getLongitude
in interface SphericalPosition
public Latitude getLatitude()
getLatitude
in interface SphericalPosition
public Distance getDistance()
getDistance
in interface SphericalPosition
public TimeZone getTimeZone()
public Longitude getLongitudeUncertainty()
getLongitudeUncertainty
in interface SphericalPosition
public Latitude getLatitudeUncertainty()
getLatitudeUncertainty
in interface SphericalPosition
public Distance getDistanceUncertainty()
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 static Angle calculateAngularSeparation(Latitude latitude1, Latitude latitude2, Longitude longitude1, Longitude longitude2)
The preferred means of getting the angular separation between one
position and another is getAngularSeparation(SphericalPosition)
.
This method is made available to other classes that might need
to embed this algorithm into their own logic.
Note that this method does not consider distance, but only the angular components of a spherical position.
latitude1
- the latitude of the first position.latitude2
- the latitude of the second position.longitude1
- the longitude of the first position.longitude2
- the longitude of the second position.
public LinearVelocity calcVelocityRelativeTo(SkyPosition skyPosition, Date calcTime, VelocityFrame referenceFrame) throws CoordinateConversionException
skyPosition
- a position in the sky toward or from which velocity is to be calculated.calcTime
- the point in time at which the velocity is calculated.referenceFrame
- the frame of reference used in the velocity calculation. The
skyPosition
is assumed to be motionless relative to this frame.
The UNKNOWN and COSMIC_MICROWAVE_BACKGROUND types
are unsupported and will result in an IllegalArgumentException
.
CoordinateConversionException
- if skyPosition
cannot be converted to an equatorial
RA / Dec position.
IllegalArgumentException
- if the referenceFrame
is either
UNKNOWN or COSMIC_MICROWAVE_BACKGROUND.public static LinearVelocity calcRevolutionVelocityToward(uk.ac.starlink.pal.AngleDR positionOfDate, Date calcDate, boolean useHelio)
This method was originally intended for the private use of this class. It was made public so that a test program could display the value.
public LocalSiderealTime getLocalSiderealTime()
public Angle getParallacticAngle(Longitude rightAscension, Latitude declination, Date dateTime)
Some links:
rightAscension
- the right ascension of the sky position for which the parallactic
angle is desired.declination
- the declination of the sky position for which the parallactic
angle is desired.dateTime
- the time for which the parallactic angle is desired.
public String toString()
toString
in class Object
public EarthPosition clone()
If anything goes wrong during the cloning procedure,
a RuntimeException
will be thrown.
clone
in interface SphericalPosition
clone
in class Object
public boolean equals(Object o)
o
is equal to this position.
The time zone attribute is not taken into account by this method.
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 |