# Class Tilings

java.lang.Object
uk.ac.starlink.ttools.func.Tilings

public class Tilings extends Object
Pixel tiling functions for the celestial sphere.

The `k` parameter for the HEALPix functions is the HEALPix order, which can be in the range 0<=k<=29. This is the logarithm to base 2 of the HEALPix NSIDE parameter. At order `k`, there are 12*4^k pixels on the sphere.

Since:
  6 Dec 2007
Author:
  Mark Taylor
See Also:
  - HTM web site
  - HEALPix web site

## Field Summary

Fields
Modifier and Type
Field
Description
`static final double`
`SQDEG`
Solid angle in steradians corresponding to 1 square degree.

## Method Summary

Modifier and Type
Method
Description
`static int`
`healpixK(double pixelsize)`
Gives the HEALPix resolution parameter suitable for a given pixel size.
`static long`
`healpixNestIndex(int k, double lon, double lat)`
Gives the pixel index for a given sky position in the HEALPix NEST scheme.
`static double`
`healpixNestLat(int k, long index)`
Returns the latitude of the approximate center of the tile with a given index in the HEALPix NEST scheme.
`static double`
`healpixNestLon(int k, long index)`
Returns the longitude of the approximate center of the tile with a given index in the HEALPix NEST scheme.
`static long`
`healpixNestToRing(int k, long nestIndex)`
Converts a healpix tile index from the NEST to the RING scheme at a given order.
`static double`
`healpixResolution(int k)`
Gives the approximate resolution in degrees for a given HEALPix resolution parameter `k` This `k` value is the logarithm to base 2 of the Nside parameter.
`static long`
`healpixRingIndex(int k, double lon, double lat)`
Gives the pixel index for a given sky position in the HEALPix RING scheme.
`static double`
`healpixRingLat(int k, long index)`
Returns the latitude of the approximate center of the tile with a given index in the HEALPix RING scheme.
`static double`
`healpixRingLon(int k, long index)`
Returns the longitude of the approximate center of the tile with a given index in the HEALPix RING scheme.
`static long`
`healpixRingToNest(int k, long ringIndex)`
Converts a healpix tile index from the RING to the NEST scheme at a given order.
`static double`
`healpixSqdeg(int k)`
Returns the solid angle in square degrees of each HEALPix pixel at a given order.
`static double`
`healpixSteradians(int k)`
Returns the solid angle in steradians of each HEALPix pixel at a given order.
`static int`
`htmLevel(double pixelsize)`
Gives the HTM `level` parameter suitable for a given pixel size.
`static double`
`htmResolution(int level)`
Gives the approximate resolution in degrees for a given HTM depth level.
`static double`
`sqdegToSteradians(double sqdeg)`
Converts a solid angle from square degrees to steradians.
`static double`
`steradiansToSqdeg(double sr)`
Converts a solid angle from steradians to square degrees.

### Methods inherited from class Object

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

## Field Details

### SQDEG

public static final double SQDEG
Solid angle in steradians corresponding to 1 square degree.

See Also:
  - Constant Field Values

## Method Details

### healpixNestIndex

public static long healpixNestIndex(int k, double lon, double lat)
Gives the pixel index for a given sky position in the HEALPix NEST scheme.

Parameters:
  `k` - HEALPix order (0..29)
  `lon` - longitude in degrees
  `lat` - latitude in degrees
Returns:
  pixel index
See Also:
  - HEALPix web site

### healpixRingIndex

public static long healpixRingIndex(int k, double lon, double lat)
Gives the pixel index for a given sky position in the HEALPix RING scheme.

Parameters:
  `k` - HEALPix order (0..29)
  `lon` - longitude in degrees
  `lat` - latitude in degrees
Returns:
  pixel index
See Also:
  - HEALPix web site

### healpixNestLon

public static double healpixNestLon(int k, long index)
Returns the longitude of the approximate center of the tile with a given index in the HEALPix NEST scheme.

Note: the `index` parameter is 0-based, unlike the table row index special token `$index` (a.k.a. `$0`), which is 1-based. So if the HEALpix index is implicitly determined by the table row, the value `$index-1` should be used.

Parameters:
  `k` - HEALPix order (0..29)
  `index` - healpix index
Returns:
  longitude in degrees
See Also:
  - HEALPix web site

### healpixNestLat

public static double healpixNestLat(int k, long index)
Returns the latitude of the approximate center of the tile with a given index in the HEALPix NEST scheme.

Note: the `index` parameter is 0-based, unlike the table row index special token `$index` (a.k.a. `$0`), which is 1-based. So if the HEALpix index is implicitly determined by the table row, the value `$index-1` should be used.

Parameters:
  `k` - HEALPix order (0..29)
  `index` - healpix index
Returns:
  latitude in degrees
