------------------
General
^^^^^^^
- The ``regions`` package is now an optional dependency. [1813]
- The minimum required Astropy is now 5.3. [1839]
- SciPy is now a required dependency. [1880]
- The minimum required SciPy is now 1.10. [1880]
- The minimum required NumPy is now 1.24. [1881]
- The minimum required Matplotlib is now 3.7. [1881]
- The minimum required GWCS is now 0.19. [1881]
- Importing tools from all subpackages now requires including the
subpackage name. Also, PSF matching tools must now be imported from
``photutils.psf.matching`` instead of ``photutils.psf``. [1879, 1904]
New Features
^^^^^^^^^^^^
- ``photutils.aperture``
- The metadata in the tables generated by ``aperture_photometry`` and
``ApertureStats`` now include the aperture name and shape
parameters. [1849]
- ``aperture_photometry`` and ``ApertureStats`` now accept supported
``regions.Region`` objects, i.e., those corresponding to circular,
elliptical, and rectangular apertures. [1813, 1852]
- A new ``region_to_aperture`` convenience function has been added to
convert supported ``regions.Region`` objects to ``Aperture`` objects.
[1813, 1852]
- ``photutils.background``
- The ``Background2D`` class has been refactored to significantly
reduce its memory usage. In some cases, it is also significantly
faster. [1870, 1872, 1873]
- A new ``npixels_mesh`` property was added to ``Background2D``
that gives a 2D array of the number of pixels used to compute the
statistics in the low-resolution grid. [1870]
- A new ``npixels_map`` property was added to ``Background2D``
that gives a 2D array of the number of pixels used to compute the
statistics in each mesh, resized to the shape of the input data.
[1871]
- ``photutils.centroids``
- ``Quantity`` arrays can now be input to ``centroid_1dg`` and
``centroid_2dg``. [1861]
- ``photutils.datasets``
- Added a new ``params_table_to_models`` function to create a list of
models from a table of model parameters. [1896]
- ``photutils.psf``
- Added new ``xy_bounds`` keyword to ``PSFPhotometry`` and
``IterativePSFPhotometry`` to allow one to bound the x and y
model parameters during the fitting. [1805]
- The ``extract_stars`` function can now accept ``NDData`` inputs with
uncertainty types other than ``weights``. [1821]
- Added new ``GaussianPSF``, ``CircularGaussianPSF``, ``GaussianPRF``,
``CircularGaussianPRF``, and ``MoffatPSF`` PSF model classes.
[1838, 1898, 1918]
- Added new ``AiryDiskPSF`` PSF model class. [1843, 1918]
- Added new ``CircularGaussianSigmaPRF`` PSF model class. [1845,
1918]
- The ``IntegratedGaussianPRF`` model now supports units. [1838]
- A new ``results`` attribute was added to ``PSFPhotometry`` to store
the returned table of fit results. [1858]
- Added new ``fit_fwhm`` convenience function to estimate the FWHM of
one or more sources in an image by fitting a circular 2D Gaussian PSF
model. [1859, 1887, 1899, 1918]
- Added new ``fit_2dgaussian`` convenience function to fit a circular
2D Gaussian PSF to one or more sources in an image. [1859, 1887,
1899]
- Added new ``ImagePSF`` model class to represent a PSF model as an
image. [1890]
- The ``GriddedPSFModel`` model now has a ``bounding_box`` method to
return the bounding box of the model. [1891]
- The ``GriddedPSFModel`` class has been refactored to significantly
improve its performance. In typical PSF photometry use cases, it is
now about 4 times faster than previous versions. [1903]
- ``photutils.segmentation``
- Reduced the memory usage and improved the performance of source
deblending with ``deblend_sources`` and ``SourceFinder``. [1924,
1925, 1926]
- Improved the accuracy of the progress bar in ``deblend_sources`` and
``SourceFinder`` when using multiprocessing. Also added the source
ID label number to the progress bar. [1925, 1926]
Bug Fixes
^^^^^^^^^
- ``photutils.aperture``
- Fixed a bug checking that the ``subpixels`` keyword is a strictly
positive integer. [1816]
- ``photutils.datasets``
- Fixed an issue in ``make_model_image`` where if the ``bbox_factor``
was input and the model bounding box did not have a ``factor`` keyword
then an error would be raised. [1921]
- ``photutils.detection``
- Fixed an issue where ``DAOStarFinder`` would not return any sources
if the input ``threshold`` was set to zero due to the ``flux`` being
non-finite. [1882]
- ``photutils.isophote``
- Fixed a bug in ``build_ellipse_model`` where if
``high_harmonics=True``, the harmonics were not correctly added to
the model. [1810]
- ``photutils.psf``
- Fixed a bug in ``make_psf_model`` where if the input model had
amplitude units, an error would be raised. [1894]
API Changes
^^^^^^^^^^^
- The ``sklearn`` version information has been removed from the meta
attribute in output tables. ``sklearn`` was removed as an optional
dependency in 1.13.0. [1807]
- ``photutils.background``
- The ``Background2D`` ``background_mesh`` and ``background_rms_mesh``
properties will have units if the input data has units. [1870]
- The ``Background2D`` ``edge_method`` keyword is now deprecated.
When ``edge_method`` is eventually removed, the ``'pad'`` option
will always be used. [1870]
- The ``Background2D`` ``background_mesh_masked``,
``background_rms_mesh_masked``, and ``mesh_nmasked`` properties are
now deprecated. [1870]
- To reduce memory usage, ``Background2D`` no longer keeps a cached
copy of the returned ``background`` and ``background_rms`` properties.
[1870]
- The ``Background2D`` ``data``, ``mask``, ``total_mask``, ``nboxes``,
``box_npixels``, and ``nboxes_tot`` attributes have been removed.
[1870]
- The ``BkgZoomInterpolator`` ``grid_mode`` keyword is now deprecated.
When ``grid_mode`` is eventually removed, the `True` option will
always be used. [1870]
- The ``Background2D`` ``background``, ``background_rms``,
``background_mesh``, and ``background_rms_mesh`` properties now have
the same ``dtype`` as the input data. [1922]
- ``photutils.centroids``
- For consistency with other fitting functions (including PSF
fitting), the ``centroid_1dg`` and ``centroid_2dg`` functions
now fit only a 1D or 2D Gaussian model, respectively, excluding
any constant component. The input data are required to be
background-subtracted. [1861]
- The fitter used in ``centroid_1dg`` and ``centroid_2dg`` was changed
from ``LevMarLSQFitter`` to ``TRFLSQFitter``. ``LevMarLSQFitter`` uses
the legacy SciPy function ``scipy.optimize.leastsq``, which is no
longer recommended. [1917]
- ``photutils.datasets``
- The deprecated ``make`` module has been removed. Instead of
importing functions from ``photutils.datasets.make``, import
functions from ``photutils.datasets``. [1884]
- The deprecated ``make_model_sources_image``,
``make_gaussian_prf_sources_image``, ``make_gaussian_sources_table``,
``make_test_psf_data``, ``make_random_gaussians_table``, and
``make_imagehdu`` functions have been removed. [1884]
- ``photutils.detection``
- The deprecated ``sky`` keyword in ``DAOStarFinder`` and
``IRAFStarFinder`` has been removed. Also, there will no longer be a
``sky`` column in the output table. [1884]
- The ``DAOStarFinder`` ``flux`` and ``mag`` columns were changed
to give sensible values. Previously, the ``flux`` value was defined
by the original DAOFIND algorithm as a measure of the intensity
ratio of the amplitude of the best fitting Gaussian function at the
object position to the detection threshold. A ``daofind_mag`` column
was added for comparison to the original IRAF DAOFIND algorithm.
[1885]
- ``photutils.isophote``
- The ``build_ellipse_model`` function now raises a ``ValueError`` if
the input ``isolist`` is empty. [1809]
- ``photutils.profiles``
- The fitter used in ``RadialProfile`` to fit the profile
with a Gaussian was changed from ``LevMarLSQFitter`` to
``TRFLSQFitter``. ``LevMarLSQFitter`` uses the legacy SciPy function
``scipy.optimize.leastsq``, which is no longer recommended. [1899]
- ``photutils.psf``
- The ``IntegratedGaussianPRF`` class now must be initialized using
keyword-only arguments. [1838]
- The ``IntegratedGaussianPRF`` class has been moved to the new
``functional_models`` module. [1838]
- The ``models`` and ``griddedpsfmodel`` modules have been renamed to
``image_models`` and ``gridded_models``, respectively. [1838]
- The ``IntegratedGaussianPRF`` model class has been renamed to
``CircularGaussianPRF``. ``IntegratedGaussianPRF`` is now
deprecated. [1845]
- Some PSF tools have moved to new modules. The ``PRFAdapter``
class and the ``make_psf_model`` and ``grid_from_epsfs``
functions have been moved to the new ``model_helpers`` module.
The ``make_psf_model_image`` function has been moved to the new
``simulations`` module. It is recommended that all of these tools be
imported from ``photutils.psf`` without using the submodule name.
[1854, 1901]
- The ``PSFPhotometry`` ``fit_results`` attribute has been renamed to
``fit_info``. ``fit_results`` is now deprecated. [1858]
- The ``PRFAdapter`` class has been deprecated. Instead, use a
``ImagePSF`` model derived from the ``discretize_model`` function in
``astropy.convolution``. [1865]
- The ``FittableImageModel`` and ``EPSFModel`` classes have been
deprecated. Instead, use the new ``ImagePSF`` model class. [1890]
- The default fitter for ``PSFPhotometry``,
``IterativePSFPhotometry``, and ``EPSFFitter`` was changed from
``LevMarLSQFitter`` to ``TRFLSQFitter``. ``LevMarLSQFitter`` uses
the legacy SciPy function ``scipy.optimize.leastsq``, which is no
longer recommended. [1899]
- ``psf_shape`` is now an optional keyword in the ``make_model_image``
and ``make_residual_image`` methods of ``PSFPhotometry`` and
``IterativePSFPhotometry``. The value defaults to using the model
bounding box to define the shape and is required only if the PSF
model does not have a bounding box attribute. [1921]
- ``photutils.psf.matching``
- PSF matching tools must now be imported from
``photutils.psf.matching`` instead of ``photutils.psf``. [1904]
- ``photutils.segmentation``
- The ``SegmentationImage`` ``relabel_consecutive``,
``resassign_label(s)``, ``keep_label(s)``, ``remove_label(s)``,
``remove_border_labels``, and ``remove_masked_labels`` methods now
keep the original dtype of the segmentation image instead of always
changing it to ``int`` (``int64``). [1878, 1923]
- The ``detect_sources`` and ``deblend_sources`` functions now return
a ``SegmentationImage`` instance whose data dtype is ``np.int32``
instead of ``int`` (``int64``) unless more than (2**32 - 1) labels
are needed. [1878]