What’s New in Photutils 1.5?

Smoothing data prior to source detection and deblending

The kernel keyword was deprecated from the detect_sources and deblend_sources functions. Instead the user should create a (background-subtracted) convolved image and input it directly into these functions. Doing so improves the overall performance by omitting extra convolution steps within each function or class. Both the (background subtracted) unconvolved and convolved images should be input into the SourceCatalog class.

A make_2dgaussian_kernel convenience function was added for creating 2D Gaussian kernels.

New SourceFinder class

A new SourceFinder convenience class was added, combining source detection and deblending. The detect_sources and deblend_sources functions also still remain available. The separate tools can be used, for example, to effienciently explore the various deblending parameters.

Source Deblending Performance Improvements

The performance of the deblend_sources has been significantly improved. Also, deblend_sources and SourceFinder now have a nproc keyword to enable multiprocessing during source deblending. Please note that due to overheads, multiprocessing may be slower than serial processing. This is especially true if one only has a small number of sources to deblend. The benefits of multiprocessing require ~1000 or more sources to deblend, with larger gains as the number of sources increase.

Also, a new sinh multi-thresholding mode was added to deblend_sources (also available in the new SourceFinder).

New SegmentationImage methods

SegmentationImage has a new make_source_mask method to create a source mask by dilating the segmentation image with a user-defined footprint. A new circular_footprint convenience function was added to create circular footprints.

There is also a new imshow convenience method for plotting the segmentation image.

SourceCatalog minimum Kron radius

A minimum value for the unscaled Kron radius can now be specified as the second element of the kron_params keyword input to SourceCatalog. The kron_params keyword now has an optional third item representing the minimum circular radius.

Custom cutouts from SourceCatalog

The SourceCatalog has a new make_cutouts method for making custom-sized image cutouts for each labeled source centered at their centroid. The cutouts are instances of a new CutoutImage class.

PSF-Fitting Masks

The BasicPSFPhotometry, IterativelySubtractedPSFPhotometry and DAOPhotPSFPhotometry PSF-fitting instances now accept a mask keyword when called with the input data to mask bad pixels. Invalid data values (i.e., NaN or inf) are now automatically masked when performing PSF fitting. The Astropy/Scipy fitters do not actually perform a fit if such invalid values are in the data.

Keyword-only arguments are now required for PSF tools

Keyword arguments used in the PSF tools must now be explicitly input using the keyword name.

Progress Bars

The deblend_sources function and the EPSFBuilder class now have options to use a progress bar using the new tqdm optional dependency.

Other changes

Please see the Changelog for the complete list of changes.