From: Leo Singer <lsinger@ca...> - 2013-09-09 18:05:34
I'm trying to find the neighbors of pixel ipix=2111 at resoultion nside=32. One of the returned pixel indices is -1. This seems to be a bug. I discovered this bug using Healpy, but the following pure C++ program also reproduces it.
* Print out neighbors of pixel ipix=2111 at resolution nside=32.
int main(int argc, const char *argv)
Healpix_Base hb(5, RING);
for (int i = 0; i < 8; i ++)
std::cout << result[i] << std::endl;
Graduate Student @ LIGO-Caltech
From: Martin Reinecke <martin@MPA-Garching.MPG.DE> - 2013-09-09 20:37:25
> I'm trying to find the neighbors of pixel ipix=2111 at resoultion nside=32. One of the returned pixel indices is -1. This seems to be a bug. I discovered this bug using Healpy, but the following pure C++ program also reproduces it.
This is not a bug. The "-1" indicates that the neighbor in question does not
exist. There are a few pixels on the map that only have 7 neighbors
instead of 8 (at Nside=1 there are pixels with only 6 neighbors).
The documentation for the C++ neighbors() function is:
/*! Returns the neighboring pixels of \a pix in \a result.
On exit, \a result contains (in this order)
the pixel numbers of the SW, W, NW, N, NE, E, SE and S neighbor
of \a pix. If a neighbor does not exist (this can only be the case
for the W, N, E and S neighbors), its entry is set to -1.
\note This method works in both RING and NEST schemes, but is
considerably faster in the NEST scheme. */
void neighbors (I pix, fix_arr<I,8> &result) const;
This is deliberately different from the original Fortran interface,
because it conveys more information.