hats.io.skymap
==============

.. py:module:: hats.io.skymap


Functions
---------

.. autoapisummary::

   hats.io.skymap.read_skymap
   hats.io.skymap.skymap_coverage
   hats.io.skymap.write_skymap


Module Contents
---------------

.. py:function:: read_skymap(catalog, order)

   
   Read the object spatial distribution information from a healpix skymap FITS file.


   :Parameters:

       **catalog** : Catalog
           Catalog object corresponding to an on-disk catalog.

       **order** : int
           healpix order to read the skymap at. If None, the order of the default
           skymap will be used. We will try to load from alternative skymap orders,
           where appropriate.



   :Returns:

       np.ndarray
           one-dimensional numpy array of long integers where the value at each index
           corresponds to the number of objects found at the healpix pixel.











   ..
       !! processed by numpydoc !!

.. py:function:: skymap_coverage(catalog, order=None)

   
   Compute the fractional sky coverage of a catalog from its healpix skymap file.


   :Parameters:

       **catalog** : Catalog
           Catalog object corresponding to an on-disk catalog with skymap files.

       **order** : int, optional
           healpix order to read the skymap at. If None, the order of the default
           skymap will be used.



   :Returns:

       float
           fractional sky coverage between 0.0 and 1.0.











   ..
       !! processed by numpydoc !!

.. py:function:: write_skymap(histogram: numpy.ndarray, catalog_dir: str | pathlib.Path | upath.UPath, orders: list | int | None = None)

   
   Write the object spatial distribution information to a healpix SKYMAP FITS file.


   :Parameters:

       **histogram** : np.ndarray
           one-dimensional numpy array of long integers where the
           value at each index corresponds to the number of objects found at the healpix pixel.

       **catalog_dir** : str | Path | UPath
           base directory of the catalog in which to write the skymap file(s)

       **orders** : list | int | None
           list of orders to write additional skymap files. if provided and not empty,
           we will write a `skymap.K.fits` for each integer K in the list. if empty or None,
           we will not write additional files.














   ..
       !! processed by numpydoc !!

