From 07da503877005e1099a138b443f80a4c84b899dd Mon Sep 17 00:00:00 2001 From: Andrea Zonca Date: Wed, 15 Nov 2017 07:25:52 -0800 Subject: [PATCH] [bugfix] wrong ntrans passed to libsharp --- python/libsharp/libsharp.pyx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/python/libsharp/libsharp.pyx b/python/libsharp/libsharp.pyx index c2c7834..91f198b 100644 --- a/python/libsharp/libsharp.pyx +++ b/python/libsharp/libsharp.pyx @@ -63,7 +63,8 @@ def sht(jobtype, geom_info ginfo, alm_info ainfo, double[:, :, ::1] input, cdef int r cdef sharp_jobtype jobtype_i cdef double[:, :, ::1] output_buf - cdef int ntrans = input.shape[0] * input.shape[1] + cdef int ntrans = input.shape[0] + cdef int ntotcomp = ntrans * input.shape[1] cdef int i, j if spin == 0 and input.shape[1] != 1: @@ -72,9 +73,9 @@ def sht(jobtype, geom_info ginfo, alm_info ainfo, double[:, :, ::1] input, raise ValueError('For spin != 0, we need input.shape[1] == 2') - cdef size_t[::1] ptrbuf = np.empty(2 * ntrans, dtype=np.uintp) + cdef size_t[::1] ptrbuf = np.empty(2 * ntotcomp, dtype=np.uintp) cdef double **alm_ptrs = &ptrbuf[0] - cdef double **map_ptrs = &ptrbuf[ntrans] + cdef double **map_ptrs = &ptrbuf[ntotcomp] try: jobtype_i = JOBTYPE_TO_CONST[jobtype]