hats.catalog.catalog_collection#

Classes#

CatalogCollection

A collection of HATS Catalog with data stored in a HEALPix Hive partitioned structure

Module Contents#

class CatalogCollection(collection_path: upath.UPath, collection_properties: hats.catalog.dataset.collection_properties.CollectionProperties, main_catalog: hats.catalog.catalog.Catalog, storage_options: dict | None = None)[source]#

A collection of HATS Catalog with data stored in a HEALPix Hive partitioned structure

Catalogs of this type are described by a collection.properties file which specifies the underlying main catalog, margin catalog and index catalog paths. These catalogs are stored at the root of the collection, each in its separate directory:

catalog_collection/
├── main_catalog/
├── margin_catalog/
├── index_catalog/
├── collection.properties

Margin and index catalogs are optional but there could also be multiple of them. The catalogs used by default are specified in the collection.properties file in the default_margin and default_index keywords.

collection_path[source]#
collection_properties[source]#
main_catalog[source]#
storage_options = None[source]#
property main_catalog_dir: upath.UPath[source]#

Path to the main catalog directory

property all_margins: list[str] | None[source]#

The list of margin catalog names in the collection

property default_margin: str | None[source]#

The name of the default margin

property default_margin_catalog_dir: upath.UPath | None[source]#

Path to the default margin catalog directory

property all_indexes: dict[str, str] | None[source]#

The mapping of indexes in the collection

property default_index_field: str | None[source]#

The name of the default index field

property default_index_catalog_dir: upath.UPath | None[source]#

Path to the default index catalog directory

get_index_dir_for_field(field_name: str | None = None) upath.UPath | None[source]#

Path to the field’s index catalog directory

get_healpix_pixels() list[hats.pixel_math.HealpixPixel][source]#

The list of HEALPix pixels of the main catalog

plot_pixels(**kwargs)[source]#

Create a visual map of the pixel density of the collection’s main catalog.

Parameters:
**kwargs

Additional args to pass to hats.inspection.visualize_catalog.plot_healpix_map

plot_density(**kwargs)[source]#

Create a visual map of the density of input points of the collection’s main catalog.

Parameters:
**kwargs

Additional args to pass to hats.inspection.visualize_catalog.plot_density

Raises:
ValueError

if the main catalog is not on disk.

plot_moc(**kwargs)[source]#

Create a visual map of the coverage of the collection’s main catalog.

Parameters:
**kwargs

Additional args to pass to hats.inspection.visualize_catalog.plot_moc

get_margin_thresholds() dict[str, float][source]#

Get the margin thresholds for all margin catalogs in the collection.

Returns:
dict[str, float]

A dictionary mapping margin catalog names to their threshold values.

Raises:
ValueError

if a catalog listed as a margin catalog is not configured as a margin catalog.

classmethod resolve_inner_path(collection_path, path, storage_options: dict | None = None) upath.UPath[source]#

Convenience method to find the path of a related catalog, either relative or absolute.

Parameters:
collection_path: UPath

fully-specified path to the collection root

path: UPath | Path | str

location of the related catalog

storage_options: dict

dictionary of storage options for the connection to the related catalog

Returns:
UPath

fully-specified path to the related catalog.