Skip to content

Commit 9673a3b

Browse files
committed
implemented distributed almxfl
1 parent 6bcd33a commit 9673a3b

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

python/libsharp/libsharp.pyx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,18 @@ cdef class alm_info:
246246
sharp_destroy_alm_info(self.ainfo)
247247
self.ainfo = NULL
248248

249+
def almxfl(self, np.ndarray[double, ndim=3, mode='c'] alm, np.ndarray[double, ndim=1, mode='c'] fl, int rank):
250+
"""Multiply Alm by a Ell based array
251+
252+
For example beam smoothing"""
253+
mvstart = 0
254+
for m in self.mval():
255+
f = 1 if (m==0) else 2
256+
num_ells = self.ainfo.lmax + 1 - m
257+
for i_l in range(num_ells):
258+
l = m + i_l
259+
alm[:,:,mvstart + f*i_l:mvstart + f*i_l +f] *= fl[l]
260+
mvstart += f * num_ells
249261

250262
cdef class triangular_order(alm_info):
251263
def __init__(self, int lmax, mmax=None, stride=1):

0 commit comments

Comments
 (0)