# Class SkyCoord

java.lang.Object
uk.ac.starlink.ttools.plot2.data.SkyCoord

All Implemented Interfaces:
  `Coord`

public abstract class SkyCoord extends Object implements Coord
Coord implementation for sky positions. To the user these look like (longitude, latitude) pairs, but they are stored as (x,y,z) triples. This class exists in two variants: for surface the vectors are normalised to a magnitude of 1, so that they all fall on the centre of the unit sphere. For volume, that constraint does not apply.

Since:
  4 Feb 2013
Author:
  Mark Taylor

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static class`
`SkyCoord.SkyVariant`
Controls the interpretation of sky vectors, either fixed to the surface of the unit sphere or not.

## Method Summary

Modifier and Type
Method
Description
`static SkyCoord`
`createCoord(SkyCoord.SkyVariant variant, boolean isRequired)`
Factory method to create an instance of this class.
`static InputMeta`
`createRadiusInputMeta()`
Returns an InputMeta for acquiring a radial distance.
`Input[]`
`getInputs()`
Returns specifications of the one or more input values the user supplies to provide the data values for this coord.
`StorageType`
`getStorageType()`
Returns a code indicating how the quantity defined by this object is stored internally and presented to the plotting classes.
`boolean`
`isRequired()`
Indicates whether this item must have a non-blank value in order for a plot to be possible.
`static double[]`
`lonLatDegreesToDouble3(double lonDeg, double latDeg)`
Converts a longitude, latitude pair into a normalised 3-vector.
`abstract boolean`
`readSkyCoord(Tuple tuple, int icol, double[] v3)`
Reads a sky vector value from an appropriate column in the current row of a given Tuple.

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface Coord

`inputStorage`

## Method Details

### getInputs

public Input[] getInputs()
Description copied from interface: `Coord`
Returns specifications of the one or more input values the user supplies to provide the data values for this coord.

Specified by:
  `getInputs` in interface `Coord`
Returns:
  one or more items describing the user input values for this quantity

### getStorageType

public StorageType getStorageType()
Description copied from interface: `Coord`
Returns a code indicating how the quantity defined by this object is stored internally and presented to the plotting classes.

Specified by:
  `getStorageType` in interface `Coord`
Returns:
  storage type enum instance

### isRequired

public boolean isRequired()
Description copied from interface: `Coord`
Indicates whether this item must have a non-blank value in order for a plot to be possible.

Specified by:
  `isRequired` in interface `Coord`
Returns:
  if true, values must be supplied to make a plot

### readSkyCoord

public abstract boolean readSkyCoord(Tuple tuple, int icol, double[] v3)
Reads a sky vector value from an appropriate column in the current row of a given Tuple.

Parameters:
  `tuple` - tuple
  `icol` - index of field in tuple corresponding to this Coord
  `v3` - 3-element vector into which the (x,y,z) sky position will be written
Returns:
  true iff a valid position has been successfully read

### createCoord

public static SkyCoord createCoord(SkyCoord.SkyVariant variant, boolean isRequired)
Factory method to create an instance of this class.

Parameters:
  `variant` - type of sky coordinates
  `isRequired` - true if this coordinate is required for plotting

### lonLatDegreesToDouble3

public static double[] lonLatDegreesToDouble3(double lonDeg, double latDeg)
Converts a longitude, latitude pair into a normalised 3-vector. If the input values are out of range, the components of the returned vector will all be NaN.

Parameters:
  `lonDeg` - longitude in degrees
  `latDeg` - latitude in degrees
Returns:
  (x,y,z) array of components of a normalised vector

### createRadiusInputMeta

public static InputMeta createRadiusInputMeta()
Returns an InputMeta for acquiring a radial distance.

Returns:
  new radial distance input metadata object