Photutils

Latest version: v2.0.2

Safety actively analyzes 681866 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 6

2.1.0

------------------

General
^^^^^^^

New Features
^^^^^^^^^^^^

Bug Fixes
^^^^^^^^^

API Changes
^^^^^^^^^^^

2.0.2

------------------

Bug Fixes
^^^^^^^^^

- Due to an upstream bug in ``bottleneck`` with ``float32`` arrays,
``bottleneck`` nan-functions are now used internally only for
``float64`` arrays. Performance may be impacted for computations
involving arrays with dtype other than ``float64``. Affected functions
are used in the ``aperture``, ``background``, ``detection``,
``profiles``, ``psf``, and ``segmentation`` subpackages. This change
has no impact if ``bottleneck`` is not installed.

- ``photutils.background``

- Fixed a bug in ``Background2D`` where an error would be raised
when using the ``BkgIDWInterpolator`` interpolator when any mesh was
excluded, e.g., due to an input mask. [1940]

- ``photutils.detection``

- Fixed a bug in the star finders (``DAOStarFinder``,
``IRAFStarFinder``, and ``StarFinder``) when
``exclude_border=True``. Also, fixed an issue with
``exclude_border=True`` where if all sources were in the border
region then an error would be raised. [1943]

2.0.1

------------------

Bug Fixes
^^^^^^^^^

- ``photutils.background``

- Fixed a bug in ``SExtractorBackground`` where the dimensionality of
the returned value would not be preserved if the output was a single
value. [1934]

- Fixed an issue in ``Background2D`` where if the ``box_size`` equals
the input array shape the input data array could be modified. [1935]

2.0.0

------------------

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]

1.13.0

-------------------

General
^^^^^^^

- ``scikit-learn`` has been removed as an optional dependency. [1774]

New Features
^^^^^^^^^^^^

- ``photutils.datasets``

- Added a ``make_model_image`` function for generating simulated images
with model sources. This function has more options
and is significantly faster than the now-deprecated
``make_model_sources_image`` function. [1759, 1790]

- Added a ``make_model_params`` function to make a table of randomly
generated model positions, fluxes, or other parameters for simulated
sources. [1766, 1796]

- ``photutils.detection``

- The ``find_peaks`` function now supports input arrays with units.
[1743]

- The ``Table`` returned from ``find_peaks`` now has an ``id`` column
that contains unique integer IDs for each peak. [1743]

- The ``DAOStarFinder``, ``IRAFStarFinder``, and ``StarFinder``
classes now support input arrays with units. [1746]

- ``photutils.profiles``

- Added an ``unnormalize`` method to ``RadialProfile`` and
``CurveOfGrowth`` to return the profile to the state before any
``normalize`` calls were run. [1732]

- Added ``calc_ee_from_radius`` and ``calc_radius_from_ee`` methods to
``CurveOfGrowth``. [1733]

- ``photutils.psf``

- Added an ``include_localbkg`` keyword to the ``IterativePSFPhotometry``
``make_model_image`` and ``make_residual_image`` methods. [1756]

- Added "x_fit", "xfit", "y_fit", "yfit", "flux_fit", and "fluxfit" as
allowed column names in the ``init_params`` table input to the PSF
photometry objects. [1765]

- Added a ``make_psf_model_image`` function to generate a simulated
image from PSF models. [1785, 1796]

- ``PSFPhotometry`` now has a new ``fit_params`` attribute containing
a table of the fit model parameters and errors. [1789]

- The ``PSFPhotometry`` and ``IterativePSFPhotometry`` ``init_params``
table now allows the user to input columns for model parameters
other than x, y, and flux. The column names must match the parameter
names in the PSF model. They can also be suffixed with either the
"_init" or "_fit" suffix. [1793]

Bug Fixes
^^^^^^^^^

- ``photutils.aperture``

- Fixed an issue in ``ApertureStats`` where in very rare cases the
``covariance`` calculation could take a long time. [1788]

- ``photutils.background``

- No longer warn about NaNs in the data if those NaNs are masked in
``coverage_mask`` passed to ``Background2D``. [1729]

- ``photutils.psf``

- Fixed an issue where ``IterativePSFPhotometry`` would fail if the
input data was a ``Quantity`` array. [1746]

- Fixed the ``IntegratedGaussianPRF`` class ``bounding_box`` limits to
always be symmetric. [1754]

- Fixed an issue where ``IterativePSFPhotometry`` could sometimes
issue a warning when merging tables if ``mode='all'``. [1761]

- Fixed a bug where the first matching column in the ``init_params``
table was not used in ``PSFPhotometry`` and
``IterativePSFPhotometry``. [1765]

- Fixed an issue where ``IterativePSFPhotometry`` could sometimes
raise an error about non-overlapping data. [1778]

- Fixed an issue with unit handling in ``PSFPhotometry`` and
``IterativePSFPhotometry``. [1792]

- Fixed an issue in ``IterativePSFPhotometry`` where the
``fit_results`` attribute was not cleared between repeated calls.
[1793]

- ``photutils.segmentation``

- Fixed an issue in ``SourceCatalog`` where in very rare cases the
``covariance`` calculation could take a long time. [1788]

