Package uk.ac.starlink.table
Class HealpixTableInfo
- java.lang.Object
-
- uk.ac.starlink.table.HealpixTableInfo
-
public class HealpixTableInfo extends java.lang.ObjectDefines 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 classHealpixTableInfo.HpxCoordSysCharacterises the coordinate systems defined by the HEALpix-FITS serialization convention.
-
Field Summary
Fields Modifier and Type Field Description static ValueInfoHPX_COLNAME_INFOMetadata element for name of column storing pixel index.static ValueInfoHPX_CSYS_INFOMetadata element for character indicating sky system: C, G or E.static ValueInfoHPX_ISNEST_INFOMetadata element * for HEALPix ordering (true=NESTED, false=RING).static ValueInfoHPX_LEVEL_INFOMetadata element for HEALPix level (=log2(nside)).
-
Constructor Summary
Constructors Constructor Description HealpixTableInfo(int level, boolean isNest, java.lang.String ipixColName, HealpixTableInfo.HpxCoordSys csys)Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)static HealpixTableInfofromParams(java.util.List<DescribedValue> params)Imports HEALPix information from a list of table parameters, and turns it into an instance of this class.HealpixTableInfo.HpxCoordSysgetCoordSys()Returns the HEALPix coordinate system variant used by this table.intgetLevel()Returns the HEALPix level.java.lang.StringgetPixelColumnName()Returns the name of the table column containing the HEALPix pixel index.inthashCode()static booleanisHealpix(java.util.List<DescribedValue> params)Indicates whether a list of table parameters appears to be from a table with HEALPix annotations as expected by this class.booleanisNest()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.java.lang.StringtoString()
-
-
-
Field Detail
-
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 Detail
-
HealpixTableInfo
public HealpixTableInfo(int level, boolean isNest, java.lang.String ipixColName, HealpixTableInfo.HpxCoordSys csys)Constructor.- Parameters:
level- healpix level; negative means not definedisNest- true for nested, false for ringipixColName- name of column containing pixel index, or null for implicit pixel indicescsys- healpix coordinate system variant
-
-
Method Detail
-
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 java.lang.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:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
isHealpix
public static boolean isHealpix(java.util.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 theHPX_*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(java.util.List<uk.ac.starlink.table.DescribedValue>).- 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(java.util.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
-
-