hipscat.catalog.healpix_dataset.healpix_dataset#

Module Contents#

Classes#

HealpixDataset

A HiPSCat dataset partitioned with a HEALPix partitioning structure.

Attributes#

PixelInputTypes

PixelInputTypes[source]#
class HealpixDataset(catalog_info: CatalogInfoClass, pixels: PixelInputTypes, catalog_path: str = None, moc: mocpy.MOC | None = None, storage_options: Dict[Any, Any] | None = None)[source]#

Bases: hipscat.catalog.dataset.Dataset

A HiPSCat dataset partitioned with a HEALPix partitioning structure.

Catalogs of this type are partitioned based on the ra and dec of the points with each partition containing points within a given HEALPix pixel. The files are in the form:

Norder=/Dir=/Npix=.parquet
CatalogInfoClass: typing_extensions.TypeAlias[source]#
catalog_info: HealpixDataset.CatalogInfoClass[source]#
get_healpix_pixels() List[hipscat.pixel_math.HealpixPixel][source]#

Get healpix pixel objects for all pixels contained in the catalog.

Returns:

List of HealpixPixel

static _get_partition_info_from_pixels(pixels: PixelInputTypes) hipscat.catalog.partition_info.PartitionInfo[source]#
static _get_pixel_tree_from_pixels(pixels: PixelInputTypes) hipscat.pixel_tree.pixel_tree.PixelTree[source]#
classmethod _read_args(catalog_base_dir: hipscat.io.FilePointer, storage_options: Dict[Any, Any] | None = None) Tuple[CatalogInfoClass, hipscat.catalog.partition_info.PartitionInfo][source]#
classmethod _read_kwargs(catalog_base_dir: hipscat.io.FilePointer, storage_options: Dict[Any, Any] | None = None) dict[source]#
classmethod _read_moc_from_point_map(catalog_base_dir: hipscat.io.FilePointer, storage_options: Dict[Any, Any] | None = None) mocpy.MOC | None[source]#

Reads a MOC object from the point_map.fits file if it exists in the catalog directory

classmethod _check_files_exist(catalog_base_dir: hipscat.io.FilePointer, storage_options: dict = None)[source]#
filter_from_pixel_list(pixels: List[hipscat.pixel_math.HealpixPixel]) typing_extensions.Self[source]#

Filter the pixels in the catalog to only include the requested pixels.

Parameters:

pixels (List[HealpixPixels]) – the pixels to include

Returns:

A new catalog with only those pixels. Note that we reset the total_rows to None, instead of performing a scan over the new pixel sizes.

align(other_cat: typing_extensions.Self, alignment_type: hipscat.pixel_tree.PixelAlignmentType = PixelAlignmentType.INNER) hipscat.pixel_tree.PixelAlignment[source]#

Performs an alignment to another catalog, using the pixel tree and mocs if available

An alignment compares the pixel structures of the two catalogs, checking which pixels overlap. The alignment includes the mapping of all pairs of pixels in each tree that overlap with each other, and the aligned tree which consists of the overlapping pixels in the two input catalogs, using the higher order pixels where there is overlap with differing orders.

For more information, see this document: https://docs.google.com/document/d/1gqb8qb3HiEhLGNav55LKKFlNjuusBIsDW7FdTkc5mJU/edit?usp=sharing

Parameters:
  • other_cat (Catalog) – The catalog to align to

  • alignment_type (PixelAlignmentType) – The type of alignment describing how to handle nodes which

  • are (exist in one tree but not the other. Mirrors the 'how' argument of a pandas/sql join. Options) –

    • “inner” - only use pixels that appear in both catalogs

    • ”left” - use all pixels that appear in the left catalog and any overlapping from the right

    • ”right” - use all pixels that appear in the right catalog and any overlapping from the left

    • ”outer” - use all pixels from both catalogs

Returns (PixelAlignment):

A PixelAlignment object with the alignment from the two catalogs