From dd54669aec9843b5d4808bfd0cd26da325e914d5 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Sat, 3 Feb 2018 16:18:33 +0800 Subject: Numba: disable/restrict JIT usage -> TODO: Cython --- fg21sim/utils/grid.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'fg21sim/utils') diff --git a/fg21sim/utils/grid.py b/fg21sim/utils/grid.py index abca9ce..13bb776 100644 --- a/fg21sim/utils/grid.py +++ b/fg21sim/utils/grid.py @@ -8,11 +8,12 @@ Grid utilities. import numpy as np # import numba as nb +import healpy as hp from scipy import ndimage from .draw import ellipse # from .transform import rotate_center -from .healpix import ang2pix_ring +# from .healpix import ang2pix_ring # @nb.jit(nopython=True) @@ -223,7 +224,8 @@ def map_grid_to_healpix(grid, nside): gridmap = grid[2].flatten() phi = np.radians(lon) theta = np.radians(90.0 - lat) - ipix = ang2pix_ring(nside, theta, phi) + # ipix = ang2pix_ring(nside, theta, phi) + ipix = hp.ang2pix(nside, theta, phi, nest=False) # Get the corresponding input grid pixels for each HEALPix pixel # XXX: ``numba`` currently does not support ``numpy.unique()`` ipix_perm = ipix.argsort() -- cgit v1.2.2