hipscat.pixel_math.box_filter#

Module Contents#

Functions#

filter_pixels_by_box(...)

Filter the leaf pixels in a pixel tree to return a partition_info dataframe

wrap_ra_angles(→ numpy.ndarray)

Wraps angles to the [0,360] degree range.

_generate_ra_strip_pixel_tree(...)

Generates a pixel_tree filled with leaf nodes at a given order that overlap with the ra region.

_generate_dec_strip_pixel_tree(...)

Generates a pixel_tree filled with leaf nodes at a given order that overlap with the dec region.

_get_division_ra(→ float | None)

Gets the division angle for the right ascension region. This is crucial for the edge

_get_pixels_for_subpolygons(→ numpy.ndarray)

Gets the unique pixels for a set of sub-polygons.

filter_pixels_by_box(pixel_tree: hipscat.pixel_tree.pixel_tree.PixelTree, ra: Tuple[float, float] | None, dec: Tuple[float, float] | None) List[hipscat.pixel_math.HealpixPixel][source]#

Filter the leaf pixels in a pixel tree to return a partition_info dataframe with the pixels that overlap with a right ascension and/or declination region.

Parameters:
  • pixel_tree (PixelTree) – The catalog tree to filter pixels from

  • ra (Tuple[float, float]) – Right ascension range, in [0,360] degrees

  • dec (Tuple[float, float]) – Declination range, in [-90,90] degrees

Returns:

List of HEALPix representing only the pixels that overlap with the right ascension and/or declination region.

wrap_ra_angles(ra: numpy.ndarray | Iterable | int | float) numpy.ndarray[source]#

Wraps angles to the [0,360] degree range.

Parameters:

ra (ndarray | Iterable | int | float) – Right ascension values, in degrees

Returns:

A numpy array of right ascension values, wrapped to the [0,360] degree range.

_generate_ra_strip_pixel_tree(ra_range: Tuple[float, float], order: int) hipscat.pixel_tree.pixel_tree.PixelTree[source]#

Generates a pixel_tree filled with leaf nodes at a given order that overlap with the ra region.

_generate_dec_strip_pixel_tree(dec_range: Tuple[float, float], order: int) hipscat.pixel_tree.pixel_tree.PixelTree[source]#

Generates a pixel_tree filled with leaf nodes at a given order that overlap with the dec region.

_get_division_ra(ra_range: Tuple[float, float]) float | None[source]#

Gets the division angle for the right ascension region. This is crucial for the edge cases where we need to split up polygons wider than 180 degrees into smaller polygons.

_get_pixels_for_subpolygons(polygons: List[List[hipscat.pixel_math.polygon_filter.SphericalCoordinates]], order: int) numpy.ndarray[source]#

Gets the unique pixels for a set of sub-polygons.