Skip to content

Commit

Permalink
Filter out negative (missing) neighbors when computing healpix envelope.
Browse files Browse the repository at this point in the history
  • Loading branch information
erykoff committed Oct 29, 2024
1 parent 27dc372 commit e18d690
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions python/lsst/sphgeom/_healpixPixelization.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ def envelope(self, region: Region, maxRanges: int = 0):

# Dilate the high resolution pixels by one to ensure that the full
# region is completely covered at high resolution.
neighbors = hpg.neighbors(self._nside_highres, pixels_highres)
neighbors = hpg.neighbors(self._nside_highres, pixels_highres).ravel()
# Shift back to the original resolution and uniquify
pixels = np.unique(np.right_shift(neighbors.ravel(), self._bit_shift))
pixels = np.unique(np.right_shift(neighbors[neighbors >= 0], self._bit_shift))

return RangeSet(pixels)

Expand Down

0 comments on commit e18d690

Please sign in to comment.