See Also:
  - HEALPix web site

### healpixRingLon

public static double healpixRingLon(int k, long index)
Returns the longitude of the approximate center of the tile with a given index in the HEALPix RING scheme.

Note: the `index` parameter is 0-based, unlike the table row index special token `$index` (a.k.a. `$0`), which is 1-based. So if the HEALpix index is implicitly determined by the table row, the value `$index-1` should be used.

Parameters:
  `k` - HEALPix order (0..29)
  `index` - healpix index
Returns:
  longitude in degrees
See Also:
  - HEALPix web site

### healpixRingLat

public static double healpixRingLat(int k, long index)
Returns the latitude of the approximate center of the tile with a given index in the HEALPix RING scheme.

Note: the `index` parameter is 0-based, unlike the table row index special token `$index` (a.k.a. `$0`), which is 1-based. So if the HEALpix index is implicitly determined by the table row, the value `$index-1` should be used.

Parameters:
  `k` - HEALPix order (0..29)
  `index` - healpix index
Returns:
  latitude in degrees
See Also:
  - HEALPix web site

### healpixNestToRing

public static long healpixNestToRing(int k, long nestIndex)
Converts a healpix tile index from the NEST to the RING scheme at a given order.

Note: the `nestIndex` parameter is 0-based, unlike the table row index special token `$index` (a.k.a. `$0`), which is 1-based. So if the HEALpix index is implicitly determined by the table row, the value `$index-1` should be used.

Parameters:
  `k` - HEALPix order (0..29)
  `nestIndex` - pixel index in NEST scheme
Returns:
  pixel index in RING scheme
See Also:
  - HEALPix web site

### healpixRingToNest

public static long healpixRingToNest(int k, long ringIndex)
Converts a healpix tile index from the RING to the NEST scheme at a given order.

Note: the `ringIndex` parameter is 0-based, unlike the table row index special token `$index` (a.k.a. `$0`), which is 1-based. So if the HEALpix index is implicitly determined by the table row, the value `$index-1` should be used.

Parameters:
  `k` - HEALPix order (0..29)
  `ringIndex` - pixel index in RING scheme
Returns:
  pixel index in NEST scheme
See Also:
  - HEALPix web site

### healpixK

public static int healpixK(double pixelsize)
Gives the HEALPix resolution parameter suitable for a given pixel size. This `k` value (also variously known as order, level, depth) is the logarithm to base 2 of the Nside parameter.

Parameters:
  `pixelsize` - pixel size in degrees
Returns:
  HEALPix order `k`
See Also:
  - HEALPix web site

### healpixResolution

public static double healpixResolution(int k)
Gives the approximate resolution in degrees for a given HEALPix resolution parameter `k` This `k` value is the logarithm to base 2 of the Nside parameter.

Parameters:
  `k` - HEALPix order (0..29)
Returns:
  approximate angular resolution in degrees

### healpixSteradians

public static double healpixSteradians(int k)
Returns the solid angle in steradians of each HEALPix pixel at a given order.

Parameters:
  `k` - HEALPix order (0..29)
Returns:
  pixel size in steradians
Examples:
  `healpixSteradians(5) = 0.0010226538585904274`, `4*PI/healpixSteradians(0) = 12.0`

### healpixSqdeg

public static double healpixSqdeg(int k)
Returns the solid angle in square degrees of each HEALPix pixel at a given order.

Parameters:
  `k` - HEALPix order (0..29)
Returns:
  pixel size in steradians
Examples:
  `healpixSqdeg(5) = 3.357174580844667`, `round(12 * healpixSqdeg(0)) = 41253`

### steradiansToSqdeg

public static double steradiansToSqdeg(double sr)
Converts a solid angle from steradians to square degrees.

The unit sphere is 4*PI steradians = 360*360/PI square degrees.

Parameters:
  `sr` - quantity in steradians
Returns:
  quantity in sqare degrees
Examples:
  `round(steradiansToSqdeg(4*PI)) = 41253`

### sqdegToSteradians

public static double sqdegToSteradians(double sqdeg)
Converts a solid angle from square degrees to steradians.

The unit sphere is 4*PI steradians = 360*360/PI square degrees.

Parameters:
  `sqdeg` - quantity in square degrees
Returns:
  quantity in steradians
Examples:
  `round(sqdegToSteradians(41253)/PI) = 4`

### htmLevel

public static int htmLevel(double pixelsize)
Gives the HTM `level` parameter suitable for a given pixel size.

Parameters:
  `pixelsize` - required resolution in degrees
Returns:
  HTM level parameter

### htmResolution

public static double htmResolution(int level)
Gives the approximate resolution in degrees for a given HTM depth level.

Parameters:
  `level` - HTM depth
Returns:
  approximate angular resolution in degrees