IAOCEA / healpix-convolution

Other
1 stars 2 forks source link

neighbours search in the k-th ring around a cell #1

Closed keewis closed 3 months ago

keewis commented 3 months ago

healpy (or rather, the healpix C++ library wrapped by healpy) currently allows searching the immediate neighbours using an algorithm that:

  1. splits the cell ids into the local x, y, and face coordinates
  2. adds offsets to determine the neighbours
  3. adjusts these in case the offset crosses base pixel boundaries
  4. combines the new local coordinates back to cell ids

As long as we don't cross multiple pixel boundaries (i.e. ring <= nside, with ring the step size), this procedure can actually be used to find more than just the immediate neighbours.

This PR implements the extended neighbour search in a numba-accelerated, dask-aware function.