diff --git a/python/_cosmotool.pyx b/python/_cosmotool.pyx index bd89d4e..c11f743 100644 --- a/python/_cosmotool.pyx +++ b/python/_cosmotool.pyx @@ -425,6 +425,8 @@ def leanCic(float[:,:] particles, float L, int Resolution): cdef np.uint64_t i cdef CICType *field cdef np.uint32_t dummyRes + cdef np.ndarray[np.float64_t, ndim=3] out_field + cdef np.uint64_t j cic = new CICFilter(Resolution, L) cic.resetMesh() @@ -443,6 +445,9 @@ def leanCic(float[:,:] particles, float L, int Resolution): dummyRes = 0 cic.getDensityField(field, dummyRes) - + out_field = np.empty((dummyRes, dummyRes, dummyRes), dtype=np.float64) + for j in xrange(out_field.size): + out_field[j] = field[j] del cic + return out_field