# Class CartesianErrorCoordSet

java.lang.Object
uk.ac.starlink.ttools.plot2.layer.CartesianErrorCoordSet

All Implemented Interfaces:
  `CartesianMultiPointCoordSet, MultiPointCoordSet`

public class CartesianErrorCoordSet extends Object implements CartesianMultiPointCoordSet
MultiPointCoordSet for bidirectional errors in Cartesian data coordinates.

Since:
  19 Mar 2013
Author:
  Mark Taylor

## Constructor Summary

Constructors
Constructor
Description
`CartesianErrorCoordSet(String[] axisNames, int[] iErrDims)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`static CartesianErrorCoordSet`
`createAllAxesErrorCoordSet(String[] axisNames)`
Returns a coord set with errors in all of the dimensions of a Cartesian space.
`static CartesianErrorCoordSet`
`createSingleAxisErrorCoordSet(int ndim, int iErrDim, String errAxisName)`
Returns a coord set with errors in a single indicated dimension of a Cartesian space.
`Coord[]`
`getCoords()`
Returns the coordinate definitions.
`int`
`getPointCount()`
Returns the number of (non-central) data positions defined by this coord set.
`boolean`
`readPoints(Tuple tuple, int icol, double[] dpos0, double[][] dposExtras)`
Reads the non-central points from a appropriate span of columns in a supplied tuple.

### Methods inherited from class Object

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

## Constructor Details

### CartesianErrorCoordSet

public CartesianErrorCoordSet(String[] axisNames, int[] iErrDims)
Constructor. It constructs a coord set for error coordinates in one or more dimensions within in a Cartesian space of `nSpaceDim` dimensions.

Parameters:
  `axisNames` - `nSpaceDim`-element array of names of Cartesian axes (only those represented in `iErrDims` are actually used)
  `iErrDims` - array of axis indices for which errors are to be acquired; each element must be an index in the range 0 <= x < `nSpaceDim`

## Method Details

### getCoords

public Coord[] getCoords()
Description copied from interface: `MultiPointCoordSet`
Returns the coordinate definitions.

Specified by:
  `getCoords` in interface `MultiPointCoordSet`
Returns:
  coords

### getPointCount

public int getPointCount()
Description copied from interface: `MultiPointCoordSet`
Returns the number of (non-central) data positions defined by this coord set.

Specified by:
  `getPointCount` in interface `MultiPointCoordSet`
Returns:
  data position count

### readPoints

public boolean readPoints(Tuple tuple, int icol, double[] dpos0, double[][] dposExtras)
Description copied from interface: `CartesianMultiPointCoordSet`
Reads the non-central points from a appropriate span of columns in a supplied tuple. The central data position must be supplied as input. The `icExtra` value gives the column corresponding to the first coord of this coordinate set in the sequence; the following few columns are assumed to correspond 1:1 to the coords in this coord set.

Specified by:
  `readPoints` in interface `CartesianMultiPointCoordSet`
Parameters:
  `tuple` - tuple
  `icol` - index of tuple field corresponding to the first of the coordinates in this set
  `dpos0` - nDataDim-element array giving central data position
  `dposExtras` - [nPointCount][nDataDim]-shaped array into which the non-central data positions will be written
Returns:
  true iff the conversion was successful

### createAllAxesErrorCoordSet

public static CartesianErrorCoordSet createAllAxesErrorCoordSet(String[] axisNames)
Returns a coord set with errors in all of the dimensions of a Cartesian space.

Parameters:
  `axisNames` - names of the dimensions; the length of this array defines the dimensionality of the space
Returns:
  new coord set

### createSingleAxisErrorCoordSet

public static CartesianErrorCoordSet createSingleAxisErrorCoordSet(int ndim, int iErrDim, String errAxisName)
Returns a coord set with errors in a single indicated dimension of a Cartesian space.

Parameters:
  `ndim` - dimensionality of the Cartesian space
  `iErrDim` - index of the dimension for which error coordinates are to be obtained
  `errAxisName` - label of the axis indicated by `iErrDim`
Returns:
  new coord set