hats.pixel_math.healpix_shim
============================

.. py:module:: hats.pixel_math.healpix_shim


Attributes
----------

.. autoapisummary::

   hats.pixel_math.healpix_shim.MAX_HEALPIX_ORDER


Functions
---------

.. autoapisummary::

   hats.pixel_math.healpix_shim.is_order_valid
   hats.pixel_math.healpix_shim.npix2order
   hats.pixel_math.healpix_shim.order2nside
   hats.pixel_math.healpix_shim.order2npix
   hats.pixel_math.healpix_shim.order2resol
   hats.pixel_math.healpix_shim.order2pixarea
   hats.pixel_math.healpix_shim.radec2pix
   hats.pixel_math.healpix_shim.ang2vec
   hats.pixel_math.healpix_shim.avgsize2mindist
   hats.pixel_math.healpix_shim.mindist2avgsize
   hats.pixel_math.healpix_shim.avgsize2order
   hats.pixel_math.healpix_shim.margin2order
   hats.pixel_math.healpix_shim.order2mindist


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

.. py:data:: MAX_HEALPIX_ORDER
   :value: 29


.. py:function:: is_order_valid(order: int) -> bool

.. py:function:: npix2order(npix: int) -> int

.. py:function:: order2nside(order: int) -> int

.. py:function:: order2npix(order: int) -> int

.. py:function:: order2resol(order: int, *, arcmin: bool = False, unit=u.rad) -> float

.. py:function:: order2pixarea(order: int, *, degrees: bool = False, unit=u.sr) -> float

.. py:function:: radec2pix(order: int, ra: float, dec: float) -> numpy.ndarray[numpy.int64]

.. py:function:: ang2vec(ra, dec, **kwargs) -> numpy.ndarray

   
   Converts ra and dec to cartesian coordinates on the unit sphere
















   ..
       !! processed by numpydoc !!

.. py:function:: avgsize2mindist(avg_size: numpy.ndarray) -> numpy.ndarray

   
   Get the minimum distance between pixels for a given average size

   We don't have the precise geometry of the healpix grid yet,
   so we are using average_size / mininimum_distance = 1.6
   as a rough estimate.

   :Parameters:

       **avg_size** : np.ndarray of float
           The average size of a healpix pixel



   :Returns:

       np.ndarray of float
           The minimum distance between pixels for the given average size











   ..
       !! processed by numpydoc !!

.. py:function:: mindist2avgsize(mindist: numpy.ndarray | float) -> numpy.ndarray | float

   
   Get the average size for a given minimum distance between pixels

   We don't have the precise geometry of the healpix grid yet,
   so we are using average_size / mininimum_distance = 1.6
   as a rough estimate.

   :Parameters:

       **mindist** : np.ndarray of float | float
           The minimum distance between pixels



   :Returns:

       np.ndarray of float | float
           The average size of a healpix pixel for the given minimum distance
           between pixels.











   ..
       !! processed by numpydoc !!

.. py:function:: avgsize2order(avg_size_arcmin: numpy.ndarray | float) -> numpy.ndarray | int

   
   Get the largest order with average healpix size larger than avg_size_arcmin


   :Parameters:

       **avg_size_arcmin** : np.ndarray of float | float
           The average size of a healpix pixel in arcminutes



   :Returns:

       np.ndarray of int | int
           The largest healpix order for which the average size is larger than avg_size_arcmin











   ..
       !! processed by numpydoc !!

.. py:function:: margin2order(margin_thr_arcmin: numpy.ndarray) -> numpy.ndarray

   
   Get the largest order for which distance between pixels is less than margin_thr_arcmin

   We don't have the precise geometry of the healpix grid yet,
   we are using average_size / mininimum_distance = 1.6
   as a rough estimate.

   :Parameters:

       **margin_thr_arcmin** : np.ndarray of float
           The minimum distance between pixels in arcminutes



   :Returns:

       np.ndarray of int
           The largest healpix order for which the distance between pixels is less than margin_thr_arcmin











   ..
       !! processed by numpydoc !!

.. py:function:: order2mindist(order: numpy.ndarray | int) -> numpy.ndarray | float

   
   Get the estimated minimum distance between pixels at a given order.

   We don't have the precise geometry of the healpix grid yet,
   we are using average_size / mininimum_distance = 1.6
   as a rough estimate.

   :Parameters:

       **order** : np.ndarray of int | int
           The healpix order



   :Returns:

       np.ndarray of float | float
           The minimum distance between pixels in arcminutes











   ..
       !! processed by numpydoc !!

