Package uk.ac.starlink.ttools.plot2.data
Class SkyCoord
- java.lang.Object
-
- uk.ac.starlink.ttools.plot2.data.SkyCoord
-
- All Implemented Interfaces:
Coord
public abstract class SkyCoord extends java.lang.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 classSkyCoord.SkyVariantControls the interpretation of sky vectors, either fixed to the surface of the unit sphere or not.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static SkyCoordcreateCoord(SkyCoord.SkyVariant variant, boolean isRequired)Factory method to create an instance of this class.static InputMetacreateRadiusInputMeta()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.StorageTypegetStorageType()Returns a code indicating how the quantity defined by this object is stored internally and presented to the plotting classes.booleanisRequired()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 booleanreadSkyCoord(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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface uk.ac.starlink.ttools.plot2.data.Coord
inputStorage
-
-
-
-
Method Detail
-
getInputs
public Input[] getInputs()
Description copied from interface:CoordReturns specifications of the one or more input values the user supplies to provide the data values for this coord.
-
getStorageType
public StorageType getStorageType()
Description copied from interface:CoordReturns a code indicating how the quantity defined by this object is stored internally and presented to the plotting classes.- Specified by:
getStorageTypein interfaceCoord- Returns:
- storage type enum instance
-
isRequired
public boolean isRequired()
Description copied from interface:CoordIndicates whether this item must have a non-blank value in order for a plot to be possible.- Specified by:
isRequiredin interfaceCoord- 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- tupleicol- index of field in tuple corresponding to this Coordv3- 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 coordinatesisRequired- 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 degreeslatDeg- 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
-
-