ziotom78 / Healpix.jl

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

Add rotations #74

Open hsgg opened 2 years ago

hsgg commented 2 years ago

healpy has support for rotations through the Rotator class. Are there any plans to add something similar to Healpix.jl? What would be involved in doing so?

ziotom78 commented 2 years ago

Rotating maps is a tricky business, as it can be done either in pixel or harmonic space, but each case has its own subtleties… There are several reasons why one wants to perform a rotation of a Healpix map:

The first point should probably be passed to a proper astronomic library (e.g., Astrolib.jl or Astropy via PyCall.jl). The second point is subtle because it can lead to many problems (see this thread on the Healpy mailing list, it was initiated by yours truly) and all the pros and cons of each approach should be carefully documented in the Healpix.jl manual. Finally, general rotations could be implemented using Rotations.jl or other similar packages.

To sum up, it is surely a useful feature and would be nice to have it integrated in Healpix, but it is quite complex… If anybody volunteers to submit a PR, we can surely have a look at it.

pochoi commented 2 years ago

+1

Thank you so much for explaining the difficulties! Indeed I wish I can do rotation in the harmonic space, i.e. rotate_alm in healpix. It is a challenge for me to efficiently compute and apply Wigner rotation matrix to alm. I always wish I have Julia codes to do it. If there are any good resources to help me on it, please let me know!

hsgg commented 2 years ago

Thanks @ziotom78 ! Given the complexity and subtleties involved, maybe one could start it as a separate package?

For my purposes a relatively simple version could be enough, maybe using WignerD.jl.

ziotom78 commented 2 years ago

Hi @hsgg , I like the idea of a separate package! We might advertise it in the README and the documentation for Healpix,jl.