From b9697f8e8c10ab80f4c24652833f33ab1a8b620b Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Mon, 14 Aug 2017 09:40:12 +0800 Subject: Fix the warning on scipy.ndimage.zoom output shape calculation scipy.ndimage.zoom calculate the output/zoomed image shape with round(), while the old versions use int() instead. When the two calculations are different, a warning is raised. This commit fixes the calculation mismatch. Signed-off-by: Aaron LI --- fg21sim/sky.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'fg21sim/sky.py') diff --git a/fg21sim/sky.py b/fg21sim/sky.py index ab7f42b..ede9c1d 100644 --- a/fg21sim/sky.py +++ b/fg21sim/sky.py @@ -504,7 +504,8 @@ class SkyPatch(SkyBase): if (self.xsize_in != self.xsize) or (self.ysize_in != self.ysize): logger.warning("Scale input sky patch to size %dx%d" % (self.xsize, self.ysize)) - zoom = (self.ysize/self.ysize_in, self.xsize/self.xsize_in) + zoom = ((self.ysize+0.1)/self.ysize_in, + (self.xsize+0.1)/self.xsize_in) self.data = ndimage.zoom(self.data, zoom=zoom, order=1) def write(self, outfile, clobber=None): -- cgit v1.2.2