Package convolve :: Module iraf_frame
[hide private]
[frames] | no frames]

Module iraf_frame

source code

Functions [hide private]
 
frame_nearest(a, shape, cval=None)
frame_nearest creates an oversized copy of 'a' with new 'shape' and the contents of 'a' in the center.
source code
 
frame_reflect(a, shape, cval=None)
frame_reflect creates an oversized copy of 'a' with new 'shape' and the contents of 'a' in the center.
source code
 
frame_wrap(a, shape, cval=None)
frame_wrap creates an oversized copy of 'a' with new 'shape' and the contents of 'a' in the center.
source code
 
frame_constant(a, shape, cval=0)
frame_nearest creates an oversized copy of 'a' with new 'shape' and the contents of 'a' in the center.
source code
 
frame(a, shape, mode='nearest', cval=0.0)
frame creates an oversized copy of 'a' with new 'shape', with extra pixels being supplied according to IRAF boundary mode, 'mode'.
source code
 
unframe(a, shape)
unframe extracts the center slice of framed array 'a' which had 'shape' prior to framing.
source code
 
test() source code
Variables [hide private]
  _frame_dispatch = {"nearest": frame_nearest, "reflect": frame_...
  __package__ = 'convolve'

Imports: num


Function Details [hide private]

frame_nearest(a, shape, cval=None)

source code 

frame_nearest creates an oversized copy of 'a' with new 'shape' and the contents of 'a' in the center. The boundary pixels are copied from the nearest edge pixel in 'a'.

>>> 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],
       [ 0,  0,  0,  1,  2,  3,  3,  3],
       [ 4,  4,  4,  5,  6,  7,  7,  7],
       [ 8,  8,  8,  9, 10, 11, 11, 11],
       [12, 12, 12, 13, 14, 15, 15, 15],
       [12, 12, 12, 13, 14, 15, 15, 15],
       [12, 12, 12, 13, 14, 15, 15, 15]])

frame_reflect(a, shape, cval=None)

source code 

frame_reflect creates an oversized copy of 'a' with new 'shape' and the contents of 'a' in the center. The boundary pixels are reflected from the nearest edge pixels in 'a'.

>>> 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],
       [ 1,  0,  0,  1,  2,  3,  3,  2],
       [ 5,  4,  4,  5,  6,  7,  7,  6],
       [ 9,  8,  8,  9, 10, 11, 11, 10],
       [13, 12, 12, 13, 14, 15, 15, 14],
       [13, 12, 12, 13, 14, 15, 15, 14],
       [ 9,  8,  8,  9, 10, 11, 11, 10]])

frame_wrap(a, shape, cval=None)

source code 

frame_wrap creates an oversized copy of 'a' with new 'shape' 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)
>>> 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],
       [ 2,  3,  0,  1,  2,  3,  0,  1],
       [ 6,  7,  4,  5,  6,  7,  4,  5],
       [10, 11,  8,  9, 10, 11,  8,  9],
       [14, 15, 12, 13, 14, 15, 12, 13],
       [ 2,  3,  0,  1,  2,  3,  0,  1],
       [ 6,  7,  4,  5,  6,  7,  4,  5]])

frame_constant(a, shape, cval=0)

source code 

frame_nearest creates an oversized copy of 'a' with new 'shape' and the contents of 'a' in the center. The boundary pixels are copied from the nearest edge pixel in 'a'.

>>> 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],
       [42, 42,  0,  1,  2,  3, 42, 42],
       [42, 42,  4,  5,  6,  7, 42, 42],
       [42, 42,  8,  9, 10, 11, 42, 42],
       [42, 42, 12, 13, 14, 15, 42, 42],
       [42, 42, 42, 42, 42, 42, 42, 42],
       [42, 42, 42, 42, 42, 42, 42, 42]])

Variables Details [hide private]

_frame_dispatch

Value:
{"nearest": frame_nearest, "reflect": frame_reflect, "wrap": frame_wra\
p, "constant": frame_constant}