to_collection#
- to_collection(catalog, *, base_collection_path: str | Path | UPath, catalog_name: str | None = None, default_columns: list[str] | None = None, overwrite: bool = False, resume: bool = False, progress_bar: bool = True, tqdm_kwargs: dict | None = None, error_if_empty: bool = True, create_summary: bool = False, **kwargs)[source]#
Saves the catalog collection to disk in the HATS format.
The output contains the main catalog and its margin cache, if it exists.
- Parameters:
- catalogHealpixDataset
A catalog to export
- base_collection_pathpath-like
Location where catalog is saved to
- catalog_namestr or None, default None
The name of the catalog to be saved
- default_columnslist[str] or None, default None
A metadata property with the list of the columns in the catalog to be loaded by default. By default, uses the default columns from the original hats catalog if they exist.
- overwritebool, default False
If True existing collection is overwritten
- resumebool, default False
If True, resumes a previous, incomplete write of the collection
- progress_barbool, default True
If True, shows a progress bar during the export process
- tqdm_kwargsdict or None, default None
If progress_bar is True, these kwargs are passed to tqdm when creating the progress bar
- error_if_emptybool, default True
If True, raises an error if the catalog is empty
- create_summarybool, default False
If True, writes
README.mdsummary files for the collection, the main catalog, and the margin (if it exists).- **kwargs
Arguments to pass to the parquet write operations