Legendre transform drops imaginary part for m=0

Issue #54 open
Keaton Burns created an issue

First off, thanks for making this great code available! I’m using the associated Legendre transform routines (fixed m) and have noticed that the m=0 transforms seems to drop the imaginary component of the input. This makes sense if the underlying SHT is real, because then the m=0 Fourier component is purely real. But if the underlying SHT is complex, then there should be an imaginary component too for m=0. I can work around this by running two m=0 transforms for the real and imaginary parts separately, but it would be nice not to have to special case this. Short example attached.

Comments (3)

  1. Nathanaël Schaeffer repo owner

    Yes, this is indeed the intended behaviour, and it only makes sense for real physical data.
    I agree the correct behaviour should be to keep the imaginary part. I will think of how to implement this without making too many changes to the actual behaviour.
    As you mention, for now, you need to run two m=0 transforms, one for real, one for imaginary part.

  2. Log in to comment