Package uk.ac.starlink.ttools.plot2.geom
Class SkyDataGeom
java.lang.Object
uk.ac.starlink.ttools.plot2.geom.SkyDataGeom
- All Implemented Interfaces:
DataGeom
Defines positional data coordinates used by a sky plot.
- Since:
- 20 Feb 2013
- Author:
- Mark Taylor
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final SkyDataGeom
Instance which converts between unspecified, but identical, systems. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
SkyDataGeom
(String variantName, SkySys viewSys) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionstatic SkyDataGeom
createGeom
(SkySys userSys, SkySys viewSys) Creates a data geom with input user data in one sky system and output data coordinates in another sky system.abstract boolean
int
Returns 3.Coord[]
Returns the definitions for the user-supplied coordinates that indicate plot positions.Returns a label for this DataGeom.Returns the nominal sky coordinate system of this geom's view, if available.abstract int
hashCode()
boolean
readDataPos
(Tuple tuple, int ic, double[] dpos) Determines the positional coordinates in data space for a supplied tuple.abstract void
rotate
(double[] dpos) Rotates a 3-vector in place from this geom's data coordinate system to its view coordinate system.abstract void
unrotate
(double[] dpos) Rotates a 3-vector in place from this geom's view coordinate system to its data coordinate system.
-
Field Details
-
GENERIC
Instance which converts between unspecified, but identical, systems.
-
-
Constructor Details
-
SkyDataGeom
Constructor.- Parameters:
variantName
- name for this data geomviewSys
- nominal sky coordinate system of view; if unknown or not applicable, may be null
-
-
Method Details
-
getDataDimCount
public int getDataDimCount()Returns 3.- Specified by:
getDataDimCount
in interfaceDataGeom
- Returns:
- number of elements in data space coordinate array
-
getVariantName
Description copied from interface:DataGeom
Returns a label for this DataGeom. It may be used to distinguish from other geoms used in the same plot type, so for instance call it "Cartesian" or "Polar" rather than "Plane" if it's X,Y.- Specified by:
getVariantName
in interfaceDataGeom
- Returns:
- user-directed input coordinate type name
-
getPosCoords
Description copied from interface:DataGeom
Returns the definitions for the user-supplied coordinates that indicate plot positions.- Specified by:
getPosCoords
in interfaceDataGeom
- Returns:
- coordinate quantity array for this geometry
-
readDataPos
Description copied from interface:DataGeom
Determines the positional coordinates in data space for a supplied tuple.A parameter supplies the index of the field in the tuple at which the positional coordinate(s) can be found. Each position is represented by
DataGeom.getPosCoords()
columns of the tuple. By convention positions are at the start of the tuple, so if there is one position in the tuple it will be at icol=0, and there are multiple positions the N'th one will be at icol=N*getPosCoords().An array of (at least)
DataGeom.getDataDimCount()
elements is supplied, and on success the data space coordinate values are written into it.- Specified by:
readDataPos
in interfaceDataGeom
- Parameters:
tuple
- coordinate tupleic
- column index intuple
at which the positional information startsdpos
- array into which data space coordinates are written- Returns:
- true iff conversion was successful
-
rotate
public abstract void rotate(double[] dpos) Rotates a 3-vector in place from this geom's data coordinate system to its view coordinate system.- Parameters:
dpos
- (x,y,z) vector to be rotated in place
-
unrotate
public abstract void unrotate(double[] dpos) Rotates a 3-vector in place from this geom's view coordinate system to its data coordinate system.- Parameters:
dpos
- (x,y,z) vector to be rotated in place
-
getViewSystem
Returns the nominal sky coordinate system of this geom's view, if available.- Returns:
- nominal sky view system, or null if not known or applicable
-
hashCode
public abstract int hashCode() -
equals
-
createGeom
Creates a data geom with input user data in one sky system and output data coordinates in another sky system.- Parameters:
userSys
- sky system in which user data is suppliedviewSys
- sky system in which the plot is viewed- Returns:
- new data geom
-