to_hats

Contents

to_hats#

to_hats(catalog: HealpixDataset, *, base_catalog_path: str | Path | UPath, catalog_name: str | None = None, default_columns: list[str] | None = None, histogram_order: int | None = None, overwrite: bool = False, create_thumbnail: bool = False, skymap_alt_orders: list[int] | None = None, addl_hats_properties: dict | None = None, error_if_empty: bool = True, **kwargs)[source]#

Writes a catalog to disk, in HATS format.

The output catalog comprises partitioned parquet files and respective metadata, as well as text and CSV files detailing partition, catalog and provenance info.

This will only write a SINGLE catalog, so if this catalog contains margins, you should use to_collection to write all parts of the catalog together.

Parameters:
catalogHealpixDataset

A catalog to export

base_catalog_pathpath-like

Location where catalog is saved to

catalog_namestr or None, default None

The name of the output catalog

default_columnslist[str] or None, default None

A metadata property with the list of the columns in the catalog to be loaded by default. Uses the default columns from the original hats catalog if they exist.

histogram_orderint or None, default None

The default order for the count histogram. Defaults to the same skymap order as original catalog, or the highest order healpix of the current catalog data partitions.

overwritebool, default False

If True existing catalog is overwritten

create_thumbnailbool, default False

If True, create a data thumbnail of the catalog for previewing purposes. Defaults to False.

skymap_alt_orderslist[int] or None, default None

We will write a skymap file at the histogram_order, but can also write down-sampled skymaps, for easier previewing of the data.

addl_hats_propertiesdict or None, default None

key-value pairs of additional properties to write in the hats.properties file.

error_if_emptybool, default True

If True, raises an error if the output catalog is empty

**kwargs

Arguments to pass to the parquet write operations