aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron LI <aaronly.me@outlook.com>2016-10-26 15:36:57 +0800
committerAaron LI <aaronly.me@outlook.com>2016-10-26 15:36:57 +0800
commit7cf0e5977e4a885595ca0931f26a5fef7dc8f82e (patch)
treebdb4735b5407e757ca3d73c4ee135e1d3dbae848
parentc8eecaef2477209db0b4c19fa1811841b798da63 (diff)
downloadfg21sim-7cf0e5977e4a885595ca0931f26a5fef7dc8f82e.tar.bz2
utils/grid.py: Use own-implemented JIT-optimized "rotate_center()"
Also remove the dependence on "scipy".
-rw-r--r--fg21sim/utils/grid.py6
-rw-r--r--requirements.txt1
-rwxr-xr-xsetup.py1
3 files changed, 3 insertions, 5 deletions
diff --git a/fg21sim/utils/grid.py b/fg21sim/utils/grid.py
index 7a81ea2..ca9510c 100644
--- a/fg21sim/utils/grid.py
+++ b/fg21sim/utils/grid.py
@@ -8,9 +8,9 @@ Grid utilities.
import numpy as np
import numba as nb
-from scipy import ndimage
from .draw import ellipse
+from .rotate import rotate_center
from .healpix import ang2pix_ring
@@ -136,8 +136,8 @@ def make_grid_ellipse(center, size, resolution, rotation=None):
gridmap[rr, cc] = 1.0
if rotation is not None:
# Rotate the ellipse
- gridmap = ndimage.rotate(gridmap, angle=rotation, order=1,
- reshape=False)
+ gridmap = rotate_center(gridmap, angle=rotation, interp=True,
+ reshape=False, fill_value=0.0)
return (lon, lat, gridmap)
diff --git a/requirements.txt b/requirements.txt
index 60199f0..a072943 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,6 +1,5 @@
numpy
numba
-scipy
pandas
astropy
healpy
diff --git a/setup.py b/setup.py
index 1fce5c6..99aa4eb 100755
--- a/setup.py
+++ b/setup.py
@@ -81,7 +81,6 @@ setup(
install_requires=[
"numpy",
"numba",
- "scipy",
"pandas",
"astropy",
"healpy",