around_region

psfsubtraction.fitpsf.around_region(self, region, indpsf)[source] [edit on github]

similar to dilated_region, but exclude all pixels in region itself.

See dilated_region for options.

Examples

>>> from psfsubtraction.fitpsf import fitters
>>> from psfsubtraction.fitpsf import optregion
>>> region = np.array([[True, False, False],                            [False, False, False],                            [False, False, False]])
>>> dummy_image = np.ones((3, 3)) # boring image, but good enough for the example
>>> dummy_psfs = np.ones((3,3,4)) # even more boring psf array.
>>> class AroundFitter(fitters.SimpleSubtraction):
...     optregion = optregion.around_region
...     dilation_region = 1
>>> myfitter = AroundFitter(dummy_psfs, dummy_image)
>>> myfitter.optregion(region.ravel(), [0]).reshape((3, 3))
array([[False,  True, False],
       [ True,  True, False],
       [False, False, False]])