-
Notifications
You must be signed in to change notification settings - Fork 8
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
compute neighbours within a discrete ring #15
base: master
Are you sure you want to change the base?
Conversation
instead of just the neighbours _on_ the ring
(that is, the maximum ring is also computed)
@keewis, Also, I known the difference will be negligible, but to fit with the code style, and since: 1: I don't know the cost of (2 * (k as usize) + 1).pow(2) by let k = k as usize;
( (k*(k + 1)) << 2 ) | 1 // = (2k+1)^2 |
sure, I just would have been able to come up with that myself ^^
While we're on the subject of naming, would it make sense to call the existing function The new method would be an extension of the
feel free to push to this branch (if I remember correctly, you can do that by adding my fork as a new git remote and fetch it, after which you can check out the branch and push to the remote). |
however, if I'm reusing the existing Edit: the recent commits implement this, plus some documentation changes. |
I've tried wrapping the four loops from 6c83b90 in a loop around rings, which mostly gives me the same results as my own implementation (minus the ordering within a ring, which I don't care about).
If this is something you'd be fine with merging, I'll need some help with updating the test.
I'm mostly python-based, so I wrote a wrapper package that allows me to compare results (I do plan on submitting that code to
cds-healpix-python
, but for now the separate package allows me to iterate faster). In the future, that package will be used for geo-specific extensions of healpix, like mapping ellipsoidal coordinates onto an authalic sphere, and to allow me to test new functions a bit faster.