hipscat.pixel_math.healpix_pixel#

Module Contents#

Classes#

HealpixPixel

A HEALPix pixel, represented by an order and pixel number in NESTED ordering scheme

Functions#

get_lower_order_pixel(→ int)

Returns the pixel number at a lower order

get_higher_order_pixels(→ numpy.ndarray)

Returns the pixel numbers at a higher order

Attributes#

INVALID_PIXEL

class HealpixPixel[source]#

A HEALPix pixel, represented by an order and pixel number in NESTED ordering scheme

see https://lambda.gsfc.nasa.gov/toolbox/pixelcoords.html for more information

property dir: int[source]#

Directory number for the pixel.

This is necessary for file systems that limit to 10,000 subdirectories. The directory name will take the HiPS standard form of:

<catalog_base_dir>/Norder=<pixel_order>/Dir=<directory number>

Where the directory number is calculated using integer division as:

(pixel_number/10000)*10000
order: int[source]#
pixel: int[source]#
__post_init__() None[source]#

Initialize a HEALPix pixel :param order: HEALPix order :param pixel: HEALPix pixel number in NESTED ordering scheme

__str__() str[source]#

Return str(self).

__repr__()[source]#

Return repr(self).

__getitem__(key: int) int[source]#
convert_to_lower_order(delta_order: int) HealpixPixel[source]#

Returns the HEALPix pixel that contains the pixel at a lower order

Parameters:

delta_order – the difference in order to be subtracted from the current order to generate the pixel at a lower order. Must be non-negative

Returns:

A new HealpixPixel at the current order - delta_order which contains the current pixel

Raises:

ValueError – If delta_order is greater than the current order, a pixel cannot be generated at a negative order. Or if delta_order is negative

convert_to_higher_order(delta_order: int) List[HealpixPixel][source]#

Returns a list of HEALPix pixels making up the current pixel at a higher order

Parameters:

delta_order – the difference in order to be added to the current order to generate the pixels at a higher order. Must be non-negative

Returns:

A new HealpixPixel at the current order - delta_order which contains the current pixel

Raises:

ValueError – If delta_order + current order is greater than the maximum HEALPix order, pixels cannot be generated. Or if delta_order is negative

INVALID_PIXEL[source]#
get_lower_order_pixel(order: int, pixel: int, delta_order: int) int[source]#

Returns the pixel number at a lower order

Parameters:
  • order (int) – the order of the pixel

  • pixel (int) – the pixel number of the pixel in NESTED ordering

  • delta_order (int) – the change in order to the new lower order

Returns:

The pixel number at order (order - delta_order) for the pixel that contains the given pixel

get_higher_order_pixels(order: int, pixel: int, delta_order: int) numpy.ndarray[source]#

Returns the pixel numbers at a higher order

Parameters:
  • order (int) – the order of the pixel

  • pixel (int) – the pixel number of the pixel in NESTED ordering

  • delta_order (int) – the change in order to the new higher order

Returns:

The list of pixel numbers at order (order + delta_order) for the pixels contained by the given pixel