Package uk.ac.starlink.ttools.convert
Class SkyUnits
java.lang.Object
uk.ac.starlink.ttools.convert.SkyUnits
Class defining units used for a two-coordinate sky coordinate system.
Each coordinate represents an angle.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract double[]
Takes a pair of objects representing coordinates in these units, and converts them to radians.abstract Object[]
encode
(double c1, double c2) Takes a pair of coordinates in radians and converts them to these units.static SkyUnits[]
Returns a list of all the available instances of this class.getName()
Returns the name of this unit system.static SkyUnits
getUnitsFor
(String unitName) Returns a unit as specified by a name.abstract String[]
Returns a pair of descriptions for the units of the first and second coordinates represented by these units.abstract Class<?>[]
Returns a pair of classes for the first and second coordinates represented by these units.toString()
-
Field Details
-
DEGREES
Degrees. -
RADIANS
Radians. -
SEXAGESIMAL
Sexagesimal (hh:mm:ss.s, dd:mm:ss.s). -
DEFAULT_UNIT
Default unit (DEGREES).
-
-
Constructor Details
-
SkyUnits
Constructor.
-
-
Method Details
-
decode
Takes a pair of objects representing coordinates in these units, and converts them to radians.- Parameters:
c1
- first input coordinate, in these unitsc2
- second input coordinate, in these units- Returns:
- array of two output coordinates, in radians
-
encode
Takes a pair of coordinates in radians and converts them to these units.- Parameters:
c1
- first input coordinate, in radiansc2
- second input coordinate, in radians- Returns:
- array of two output coordinates, in these units
-
getUnitStrings
Returns a pair of descriptions for the units of the first and second coordinates represented by these units. Tries to stick to the VOUnits standard.- Returns:
- array of two unit names
-
getUnitTypes
Returns a pair of classes for the first and second coordinates represented by these units.- Returns:
- array of two classes, the types which should be presented
to the
decode
method and will be returned from theencode
method
-
getName
Returns the name of this unit system.- Returns:
- name
-
toString
-
getKnownUnits
Returns a list of all the available instances of this class.- Returns:
- array of known unit systems
-
getUnitsFor
Returns a unit as specified by a name. Name may be abbreviated. Returns a suitable unit or throws an IllegalArgumentException.
-