示例#1
0
def glm2vtm(s, tht, glm):
    if s == 0:
        lmax = util.nlm2lmax(len(glm))
        ret = np.empty((len(tht), 2 * lmax + 1), dtype=complex)
        ret[:, lmax:] = fsht.glm2vtm_s0(lmax, tht, glm)
        ret[:, 0:lmax] = (ret[:, slice(2 * lmax + 1, lmax, -1)]).conjugate()
        return ret
    return vlm2vtm(s, tht, util.alm2vlm(glm))
示例#2
0
def glm2vtm_sym(s, tht, glm):
    """
    Same as above but returns for each 'tht' the result for pi -tht as well, for a factor 1.5 speed-up.
    Output has shape 2 * len(tht) x 2 * lmax + 1
    """
    if s == 0:
        lmax = util.nlm2lmax(len(glm))
        ret = np.empty((2 * len(tht), 2 * lmax + 1), dtype=complex)
        ret[:, lmax:] = fsht.glm2vtm_s0sym(lmax, tht, -glm)
        ret[:, 0:lmax] = (ret[:, slice(2 * lmax + 1, lmax, -1)]).conjugate()
        return ret
    return vlm2vtm_sym(s, tht, util.alm2vlm(glm))