hipscat.pixel_math.margin_bounding#

Utilities to build bounding boxes around healpixels that include a neighor margin.

Module Contents#

Functions#

check_margin_bounds(r_asc, dec, pixel_order, pixel, ...)

Check a set of points in ra and dec space to see if they fall within the

_find_minimum_distance(separations, distances, ...)

Find the minimum distance between a given datapoint and a healpixel

_get_boundary_point_distances(order, pixel, step)

Get the distance of the segments between healpixel boundary points

check_margin_bounds(r_asc, dec, pixel_order, pixel, margin_threshold, step=100, chunk_size=1000)[source]#
Check a set of points in ra and dec space to see if they fall within the

margin_threshold of a given healpixel.

Parameters:
  • r_asc (np.array) – one dimmensional array representing the ra of a given set of points.

  • dec (np.array) – one dimmensional array representing the dec of a given set of points.

  • pixel_order (int) – the order of the healpixel to be checked against.

  • pixel (int) – the healpixel to be checked against.

  • margin_threshold (double) – the size of the margin cache in arcseconds.

  • step (int) – the amount of samples we’ll get from the healpixel boundary to test the datapoints against. the higher the step the more granular the point checking and therefore the more accurate, however using a smaller step value might be helpful for super large datasets to save compute time if accuracy is less important.

  • chunk_size (int) – the size of the chunk of data points we process on a single thread at any given time. We only process a certain amount of the data at once as trying to check all data points at once can lead to memory issues.

Returns:

numpy.array of boolean values corresponding to the ra and dec coordinates checked against whether a given point is within any of the provided polygons.

_find_minimum_distance(separations, distances, margin_threshold)[source]#

Find the minimum distance between a given datapoint and a healpixel

_get_boundary_point_distances(order, pixel, step)[source]#

Get the distance of the segments between healpixel boundary points