ziotom78 / Healpix.jl

Healpix library written in Julia
GNU General Public License v2.0
51 stars 18 forks source link

`get_all_neighbours` function from healpy #103

Open h-spiess opened 1 year ago

h-spiess commented 1 year ago

Hey,

First, nice work with this package. Thanks for making HEALPix accessible in Julia.

As you've stated in the README, getting the neighbouring values in the NESTED scheme should be easy. Does that mean we should implement it ourself? I've noticed, that the get_all_neighbours function from healpy (https://healpy.readthedocs.io/en/1.5.0/generated/healpy.pixelfunc.get_all_neighbours.html) is missing. Did you rename that function?

I want to interpolate missing values in the HEALPix discretization using known neighbour values.

As an alternative, I've just found the interpolate function, which could work if one goes from NESTED -> RING & pixel value -> angles -> interpolate -> back to pixel value. But this seems quite cumbersome. I'm also wondering, why interpolate is only implemented for the RING scheme.

Thanks for your help :)

ziotom78 commented 1 year ago

When I implemented getInterpolRing, I needed it for a few maps I was generating in the RING scheme; I did not have time to implement a function for NEST order too :-(

The current implementation in Healpix.jl is a port of ducc0's get_interpol, which works with both RING and NESTED but it's optimized for the former case. Note that ducc0 provides the neighbors function too, which is optimized for the NESTED case. You can see their implementation in healpix_base.cc, perhaps you might submit a PR?