API Changes
^^^^^^^^^^^

- The ``photutils.test`` function has been removed. Instead use the
``pytest --pyargs photutils`` command. [1725]

- ``photutils.datasets``

- The ``photutils.datasets`` subpackage has been reorganized and
the ``make`` module has been deprecated. Instead of importing
functions from ``photutils.datasets.make``, import functions from
``photutils.datasets``. [1726]

- The ``make_model_sources_image`` function has been deprecated in
favor of the new ``make_model_image`` function. The new function
has more options and is significantly faster. [1759]

- The randomly-generated optional noise in the simulated example images
``make_4gaussians_image`` and ``make_100gaussians_image`` is now
slightly different. The noise sigma is the same, but the pixel
values differ. [1760]

- The ``make_gaussian_prf_sources_image`` function is now
deprecated. Use the ``make_model_psf_image`` function or the new
``make_model_image`` function instead. [1762]

- The ``make_gaussian_sources_table`` function now includes an "id"
column and always returns both ``'flux'`` and ``'amplitude'`` columns.
[1763]

- The ``make_model_sources_table`` function now includes an "id"
column. [1764]

- The ``make_gaussian_sources_table`` function is now deprecated.
Use the ``make_model_sources_table`` function instead. [1764]

- The ``make_test_psf_data`` function is now deprecated. Use the new
``make_model_psf_image`` function instead. [1785]

- ``photutils.detection``

- The ``sky`` keyword in ``DAOStarFinder`` and ``IRAFStarFinder`` is
now deprecated and will be removed in a future version. [1747]

- Sources that have non-finite properties (e.g., centroid, roundness,
sharpness, etc.) are automatically excluded from the output table in
``DAOStarFinder``, ``IRAFStarFinder``, and ``StarFinder``. [1750]

- ``photutils.psf``

- ``PSFPhotometry`` and ``IterativePSFPhotometry`` now raise a
``ValueError`` if the input ``psf_model`` is not two-dimensional
with ``n_inputs=2`` and ``n_outputs=1``. [1741]

- The ``IntegratedGaussianPRF`` class ``bounding_box`` is now a method
instead of an attribute for consistency with Astropy models. The
method has a ``factor`` keyword to scale the bounding box. The
default scale factor is 5.5 times ``sigma``. [1754]

- The ``IterativePSFPhotometry`` ``make_model_image`` and
``make_residual_image`` methods no longer include the local
background by default. This is a backwards-incompatible change. If
the previous behavior is desired, set ``include_localbkg=True``.
[1756]

- ``IterativePSFPhotometry`` will now only issue warnings after
all iterations are completed. [1767]

- The ``IterativePSFPhotometry`` ``psfphot`` attribute has been
removed. Instead, use the ``fit_results`` attribute, which contains
a list of ``PSFPhotometry`` instances for each fit iteration.
[1771]

- The ``group_size`` column has been moved to come immediately after
the ``group_id`` column in the output table from ``PSFPhotometry``
and ``IterativePSFPhotometry``. [1772]

- The ``PSFPhotometry`` ``init_params`` table was moved from the
``fit_results`` dictionary to an attribute. [1773]

- Removed ``local_bkg``, ``psfcenter_indices``, ``fit_residuals``,
``npixfit``, and ``nmodels`` keys from the ``PSFPhotometry``
``fit_results`` dictionary. [1773]

- Removed the deprecated ``BasicPSFPhotometry``,
``IterativelySubtractedPSFPhotometry``, ``DAOPhotPSFPhotometry``,
``DAOGroup``, ``DBSCANGroup``, and ``GroupStarsBase``, and
``NonNormalizable`` classes and the ``prepare_psf_model``,
``get_grouped_psf_model``, and ``subtract_psf`` functions. [1774]

- A ``ValueError`` is now raised if the shape of the ``error`` array
does not match the ``data`` array when calling the PSF-fitting
classes. [1777]

- The ``fit_param_errs`` key was removed from the ``PSFPhotometry``
``fit_results`` dictionary. The fit parameter errors are now stored
in the ``fit_params`` table. [1789]

- The ``cfit`` column in the ``PSFPhotometry`` and
``IterativePSFPhotometry`` result table will now be NaN for sources
whose initial central pixel is masked. [1789]

1.12.0

-------------------

General
^^^^^^^

- The minimum required Python is now 3.10. [1719]

- The minimum required NumPy is now 1.23. [1719]

- The minimum required SciPy is now 1.8. [1719]

- The minimum required scikit-image is now 0.20. [1719]

- The minimum required scikit-learn is now 1.1. [1719]

- The minimum required pytest-astropy is now 0.11. [1719]

- The minimum required sphinx-astropy is now 1.9. [1719]

- NumPy 2.0 is supported.

Bug Fixes
^^^^^^^^^

- ``photutils.background``

- No longer warn about NaNs in the data if those NaNs are masked in
``mask`` passed to ``Background2D``. [1712]

API Changes
^^^^^^^^^^^

- ``photutils.utils``

- The default value for the ``ImageDepth`` ``mask_pad`` keyword is now
set to 0. [1714]

Page 1 of 6

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.