From e25e0d95600b548f2237163e8fd88b219397fca4 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Fri, 3 Nov 2017 13:38:08 +0800 Subject: Deprecate np.int, np.float See: https://github.com/numpy/numpy/pull/6103 --- fg21sim/galactic/synchrotron.py | 2 +- fg21sim/sky.py | 4 ++-- fg21sim/utils/reproject.py | 6 +++--- fg21sim/uvsim/telescope.py | 6 +++--- 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 +# Copyright (c) 2016-2017 Weitian LI # 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) } -- cgit v1.2.2