aboutsummaryrefslogtreecommitdiffstats
path: root/fg21sim
diff options
context:
space:
mode:
authorAaron LI <aly@aaronly.me>2017-11-03 13:38:08 +0800
committerAaron LI <aly@aaronly.me>2017-11-03 13:38:08 +0800
commite25e0d95600b548f2237163e8fd88b219397fca4 (patch)
tree2587f9b848a686df3c1124387fddf58fc1835e63 /fg21sim
parent7a88ee0ecbc74ece326249c90ecb170f087be2d0 (diff)
downloadfg21sim-e25e0d95600b548f2237163e8fd88b219397fca4.tar.bz2
Deprecate np.int, np.float
See: https://github.com/numpy/numpy/pull/6103
Diffstat (limited to 'fg21sim')
-rw-r--r--fg21sim/galactic/synchrotron.py2
-rw-r--r--fg21sim/sky.py4
-rw-r--r--fg21sim/utils/reproject.py6
-rw-r--r--fg21sim/uvsim/telescope.py6
4 files changed, 9 insertions, 9 deletions
diff --git a/fg21sim/galactic/synchrotron.py b/fg21sim/galactic/synchrotron.py
index 2d1a59f..525845b 100644
--- a/fg21sim/galactic/synchrotron.py
+++ b/fg21sim/galactic/synchrotron.py
@@ -114,7 +114,7 @@ class Synchrotron:
alpha = 0.0599
beta = 0.782
# angular power spectrum of the Gaussian random field
- ell = np.arange(self.lmax+1).astype(np.int)
+ ell = np.arange(self.lmax+1, dtype=int)
cl = np.zeros(ell.shape)
ell_idx = ell >= self.lmin
cl[ell_idx] = (ell[ell_idx] ** gamma *
diff --git a/fg21sim/sky.py b/fg21sim/sky.py
index a8b0705..724e3fa 100644
--- a/fg21sim/sky.py
+++ b/fg21sim/sky.py
@@ -545,8 +545,8 @@ class SkyPatch(SkyBase):
pixelsize = self.pixelsize * AUC.arcsec2deg # [deg]
x, y = np.asarray(x), np.asarray(y) # [deg]
ri0, ci0 = self.ysize//2, self.xsize//2
- ri = np.round((y - self.ycenter) / pixelsize + ri0).astype(np.int)
- ci = np.round((x - self.xcenter) / pixelsize + ci0).astype(np.int)
+ ri = np.round((y - self.ycenter) / pixelsize + ri0).astype(int)
+ ci = np.round((x - self.xcenter) / pixelsize + ci0).astype(int)
return (ri, ci)
def load(self, infile, frequency=None):
diff --git a/fg21sim/utils/reproject.py b/fg21sim/utils/reproject.py
index 8b3d34f..f244246 100644
--- a/fg21sim/utils/reproject.py
+++ b/fg21sim/utils/reproject.py
@@ -1,4 +1,4 @@
-# Copyright (c) 2016 Weitian LI <liweitianux@live.com>
+# Copyright (c) 2016-2017 Weitian LI <weitian@aaronly.me>
# MIT license
"""
@@ -129,7 +129,7 @@ def _image_to_healpix(image, wcs, nside, order=1, hemisphere=None):
raise ValueError("invalid hemisphere: {0}".format(hemisphere))
#
npix = hp.nside2npix(nside)
- hpidx = np.arange(npix).astype(np.int)
+ hpidx = np.arange(npix, dtype=int)
logger.info("Output HEALPix: Nside={0}, Npixel={1}".format(nside, npix))
# Calculate the longitude and latitude in frame of output HEALPix
logger.info("Calculate the longitudes and latitudes on the HEALPix grid")
@@ -288,7 +288,7 @@ def zea2healpix(img1, img2, nside, order=1, inpaint=False,
# Merge the two HEALPix data
hp_nan1 = np.isnan(hp_data1)
hp_nan2 = np.isnan(hp_data2)
- hp_mask = (~hp_nan1).astype(np.int) + (~hp_nan2).astype(np.int)
+ hp_mask = (~hp_nan1).astype(int) + (~hp_nan2).astype(int)
hp_data1[hp_nan1] = 0.0
hp_data2[hp_nan2] = 0.0
hp_data = hp_data1 + hp_data2
diff --git a/fg21sim/uvsim/telescope.py b/fg21sim/uvsim/telescope.py
index d567591..16b627d 100644
--- a/fg21sim/uvsim/telescope.py
+++ b/fg21sim/uvsim/telescope.py
@@ -238,9 +238,9 @@ class SKA1Low:
x, y = np.zeros(n), np.zeros(n)
grid = {
- "start": np.zeros((grid_size, grid_size), dtype=np.int),
- "end": np.zeros((grid_size, grid_size), dtype=np.int),
- "count": np.zeros((grid_size, grid_size), dtype=np.int),
+ "start": np.zeros((grid_size, grid_size), dtype=int),
+ "end": np.zeros((grid_size, grid_size), dtype=int),
+ "count": np.zeros((grid_size, grid_size), dtype=int),
"next": np.zeros(n, dtype=int)
}