edu.nrao.sss.astronomy
Class HeasarcCoordConverter
java.lang.Object
edu.nrao.sss.astronomy.HeasarcCoordConverter
- All Implemented Interfaces:
- CelestialCoordinateConverter
public class HeasarcCoordConverter
- extends Object
- implements CelestialCoordinateConverter
A celestial coordinate system converter provided by NASA's
High Energy Astrophysics Science Archive Research Center (HEASARC).
This converter sends a CGI query to HEASARC and parses the response.
Coordinate converter web addresses:
CGI,
Help.
Version Info:
$Revision: 1137 $ |
$Date: 2008-02-29 16:06:15 -0700 (Fri, 29 Feb 2008) $ |
$Author: dharland $ |
- Since:
- 2007-04-13
- Author:
- David M. Harland
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
HeasarcCoordConverter
public HeasarcCoordConverter()
createFrom
public SkyPosition createFrom(SkyPosition position,
CelestialCoordinateSystem toSystem,
Epoch toEpoch,
EarthPosition observer,
LocalSiderealTime lst)
throws CoordinateConversionException
- Returns a new position that is equivalent to
position
,
but in the given coordinate system and epoch.
Note: the success of this method depends on an active internet
connection.
- Specified by:
createFrom
in interface CelestialCoordinateConverter
- Parameters:
position
- the position to be converted.toSystem
- the coordinate system for the returned position.toEpoch
- the epoch for the returned position.observer
- the location of the the observer; not used by this converter.
(This converter cannot handle the HORIZONTAL coordinate system.)lst
- the local sidereal time at the observer's location.
Used for getting the coordinates of position at this time.
If this value is null, those coordinates will be calculated
as of the current time on the system clock.
- Returns:
- a new position that is equivalent to
thisPosition
,
but is expressed in a coordinate system of toSystem
for epoch toEpoch
.
- Throws:
CoordinateConversionException
- if anything goes wrong during
conversion. The exception thrown will have a non-null
cause. This is a list of the types of causes and the most
common explanation for each:
- UnsupportedEncodingException
- This cause is very unlikely. An exception of this type
would arise if for some reason the information in
thisPosition
could not be converted into
UTF-8
- MalformedURLException
- Thrown if we build the query string improperly or if
HEASARC moves or eliminates its service.
- IOException
- Thrown if we have problems opening, reading, or
closing the results of the query.
- IllegalArgumentException
- There are a couple of situations that lead to this
type of cause. The most common is if our latitude
and/or longitude classes could not parse the query
results. The next most common would be calling this
method with a
toSystem
and/or toEpoch
value for which this method was not prepared.
- NullPointerException
- The most common situation that leads to this type of
cause is if one or more of the parameters is
null.
Copyright © 2009. All Rights Reserved.