hats.pixel_tree
===============

.. py:module:: hats.pixel_tree


Submodules
----------

.. toctree::
   :maxdepth: 1

   /autoapi/hats/pixel_tree/moc_filter/index
   /autoapi/hats/pixel_tree/moc_utils/index
   /autoapi/hats/pixel_tree/negative_tree/index
   /autoapi/hats/pixel_tree/pixel_alignment/index
   /autoapi/hats/pixel_tree/pixel_alignment_types/index
   /autoapi/hats/pixel_tree/pixel_tree/index


Classes
-------

.. autoapisummary::

   hats.pixel_tree.PixelAlignment
   hats.pixel_tree.PixelAlignmentType


Functions
---------

.. autoapisummary::

   hats.pixel_tree.align_trees


Package Contents
----------------

.. py:class:: PixelAlignment(aligned_tree: hats.pixel_tree.pixel_tree.PixelTree, pixel_mapping: pandas.DataFrame, alignment_type: hats.pixel_tree.pixel_alignment_types.PixelAlignmentType, moc: mocpy.MOC = None)

   
   Represents how two pixel trees align with each other, meaning which pixels match
   or overlap between the catalogs, and a new tree with the smallest pixels from each tree

   For more information on the pixel alignment algorithm, view this document:
   https://docs.google.com/document/d/1gqb8qb3HiEhLGNav55LKKFlNjuusBIsDW7FdTkc5mJU/edit?usp=sharing


   :Attributes:

       **pixel_tree** : PixelTree
           The aligned tree generated by using the smallest pixels in each tree. For
           example, a tree with pixels at order 0, pixel 1, and a tree with order 1, pixel 4,5,6,
           and 7, would result in the smaller order 1 pixels in the aligned tree.

       **pixel_mapping** : pd.DataFrame
           A dataframe where each row contains a pixel from each tree that match, and
           which pixel in the aligned tree they match with

       **alignment_type** : PixelAlignmentType
           The type of alignment describing how to handle nodes which exist in one tree
           but not the other. Options are:
           
           - inner - only use pixels that appear in both catalogs
           - left - use all pixels that appear in the left catalog and any overlapping from the right
           - right - use all pixels that appear in the right catalog and any overlapping from the left
           - outer - use all pixels from both catalogs













   ..
       !! processed by numpydoc !!

   .. py:attribute:: PRIMARY_ORDER_COLUMN_NAME
      :value: 'primary_Norder'



   .. py:attribute:: PRIMARY_PIXEL_COLUMN_NAME
      :value: 'primary_Npix'



   .. py:attribute:: JOIN_ORDER_COLUMN_NAME
      :value: 'join_Norder'



   .. py:attribute:: JOIN_PIXEL_COLUMN_NAME
      :value: 'join_Npix'



   .. py:attribute:: ALIGNED_ORDER_COLUMN_NAME
      :value: 'aligned_Norder'



   .. py:attribute:: ALIGNED_PIXEL_COLUMN_NAME
      :value: 'aligned_Npix'



   .. py:attribute:: pixel_tree


   .. py:attribute:: pixel_mapping


   .. py:attribute:: alignment_type


   .. py:attribute:: moc
      :value: None



.. py:function:: align_trees(left: hats.pixel_tree.pixel_tree.PixelTree, right: hats.pixel_tree.pixel_tree.PixelTree, alignment_type: hats.pixel_tree.pixel_alignment_types.PixelAlignmentType = PixelAlignmentType.INNER) -> PixelAlignment

   
   Generate a `PixelAlignment` object from two pixel trees

   A `PixelAlignment` represents how two pixel trees align with each other, meaning which pixels
   match or overlap between the catalogs, and includes a new tree with the smallest pixels from
   each tree

   For more information on the pixel alignment algorithm, view this document:
   https://docs.google.com/document/d/1gqb8qb3HiEhLGNav55LKKFlNjuusBIsDW7FdTkc5mJU/edit?usp=sharing

   :Parameters:

       **left** : PixelTree
           The left tree to align

       **right** : PixelTree
           The right tree to align

       **alignment_type** : PixelAlignmentType
           (Default value = PixelAlignmentType.INNER)
           The type of alignment describing how to handle nodes which exist in one tree
           but not the other. Options are:
           
           - inner - only use pixels that appear in both catalogs
           - left - use all pixels that appear in the left catalog and any overlapping from the right
           - right - use all pixels that appear in the right catalog and any overlapping from the left
           - outer - use all pixels from both catalogs



   :Returns:

       PixelAlignment
           The `PixelAlignment` object with the alignment from the two trees











   ..
       !! processed by numpydoc !!

.. py:class:: PixelAlignmentType

   Bases: :py:obj:`str`, :py:obj:`enum.Enum`


   
   The type of alignment between catalog trees. Like a join, the types describe if nodes should
   be included if they do not appear in the other catalog
















   ..
       !! processed by numpydoc !!

   .. py:attribute:: INNER
      :value: 'inner'



   .. py:attribute:: OUTER
      :value: 'outer'



   .. py:attribute:: LEFT
      :value: 'left'



   .. py:attribute:: RIGHT
      :value: 'right'



