hats.pixel_tree.pixel_tree#
Classes#
Sparse Quadtree of HEALPix pixels that make up the HATS catalog |
Module Contents#
- class PixelTree(tree: numpy.ndarray, order: int)[source]#
Sparse Quadtree of HEALPix pixels that make up the HATS 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.
- Attributes:
- pixelsnp.ndarray
An array of [order, pixel] in NESTED numbering scheme for each interval in the array.
- contains(pixel: hats.pixel_math.HealpixPixel | tuple[int, int]) bool[source]#
Check if tree contains a node at a given order and pixel
- Parameters:
- pixelHealpixPixel | tuple[int, int]
HEALPix pixel to check. Either of type HealpixPixel or a tuple of (order, pixel)
- Returns:
- bool
True if the tree contains the pixel, False if not
- get_max_depth() int[source]#
Get the max depth (or highest healpix order) represented in the list of pixels.
- Returns:
- int
max depth (or highest healpix order) of the pixels in the tree
- get_healpix_pixels() list[hats.pixel_math.HealpixPixel][source]#
Creates a list of HealpixPixels in the tree
- Returns:
- list[HealpixPixel]
A list of the HEALPix pixels in the tree
- classmethod from_healpix(healpix_pixels: collections.abc.Sequence[hats.pixel_math.HealpixPixel | tuple[int, int]], tree_order=None) PixelTree[source]#
Build a tree from a list of constituent healpix pixels
- Parameters:
- healpix_pixelsSequence[HealpixPixel | tuple[int, int]]
list of healpix pixels
- tree_orderint
(Default = None) order to generate the tree at. If None, will use the highest order from input pixels
- Returns:
- PixelTree
The pixel tree with the leaf pixels specified in the list