[Scipy-svn] r2925 - trunk/Lib/stsci/convolve/lib
scipy-svn at scipy.org
scipy-svn at scipy.org
Mon Apr 16 13:03:09 EDT 2007
Author: chanley
Date: 2007-04-16 12:03:07 -0500 (Mon, 16 Apr 2007)
New Revision: 2925
Modified:
trunk/Lib/stsci/convolve/lib/iraf_frame.py
Log:
iraf_frame.py module in convolve ported to numpy by Nadia Dencheva.
Modified: trunk/Lib/stsci/convolve/lib/iraf_frame.py
===================================================================
--- trunk/Lib/stsci/convolve/lib/iraf_frame.py 2007-04-16 15:51:28 UTC (rev 2924)
+++ trunk/Lib/stsci/convolve/lib/iraf_frame.py 2007-04-16 17:03:07 UTC (rev 2925)
@@ -12,7 +12,8 @@
and the contents of 'a' in the center. The boundary pixels are
copied from the nearest edge pixel in 'a'.
- >>> a = num.arange(16, shape=(4,4))
+ >>> a = num.arange(16)
+ >>> a.shape=(4,4)
>>> frame_nearest(a, (8,8))
array([[ 0, 0, 0, 1, 2, 3, 3, 3],
[ 0, 0, 0, 1, 2, 3, 3, 3],
@@ -50,7 +51,8 @@
and the contents of 'a' in the center. The boundary pixels are
reflected from the nearest edge pixels in 'a'.
- >>> a = num.arange(16, shape=(4,4))
+ >>> a = num.arange(16)
+ >>> a.shape = (4,4)
>>> frame_reflect(a, (8,8))
array([[ 5, 4, 4, 5, 6, 7, 7, 6],
[ 1, 0, 0, 1, 2, 3, 3, 2],
@@ -62,7 +64,7 @@
[ 9, 8, 8, 9, 10, 11, 11, 10]])
"""
- b = num.zeros(shape, typecode=a.type())
+ b = num.zeros(shape, dtype=a.dtype)
delta = (num.array(b.shape) - num.array(a.shape))
dy = delta[0] // 2
dx = delta[1] // 2
@@ -87,7 +89,8 @@
and the contents of 'a' in the center. The boundary pixels are
wrapped around to the opposite edge pixels in 'a'.
- >>> a = num.arange(16, shape=(4,4))
+ >>> a = num.arange(16)
+ >>> a.shape=(4,4)
>>> frame_wrap(a, (8,8))
array([[10, 11, 8, 9, 10, 11, 8, 9],
[14, 15, 12, 13, 14, 15, 12, 13],
@@ -100,7 +103,7 @@
"""
- b = num.zeros(shape, typecode=a.type())
+ b = num.zeros(shape, dtype=a.dtype)
delta = (num.array(b.shape) - num.array(a.shape))
dy = delta[0] // 2
dx = delta[1] // 2
@@ -125,7 +128,8 @@
and the contents of 'a' in the center. The boundary pixels are
copied from the nearest edge pixel in 'a'.
- >>> a = num.arange(16, shape=(4,4))
+ >>> a = num.arange(16)
+ >>> a.shape=(4,4)
>>> frame_constant(a, (8,8), cval=42)
array([[42, 42, 42, 42, 42, 42, 42, 42],
[42, 42, 42, 42, 42, 42, 42, 42],
@@ -138,7 +142,7 @@
"""
- b = num.zeros(shape, typecode=a.type())
+ b = num.zeros(shape, dtype=a.dtype)
delta = (num.array(b.shape) - num.array(a.shape))
dy = delta[0] // 2
dx = delta[1] // 2
More information about the Scipy-svn
mailing list