Skip to content
This repository was archived by the owner on Dec 15, 2020. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions imageutils/array_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,13 @@ def extract_array_2d(array_large, shape, position):
array of ones with a shape of 3x4:

>>> import numpy as np
>>> from photutils.utils import extract_array_2d
>>> large_array = np.zeros((11, 10))
>>> from imageutils.array_utils import extract_array_2d
>>> large_array = np.arange(110).reshape((11, 10))
>>> large_array[4:9, 4:9] = np.ones((5, 5))
>>> extract_array_2d(large_array, (3, 4), (7, 7))
array([[ 1., 1., 1., 1., 0.],
[ 1., 1., 1., 1., 0.],
[ 1., 1., 1., 1., 0.]])
array([[65, 66, 67, 68, 69],
[75, 76, 77, 78, 79],
[85, 86, 87, 88, 89]])
"""
# Check if larger array is really larger
if array_large.shape >= shape:
Expand Down