Spherical harmonic transform of complex-valued map?
Asked Martin Reinecke, developer of HEALPix C++, here his answer:
What you can do is to run map2alm separately on the real and imaginary
parts of your map; the resulting a_lm coefficients are then simply
a_lm,real + i*a_lm,imag. If you want the coefficients with negative m
as well, you need to use the symmetry relation separately on a_lm,real
and a_lm, imag first and then combine them as described.
The reason why there is no direct support for complex-valued maps is
that this would make a_lm handling and spherical harmonic transforms
much more complicated, just to cover a case that is rarely needed (at
least in the area where healpy was originally used) and that can be
emulated by the workaround above if really needed.
All a_lm objects in Healpix and healpy are designed in a way that there
is the mentioned symmetry between +m and -m. For quantities with spin!=0
this symmetry doesn't exist either, so we introduce the linear
combinations alm_E and alm_B, for which it exists again.
Can healpy compute the spherical harmonic transform of a complex-valued map?
When I try this using healpy.sphtfunc.map2alm, there is no warning, but the function gives a_{l,m} only for m>0. This makes sense for real-valued maps, for which a_{l,-m} = (-1)^m * a_{l,m}^*. But for complex-valued functions, this symmetry does not exist.
Thanks!