uk.ac.starlink.ttools.plot2.geom
Class SkyDataGeom

java.lang.Object
  extended by uk.ac.starlink.ttools.plot2.geom.SkyDataGeom
All Implemented Interfaces:
DataGeom

public abstract class SkyDataGeom
extends Object
implements DataGeom

Defines positional data coordinates used by a sky plot.

Since:
20 Feb 2013
Author:
Mark Taylor

Field Summary
static SkyDataGeom GENERIC
          Instance which converts between unspecified, but identical, systems.
 
Constructor Summary
protected SkyDataGeom(String variantName)
          Constructor.
 
Method Summary
static 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 equals(Object other)
           
 int getDataDimCount()
          Returns 3.
 Coord[] getPosCoords()
          Returns the definitions for the user-supplied coordinates that indicate plot positions.
 String getVariantName()
          Returns a label for this DataGeom.
abstract  int hashCode()
           
 boolean hasPosition()
          Indicates whether the values read by the readDataPos method correspond to a point position in the data space.
 boolean readDataPos(TupleSequence tseq, int ic, double[] dpos)
          Determines the positional coordinates in data space for the current row of a supplied tuple sequence.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GENERIC

public static final SkyDataGeom GENERIC
Instance which converts between unspecified, but identical, systems.

Constructor Detail

SkyDataGeom

protected SkyDataGeom(String variantName)
Constructor.

Parameters:
variantName - name for this data geom
Method Detail

getDataDimCount

public int getDataDimCount()
Returns 3.

Specified by:
getDataDimCount in interface DataGeom
Returns:
number of elements in data space coordinate array

hasPosition

public boolean hasPosition()
Description copied from interface: DataGeom
Indicates whether the values read by the readDataPos method correspond to a point position in the data space. If true, a successful read will result in a position array with a definite value for each coordinate. If false, some of the coordinates may be NaN. A false return value would be appropriate for instance if each tuple row for the plot layer represented by this geom corresponds to a line rather than a point in the data space.

Specified by:
hasPosition in interface DataGeom
Returns:
true iff this geom represents point positions

getVariantName

public String 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 interface DataGeom
Returns:
user-directed input coordinate type name

getPosCoords

public Coord[] getPosCoords()
Description copied from interface: DataGeom
Returns the definitions for the user-supplied coordinates that indicate plot positions.

Specified by:
getPosCoords in interface DataGeom
Returns:
coordinate quantity array for this geometry

readDataPos

public boolean readDataPos(TupleSequence tseq,
                           int ic,
                           double[] dpos)
Description copied from interface: DataGeom
Determines the positional coordinates in data space for the current row of a supplied tuple sequence.

A parameter supplies the index of the column 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 of the row of interest is written into it.

Specified by:
readDataPos in interface DataGeom
Parameters:
tseq - coordinate row sequence, positioned at the row of interest
ic - column index in tseq at which the positional information starts
dpos - array into which data space coordinates are written
Returns:
true iff conversion was successful

hashCode

public abstract int hashCode()
Overrides:
hashCode in class Object

equals

public abstract boolean equals(Object other)
Overrides:
equals in class Object

createGeom

public static 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.

Parameters:
userSys - sky system in which user data is supplied
viewSys - sky system in which the plot is viewed
Returns:
new data geom


Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.