lsdb.loaders.hats

lsdb.loaders.hats#

Submodules#

Functions#

read_hats(→ lsdb.types.CatalogTypeVar | None)

Load a catalog from a HATS formatted catalog.

Package Contents#

read_hats(path: str | pathlib.Path | upath.UPath, search_filter: lsdb.core.search.abstract_search.AbstractSearch | None = None, columns: list[str] | str | None = None, margin_cache: str | pathlib.Path | upath.UPath | None = None, dtype_backend: str | None = 'pyarrow', **kwargs) lsdb.types.CatalogTypeVar | None[source]#

Load a catalog from a HATS formatted catalog.

Typical usage example, where we load a catalog with a subset of columns:

lsdb.read_hats(path="./my_catalog_dir", columns=["ra","dec"])

Typical usage example, where we load a catalog from a cone search:

lsdb.read_hats(
    path="./my_catalog_dir",
    columns=["ra","dec"],
    search_filter=lsdb.core.search.ConeSearch(ra, dec, radius_arcsec),
)
Parameters:
  • path (UPath | Path) – The path that locates the root of the HATS catalog

  • search_filter (Type[AbstractSearch]) – Default None. The filter method to be applied.

  • columns (List[str]) – Default None. The set of columns to filter the catalog on. If None, the catalog’s default columns will be loaded. To load all catalog columns, use columns=”all”

  • margin_cache (path-like) – Default None. The margin for the main catalog, provided as a path.

  • dtype_backend (str) – Backend data type to apply to the catalog. Defaults to “pyarrow”. If None, no type conversion is performed.

  • **kwargs – Arguments to pass to the pandas parquet file reader

Returns:

Catalog object loaded from the given parameters

Examples

To read a catalog from a public S3 bucket, call it as follows:

from upath import UPath
catalog = lsdb.read_hats(UPath(..., anon=True))