# Class HealpixTableInfo

java.lang.Object
uk.ac.starlink.table.HealpixTableInfo

public class HealpixTableInfo extends Object
Defines how to store metadata in a table so that STIL knows it contains a HEALPix map.

Author:
  Mark Taylor

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static enum`
`HealpixTableInfo.HpxCoordSys`
Characterises the coordinate systems defined by the HEALpix-FITS serialization convention.

## Field Summary

Fields
Modifier and Type
Field
Description
`static final ValueInfo`
`HPX_COLNAME_INFO`
Metadata element for name of column storing pixel index.
`static final ValueInfo`
`HPX_CSYS_INFO`
Metadata element for character indicating sky system: C, G or E.
`static final ValueInfo`
`HPX_ISNEST_INFO`
Metadata element * for HEALPix ordering (true=NESTED, false=RING).
`static final ValueInfo`
`HPX_LEVEL_INFO`
Metadata element for HEALPix level (=log2(nside)).

## Constructor Summary

Constructors
Constructor
Description
`HealpixTableInfo(int level, boolean isNest, String ipixColName, HealpixTableInfo.HpxCoordSys csys)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`boolean`
`equals(Object o)`
`static HealpixTableInfo`
`fromParams(List<DescribedValue> params)`
Imports HEALPix information from a list of table parameters, and turns it into an instance of this class.
`HealpixTableInfo.HpxCoordSys`
`getCoordSys()`
Returns the HEALPix coordinate system variant used by this table.
`int`
`getLevel()`
Returns the HEALPix level.
`String`
`getPixelColumnName()`
Returns the name of the table column containing the HEALPix pixel index.
`int`
`hashCode()`
`static boolean`
`isHealpix(List<DescribedValue> params)`
Indicates whether a list of table parameters appears to be from a table with HEALPix annotations as expected by this class.
`boolean`
`isNest()`
Indicates pixel ordering scheme.
`DescribedValue[]`
`toParams()`
Exports the contents of this object to a list of DescribedValue objects that can be attached to a table's parameter list, to declare the organisation of HEALPix information in that table.
`String`
`toString()`

### Methods inherited from class Object

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

## Field Details

### HPX_LEVEL_INFO

public static final ValueInfo HPX_LEVEL_INFO
Metadata element for HEALPix level (=log2(nside)). Name "`STIL_HPX_LEVEL`", class Integer.

### HPX_ISNEST_INFO

public static final ValueInfo HPX_ISNEST_INFO
Metadata element * for HEALPix ordering (true=NESTED, false=RING). Name "`STIL_HPX_ISNEST`", class Boolean.

### HPX_COLNAME_INFO

public static final ValueInfo HPX_COLNAME_INFO
Metadata element for name of column storing pixel index. If blank, indexing is implicit (determined by row index). Name "`STIL_HPX_COLNAME`", class String.

### HPX_CSYS_INFO

public static final ValueInfo HPX_CSYS_INFO
Metadata element for character indicating sky system: C, G or E. Name "`STIL_HPX_CSYS`", class String.

## Constructor Details

### HealpixTableInfo

public HealpixTableInfo(int level, boolean isNest, String ipixColName, HealpixTableInfo.HpxCoordSys csys)
Constructor.

Parameters:
  `level` - healpix level; negative means not defined
  `isNest` - true for nested, false for ring
  `ipixColName` - name of column containing pixel index, or null for implicit pixel indices
  `csys` - healpix coordinate system variant

## Method Details

### getLevel

public int getLevel()
Returns the HEALPix level.

Returns:
  log2(nside), or negative value if not defined

### isNest

public boolean isNest()
Indicates pixel ordering scheme.

Returns:
  true for NESTED, false for RING

### getPixelColumnName

public String getPixelColumnName()
Returns the name of the table column containing the HEALPix pixel index. If blank, pixel index is assumed equal to row index.

Returns:
  pixel column name, or null

### getCoordSys

public HealpixTableInfo.HpxCoordSys getCoordSys()
Returns the HEALPix coordinate system variant used by this table. May be null if none specified.

Returns:
  coordinate system object, or null

### toParams

public DescribedValue[] toParams()
Exports the contents of this object to a list of DescribedValue objects that can be attached to a table's parameter list, to declare the organisation of HEALPix information in that table.

Returns:
  list of table parameters

### hashCode

public int hashCode()

Overrides:
  `hashCode` in class `Object`

### equals

public boolean equals(Object o)

Overrides:
  `equals` in class `Object`

### toString

public String toString()

Overrides:
  `toString` in class `Object`

### isHealpix

public static boolean isHealpix(List<DescribedValue> params)
Indicates whether a list of table parameters appears to be from a table with HEALPix annotations as expected by this class. This method currently just looks to see whether any of the `HPX_*` ValueInfos appears in the list, and returns true if so.

This method may be useful to determine whether it's worth while to call `fromParams(List)`.

Parameters:
  `params` - list of DescribedValue objects, as obtained from Table.getParameters
Returns:
  true if the table appears to be a healpix table

### fromParams

public static HealpixTableInfo fromParams(List<DescribedValue> params)
Imports HEALPix information from a list of table parameters, and turns it into an instance of this class. This should always succeed, but the returned instance is not guaranteed to have very complete information. If parameters that this class knows about seem to have wrong or surprising values, messages may be reported through the logging system.

Parameters:
  `params` - list of DescribedValue objects, as obtained from Table.getParameters
Returns:
  an instance of this class