-
-
Notifications
You must be signed in to change notification settings - Fork 23
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
BUG: neighbours()
produces warnings for many cases
#217
Comments
neighbours()
fails for index=480 nside=16neighbours()
produces warnings for many cases
Is this a bug? The return value does really contain invalid pixel indices (-1) for pixels that are near the poles and do not have the full complement of neighbors. |
To be precise, this happens at the locations where the 12 base pixels meet and that are not on the poles or the equator. For Nside>1, at most one of the neighbours can be -1 (i.e. nonexistant), for Nside==1, two of the neighbours may be absent. [Edit: by "meet" I mean at the corners of the base pixels.] |
An easier interpretation: these warnings happen at pixels that touch corners where exactly 3 base pixels meet. Every Healpix map has exactly 8 of those locations, and each is touched by three pixels,so you get 24 warnings. |
I would call this a bug and a documentation issue. Bug - there is no reason this code should be issuing a scary sounding warning for a situation that is expected and normal. This warning ended up making me not trust the results and I spent an hour tracking down what was happening and submitting this issue. Documentation - the |
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 `numpy.errstate`. Fixes astropy#217.
I agree. Proposed fix in #220.
It would be easy enough to remove the warning; we would just remove this line: https://github.com/astropy/astropy-healpix/blob/v1.0.3/astropy_healpix/_core.c#L302. However, that would make this method inconsistent with the others; all of the functions set the invalid status if they return any invalid pixel values. |
More generally:
The text was updated successfully, but these errors were encountered: