hipscat.pixel_tree.pixel_tree#

Module Contents#

Classes#

PixelTree

Sparse Quadtree of HEALPix pixels that make up the HiPSCat catalog

class PixelTree(tree: numpy.ndarray, order: int)[source]#

Sparse Quadtree of HEALPix pixels that make up the HiPSCat catalog

This class stores each node in the tree, with leaf nodes corresponding to pixels with data files.

There are a number of methods in this class which allow for quickly navigating through the tree and performing operations to filter the pixels in the catalog.

pixels#

Nested dictionary of pixel nodes stored in the tree. Indexed by HEALPix order then pixel number

__len__()[source]#

Gets the number of nodes in the tree

Returns:

The number of nodes in the tree

contains(pixel: hipscat.pixel_math.HealpixInputTypes) bool[source]#

Check if tree contains a node at a given order and pixel

Parameters:

pixel – HEALPix pixel to check. Either of type HealpixPixel or a tuple of (order, pixel)

Returns:

True if the tree contains the pixel, False if not

__contains__(item)[source]#
get_max_depth() int[source]#

Get the max depth (or highest healpix order) represented in the list of pixels.

Returns:

max depth (or highest healpix order) of the pixels in the tree

get_healpix_pixels() List[hipscat.pixel_math.HealpixPixel][source]#

Creates a list of HealpixPixels in the tree

Returns (List[HealpixPixel]):

A list of the HEALPix pixels in the tree

to_moc() mocpy.MOC[source]#

Returns the MOC object that covers the same pixels as the tree

classmethod from_healpix(healpix_pixels: Sequence[hipscat.pixel_math.HealpixInputTypes], tree_order=None) PixelTree[source]#

Build a tree from a list of constituent healpix pixels

Parameters:
  • healpix_pixels – list of healpix pixels

  • tree_order (int) – (Default = None) order to generate the tree at. If None, will use the highest order from input pixels

Returns:

The pixel tree with the leaf pixels specified in the list