photutils
photutils copied to clipboard
Checks for NDData and data/subshape dimension length agreement in subtract_psf
This PR fixes a few minor check/edge cases in subtract_psf.
-
The docstrings say that
datacan be anastropy.nddata.NDDataobject, but the first line previously checked fordata.ndimwhich would throw anAttributeErrorfor anNDDataobject. -
Currently the only check on whether the PSF can be subtracted directly from the image or if a cutout is required is
if subshape is None, but equally true would be the case wheredataandsubshapeare equal in both dimensions, which bypasses unnecessary code inextract_arrayandadd_array.
Closes #818 (at least the case where both dimension lengths are equal; for the final edge case of one equal one non-equal dimension length add_array would need amending)