dilated_region¶
-
psfsubtraction.fitpsf.dilated_region(self, region, indpsf)[source] [edit on github]¶ Specify a optimization region that extends around the
region.This requires that the fitter has an attribute
dilatation_region, which can be- an int: In this case a square matrix of size 2 * n + 1 is used.
- a matrix (see
scipy.ndimage.binary_dilationfor details.
Examples
>>> from psfsubtraction.fitpsf import fitters >>> from psfsubtraction.fitpsf import optregion >>> region = np.array([[True, False, False], [False, False, False], [False, False, False]]) >>> class DilationFitter(fitters.SimpleSubtraction): ... optregion = optregion.dilated_region ... dilation_region = 1 >>> 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. >>> myfitter = DilationFitter(dummy_psfs, dummy_image) >>> myfitter.optregion(region, [0]).reshape((3, 3)) array([[ True, True, False], [ True, True, False], [False, False, False]])