Commit 2490fb7d authored by Maude Le Jeune's avatar Maude Le Jeune
Browse files

add needlet facility

parent a92cb815
......@@ -29,6 +29,7 @@ from spherelib_bin import _make_prolate
from fitsfunc2 import *
from bin import *
from alm import *
from needlet import *
from utils import *
from cov import *
import myIO
needlet coefficients computations.
# Copyright (C) 2009 APC CNRS Universite Paris Diderot
# <>
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, see
from pylab import *
import utils
import spherelib_alm
import bin
import healpy as hp
def need2alm (lstmap, wfss):
""" Perform inverse needlet transform.
lstmap: list of healpix maps
wfss: array-like, synthesis needlet window functions : shape (lmax+1, nscales)
healpix alm coefficients
nscale = shape(wfss)[1]
lmax = shape(wfss)[0]-1
nalm = (lmax+1)*(lmax+2)/2
combalm = zeros((nalm), dtype=complex128)
for j in range(nscale):
lmaxj = find(wfss[:,j]==0)[0]-1
wfs = wfss[0:lmaxj+1,j]
alm = hp.map2alm (lstmap[j], lmaxj)
alm = hp.almxfl(alm, wfs)
nalmj = len(alm)
for l in range(lmaxj+1):
i =hp.Alm.getidx(lmaxj,l,npy.arange(min(lmaxj,l)+1))
ci =hp.Alm.getidx(lmax,l,npy.arange(min(lmax,l)+1))
combalm[ci] = combalm[ci]+alm[i]
return combalm
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment