Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document that neighbours function may return -1 #220

Merged
merged 1 commit into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions astropy_healpix/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,13 @@ def neighbours(healpix_index, nside, order='ring'):
one extra dimension compared to ``healpix_index`` - the first dimension -
which is set to 8. For example if healpix_index has shape (2, 3),
``neigh`` has shape (8, 2, 3).

Notes
-----
Some HEALPix pixels do not have all 8 neighbours. In these cases, the
corresponding entry in the returned array has the value of -1 and Numpy
may print an invalid value warning. To suppress the warning, use
:class:`numpy.errstate`.
"""

_validate_nside(nside)
Expand Down
7 changes: 7 additions & 0 deletions astropy_healpix/high_level.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,13 @@ def neighbours(self, healpix_index):
one extra dimension compared to ``healpix_index`` - the first dimension -
which is set to 8. For example if healpix_index has shape (2, 3),
``neigh`` has shape (8, 2, 3).

Notes
-----
Some HEALPix pixels do not have all 8 neighbours. In these cases, the
corresponding entry in the returned array has the value of -1 and Numpy
may print an invalid value warning. To suppress the warning, use
:class:`numpy.errstate`.
"""
return neighbours(healpix_index, self.nside, order=self.order)

Expand Down