hipscat.pixel_math.pixel_margins#

Utilities for find the pixels of higher orders that surround a given healpixel.

Module Contents#

Functions#

get_edge(d_order, pix, edge)

Get all the pixels at order kk+dk bordering pixel pix.

get_margin(order, pix, d_order)

Get all the pixels at order order+dk bordering pixel pix.

pixel_is_polar(order, pix)

Checks if a healpixel is a polar pixel.

Attributes#

_edge_vectors

_suffixes

_edge_vectors[source]#
_suffixes[source]#
get_edge(d_order, pix, edge)[source]#

Get all the pixels at order kk+dk bordering pixel pix. See hipscat/pixel_math/README.md for more info.

Parameters:
  • dk (int) – the change in k that we wish to find the margins for.

  • pix (int) – the healpix pixel to find margin pixels of.

  • edge (int) –

    the edge we want to find for the given pixel. (0-7)

    • 0: NE edge

    • 1: E corner

    • 2: SE edge

    • 3: S corner

    • 4: SW edge

    • 5: W corner

    • 6: NW edge

    • 7: N corner

Returns:

one-dimensional numpy array of long integers, filled with the healpix pixels at order kk+dk that border the given edge of pix.

get_margin(order, pix, d_order)[source]#

Get all the pixels at order order+dk bordering pixel pix. See hipscat/pixel_math/README.md for more info.

Parameters:
  • order (int) – the healpix order of pix.

  • pix (int) – the healpix pixel to find margin pixels of.

  • d_order (int) – the change in k that we wish to find the margins for. Must be greater than kk.

Returns:

one-dimensional numpy array of long integers, filled with the healpix pixels at order kk+dk that border pix.

pixel_is_polar(order, pix)[source]#

Checks if a healpixel is a polar pixel.

Parameters:
  • order (int) – the healpix order of the pixel to be checked.

  • pix (int) – the id of a healpixel to be checked. must be in the nested id scheme.

Returns:

tuple of a boolean and a string, the boolean indicating whether the pixel polar and the string denoting which pole it is (‘North’ or ‘South’)). string is empty in the case that the pixel isn’t polar.