healpy.query_disc

Contents

healpy.query_disc#

healpy.query_disc(nside, vec, radius, inclusive=False, fact=4, nest=False, buff=None, return_ranges=False)#

Returns pixels whose centers lie within the disk defined by vec and radius (in radians) (if inclusive is False), or which overlap with this disk (if inclusive is True).

Parameters:
nsideint

The nside of the Healpix map.

vecfloat, sequence of 3 elements

The coordinates of unit vector defining the disk center.

radiusfloat

The radius (in radians) of the disk

inclusivebool, optional

If False, return the exact set of pixels whose pixel centers lie within the disk; if True, return all pixels that overlap with the disk, and maybe a few more. Default: False

factint, optional

Only used when inclusive=True. The overlapping test will be done at the resolution fact*nside. For NESTED ordering, fact must be a power of 2, less than 2**30, else it can be any positive integer. Default: 4.

nest: bool, optional

if True, assume NESTED pixel ordering, otherwise, RING pixel ordering

buff: int array, optional

if provided, this numpy array is used to contain the return values and must be at least long enough to do so. Cannot be used with return_ranges=True.

return_ranges: bool, optional

if True, return a 2D array of pixel ranges with shape (num_ranges, 2), where each row contains [start, end) of a range. This is more memory-efficient for queries returning large numbers of pixels. Default: False

Returns:
ipixint, array

If return_ranges is False: 1D array of pixel indices. If return_ranges is True: 2D array of shape (num_ranges, 2) where each row is [start, end) representing a range of pixels.