Search code examples
pythonhealpy

Obtain a_lms (spherical harmonic decomposition) of a cut sky in healpy


I am using HEALpy to work with some sky maps and I need to obtain the spherical harmonic decomposition of these. Usually I would use map2alm, but I am using partial sky maps, so I have some pixels which we have no information from. Is there a way to handle this with healpy?

Sometimes I have just given the value 0 to the pixels from which we have no information, but this is not accurate, since edge effects appear and the transformation is not accurate enough.


Solution

  • For an approximate solution, you can remove the mean of the map with healpy, so that you reduce the boundary effects:

    m_masked = hp.ma(m)
    m_masked -= m_masked.mean()
    

    Then you can apodize your mask using hp.smoothing so that you reduce the effect of the discontinuity between the observed and unobserved sky.

    For a proper analysis which corrects for the impact of the cut sky on your Spherical Harmonics transform you should use NaMaster instead of healpy:

    https://namaster.readthedocs.io/en/latest/index.html