hats.search.region_search
=========================

.. py:module:: hats.search.region_search


Functions
---------

.. autoapisummary::

   hats.search.region_search.box_filter
   hats.search.region_search.cone_filter
   hats.search.region_search.polygon_filter
   hats.search.region_search.get_cartesian_polygon


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

.. py:function:: box_filter(data_frame: nested_pandas.NestedFrame, ra: tuple[float, float], dec: tuple[float, float], metadata: hats.catalog.TableProperties) -> nested_pandas.NestedFrame

   
   Filters a dataframe to only include points within the specified box region.


   :Parameters:

       **data_frame** : npd.NestedFrame
           DataFrame containing points in the sky

       **ra** : tuple[float,float]
           Right ascension range, in degrees

       **dec** : tuple[float,float]
           Declination range, in degrees

       **metadata** : TableProperties
           hats `Catalog` with catalog_info that matches `data_frame`



   :Returns:

       NestedFrame
           A new DataFrame with the rows from `data_frame` filtered to only the points inside the box region.











   ..
       !! processed by numpydoc !!

.. py:function:: cone_filter(data_frame: nested_pandas.NestedFrame, ra, dec, radius_arcsec, metadata: hats.catalog.TableProperties)

   
   Filters a dataframe to only include points within the specified cone


   :Parameters:

       **data_frame** : npd.NestedFrame
           DataFrame containing points in the sky

       **ra** : float
           Right Ascension of the center of the cone in degrees

       **dec** : float
           Declination of the center of the cone in degrees

       **radius_arcsec** : float
           Radius of the cone in arcseconds

       **metadata** : hc.TableProperties
           hats `TableProperties` with metadata that matches `data_frame`



   :Returns:

       NestedFrame
           A new DataFrame with the rows from `data_frame` filtered to only the points inside the cone











   ..
       !! processed by numpydoc !!

.. py:function:: polygon_filter(data_frame: nested_pandas.NestedFrame, polygon, metadata: hats.catalog.TableProperties) -> nested_pandas.NestedFrame

   
   Filters a dataframe to only include points within the specified polygon.


   :Parameters:

       **data_frame** : npd.NestedFrame
           DataFrame containing points in the sky

       **polygon** : ConvexPolygon
           Convex spherical polygon of interest, used to filter points

       **metadata** : TableProperties
           hats `Catalog` with catalog_info that matches `dataframe`



   :Returns:

       NestedFrame
           A new DataFrame with the rows from `dataframe` filtered to only the pixels inside the polygon.











   ..
       !! processed by numpydoc !!

.. py:function:: get_cartesian_polygon(vertices: list[tuple[float, float]])

   
   Creates the convex polygon to filter pixels with. It transforms the
   vertices, provided in sky coordinates of ra and dec, to their respective
   cartesian representation on the unit sphere.


   :Parameters:

       **vertices** : list[tuple[float, float]]
           The list of vertices of the polygon to filter pixels with,
           as a list of (ra,dec) coordinates, in degrees.



   :Returns:

       sphgeom.ConvexPolygon
           The convex polygon object.











   ..
       !! processed by numpydoc !!

