# Class HealpixDataGeom

java.lang.Object
uk.ac.starlink.ttools.plot2.geom.HealpixDataGeom

All Implemented Interfaces:
  `DataGeom`

public abstract class HealpixDataGeom extends Object implements DataGeom
DataGeom implementation for HEALPix indices. This can convert from a single integer to a sky position, the center of the corresponding HEALPix cell. It has to be parameterised by the HEALPix level, and optionally data/view sky system information.

In general you should use the provided factory methods to instantiate this abstract class. If you want to implement a concrete subclass, make sure you implement the methods requred `Equality`.

Since:
  21 Dec 2018
Author:
  Mark Taylor

## Field Summary

Fields
Modifier and Type
Field
Description
`static final HealpixDataGeom`
`DUMMY_INSTANCE`
Placeholder instance.
`static final LongCoord`
`HEALPIX_COORD`
Coordinate for HEALPix pixel index.

## Method Summary

Modifier and Type
Method
Description
`static HealpixDataGeom`
`createGeom(int level, boolean isNest, SkySys userSys, SkySys viewSys)`
Creates a data geom with input user data in one sky system and output data coordinates in another sky system.
`boolean`
`equals(Object o)`
`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.
`int`
`hashCode()`
`boolean`
`readDataPos(Tuple tuple, int icol, double[] dpos)`
Determines the positional coordinates in data space for a supplied tuple.

### Methods inherited from class Object

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

## Field Details

### HEALPIX_COORD

public static final LongCoord HEALPIX_COORD
Coordinate for HEALPix pixel index.

### DUMMY_INSTANCE

public static final HealpixDataGeom DUMMY_INSTANCE
Placeholder instance. This can be used where an instance of this class is required for documentation purposes, but it is not capable of actual transformations.

## Method Details

### getDataDimCount

public int getDataDimCount()
Returns 3.

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

### 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(Tuple tuple, int icol, double[] dpos)
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 interface `DataGeom`
Parameters:
  `tuple` - coordinate tuple
  `icol` - column index in `tuple` at which the positional information starts
  `dpos` - array into which data space coordinates are written
Returns:
  true iff conversion was successful

### equals

public boolean equals(Object o)

Overrides:
  `equals` in class `Object`

### hashCode

public int hashCode()

Overrides:
  `hashCode` in class `Object`

### createGeom

public static HealpixDataGeom createGeom(int level, boolean isNest, SkySys userSys, SkySys viewSys)
Creates a data geom with input user data in one sky system and output data coordinates in another sky system. If both of the supplied sky systems are supplied, the corresponding rotation will be applied; if one or zero are supplied, these parameters are ignored.

Parameters:
  `level` - healpix level (log2(nside))
  `userSys` - sky system in which user data is supplied, may be null
  `viewSys` - sky system in which the plot is viewed, may be null
Returns:
  new data geom