Changelog#
3.0.0 (2026-04-17)#
General#
New Features#
photutils.apertureThe
to_skyandto_pixelmethods for all pixel and sky aperture types now use the local WCS Jacobian to accurately compute pixel scale factors and rotation angles. This correctly handles WCS with distortions (e.g., SIP polynomial corrections) and non-square pixels. [#2240]
photutils.backgroundAdded a
to_aperturemethod toLocalBackground. [#2118]
photutils.centroidsphotutils.detectionAdded a public
StarFinderCatalogBaseclass that provides a common base for the catalogs in theDAOStarFinder,IRAFStarFinder, andStarFinderclasses. [#2149, #2201]Added
__repr__and__str__methods toDAOStarFinder,IRAFStarFinder, andStarFinder. [#2201]Significantly improved the performance of
DAOStarFinder,IRAFStarFinder, andStarFinderby vectorizing cutout extraction and image moment computation. [#2201]The
thresholdparameter inDAOStarFinder,IRAFStarFinder, andStarFindernow accepts a 2D array in addition to a scalar value, allowing for spatially varying detection thresholds. [#2202]Added a
scale_thresholdparameter toDAOStarFinder. When set toFalse, the inputthresholdis applied directly to the convolved data without the default kernel-based scaling. [#2202]Added a
min_separationkeyword tofind_peaks. The implementation uses fast separable box filters and is approximately 10-400x faster than using an explicit circular footprint withscipy.ndimage.maximum_filter(depending on the radius), while producing identical results. [#2246]
photutils.profilesAdded a
EnsquaredCurveOfGrowthclass to compute a curve of growth using concentric square apertures. [#2184]Added a
EllipticalCurveOfGrowthclass to compute a curve of growth using concentric elliptical apertures with a fixed axis ratio and orientation. [#2184]Added
moffat_fit,moffat_profile, andmoffat_fwhmproperties toRadialProfilefor fitting a 1D Moffat model to the radial profile. [#2185]
photutils.psfAdded a
SourceGroupsclass that stores the results of grouping sources and provides methods to analyze and plot the groupings. [#2116]Added
remove_invalidandreset_idskeywords to theresults_to_init_paramsandresults_to_model_paramsmethods ofPSFPhotometryandIterativePSFPhotometry. [#2131]Added a
decode_flagsconvenience method toPSFPhotometryandIterativePSFPhotometryclasses to decode the bitwise flags from the results table. [#2132, #2136]Added a
return_bit_flagskeyword to thedecode_psf_flagsfunction. [#2136]Added
__repr__methods toImagePSFandGriddedPSFModel. [#2134]Added a
shapeproperty toImagePSF. [#2158]EPSFBuildernow automatically excludes stars that repeatedly fail fitting and emits warnings with specific failure reasons. [#2158, #2165]Added validation and automatic shape handling for
fit_shape=Noneinfit_2dgaussianandfit_fwhm. The functions now require explicitfit_shapefor multiple sources and emit an informative warning for single-source fitting. [#2164]The
fit_fwhmandfit_2dgaussianxyposvalue can now be input as azipobject. [#2164]
photutils.psf_matchingAdded a
regularizationkeyword tomake_kernelto regularize division by near-zero values in the source Optical Transfer Function. [#2170, #2171, #2175]Added
make_wiener_kernelfunction that uses Wiener regularization to make a PSF matching kernel. [#2171, #2172, #2175]make_kernelnow validates input PSFs (2D, odd dimensions, centered) and the window function output. [#2170]resize_psfnow validates input PSFs and pixel scales. [#2170]Added
__repr__methods toCosineBellWindow,HanningWindow,SplitCosineBellWindow,TopHatWindow, andTukeyWindowclasses. [#2176]
photutils.segmentationThe
SourceCatalogfluxfrac_radiusnow caches results byfluxfracvalue. Repeated calls with the samefluxfracreturn the cached result without recomputation. [#2197]The radial step used when searching for a bracketing interval in
SourceCatalogfluxfrac_radiusis now set to 10% of the currentmax_radius, bounding the fallback loop to at most ~10 iterations regardless of source size. [#2197]Improved the performance (~6-9x speedup) of
SourceCatalogmin_value,max_value,segment_flux,segment_flux_err,background_sum, andbackground_mean. [#2199]Added
SegmentationImageget_segmentandget_segmentsmethods to return theSegmentobject(s) for a given label or list of labels. [#2228, #2256]Added the ability to input
RegionVisualkeywords to theSegmentationImageto_regionsmethod. [#2228]Added
SegmentationImageget_polygon,get_polygons,get_patch,get_patches,get_region, andget_regionsmethods to return the polygon, patch, or region for a given segment label or list of labels. [#2232]Improved the performance of the
SegmentationImagekeep_labelsmethod andmissing_labelsattribute. [#2234]Improved the performance of
SourceCatalogcentroid_win(~3.5x speedup),centroid_quad,fluxfrac_radius(~6x speedup),kron_radius(~2x speedup),moments,moments_central,perimeter, and Kron photometry. [#2238]
photutils.utilsSignificantly improved the performance (by factors of 3 or more) of
ShepardIDWInterpolator[#2187].Added a
use_future_column_namescontext manager for temporarily enabling future column names in a scoped, thread-safe, and async-safe way without modifying the globalphotutils.future_column_namesflag. [#2258]
Bug Fixes#
photutils.backgroundFixed
Background2DraisingAttributeErrorwhen passed a function asbkg_estimatororbkgrms_estimatorinstead of a class instance with asigma_clipattribute. [#2181]Fixed silent truncation of background estimates when integer input data were provided to
Background2D. Integer inputs now producenp.float32output to preserve precision from interpolation. [#2181]
photutils.centroidsFixed a bug in
centroid_sourceswhere the input error array could be ignored if more than one source was input. [#2179]
photutils.datasetsFixed a bug in
apply_poisson_noisewhere the returned image could have a different dtype than the input. [#2173]
photutils.detectionphotutils.isophotebuild_ellipse_modelnow integrates over all angles instead of stopping once it hits the edge of the output image. [#2156]
photutils.morphologyFixed issues with negative pixel values input to
gini. [#2178]
photutils.profilesFixed an issue where the mask (input and non-finite values) was not applied to the raw data profile. [#2184]
photutils.psfPSFPhotometryandIterativePSFPhotometrynow handle non-finite (NaN or inf) local background values instead of raising an error. Three new flags have been added to identify sources with non-finite values: flag 512 for non-finite fitted positions, flag 1024 for non-finite fitted flux, and flag 2048 for non-finite local background. [#2131]Fixed a bug in
EPSFBuilderwhere therecentering_boxsizewas being applied in oversampled space instead of the original star pixel space. [#2168]
photutils.segmentationFixed a bug in
SourceCatalogwhere the (x, y) coordinates were swapped in themap_coordinatescall used to interpolate the background at source centroids, causingbackground_centroidto return incorrect values. [#2198]Fixed an issue in
SourceCatalogwhere incorrect masking behavior could occur whenapermask_method='none'. [#2198]Fixed an issue in
SourceCatalogwhere unrealistically largekron_radiusvalues could cause out-of-memory issues. [#2237]
API Changes#
photutilsPassing optional arguments positionally to all functions, classes, and methods in
photutilsis now deprecated. In the future, all optional arguments must be passed as keyword arguments. [#2219]
photutils.apertureThe
ApertureStatscovar_sigx2,covar_sigxy, andcovar_sigy2attributes have been renamed tocovariance_xx,covariance_xy, andcovariance_yy, respectively. The old names are deprecated. [#2241]The
ApertureStatscxx,cxy, andcyyattributes have been renamed toellipse_cxx,ellipse_cxy, andellipse_cyy, respectively. The old names are deprecated. [#2241]The
ApertureStatsdata_sumcutoutanderror_sumcutoutattributes have been renamed todata_sum_cutoutanderror_sum_cutout, respectively. The old names are deprecated. [#2241]The
ApertureStatsget_idandget_idsmethods have been renamed toselect_idandselect_ids, respectively. The old names are deprecated. [#2241]The
ApertureStatssemimajor_sigmaandsemiminor_sigmaattributes/columns have been renamed tosemimajor_axisandsemiminor_axis, respectively. The old names are deprecated. [#2241]The
ApertureStatsxcentroidandycentroidattributes/columns have been renamed tox_centroidandy_centroid, respectively. The old names are deprecated. [#2241]The
xcenterandycentercolumn names in the table returned byaperture_photometryhave been renamed tox_centerandy_center, respectively. The old names are deprecated. [#2241]The
CircularMaskMixin,EllipticalMaskMixin, andRectangularMaskMixinclasses are now deprecated. The mask generation is now handled internally by thePixelAperturebase class. [#2242]
photutils.backgroundRemoved the deprecated
edge_methodkeyword fromBackground2D. [#2102]Removed the deprecated
background_mesh_masked,background_rms_mesh_masked, andmesh_nmaskedproperties fromBackground2D. [#2102]Removed the deprecated
grid_modekeyword fromBkgZoomInterpolator. [#2102]The
interpolatorkeyword argument forBackground2Dis now deprecated. Wheninterpolatoris eventually removed, thescipy.ndimage.zoomcubic spline interpolator will always be used to resize the low-resolution arrays. The behavior will be identical to the current default. [#2108]The
Background2Dnpixels_meshandnpixels_mapproperties have been renamed ton_pixels_meshandn_pixels_map, respectively. The old names are deprecated. [#2241]The
BkgIDWInterpolatorandBkgZoomInterpolatorclasses are now deprecated. [#2108]The
Background2Dbkgrms_estimatorkeyword argument has been renamed tobkg_rms_estimator. The old name is deprecated. [#2241]
photutils.centroidsThe
xpeak,ypeak, andsearch_boxsizekeyword arguments forcentroid_quadraticare now deprecated. Usecentroid_sourcesto centroid sources at specific positions. [#2160]
photutils.datasetsThe
get_path,load_spitzer_image,load_spitzer_catalog, andload_star_imagefunctions are now deprecated and will be removed in a future version. [#2135]
photutils.detectionfind_peaksnow returns aQTableinstead of aTable. [#2201]The
sharploandsharphikeyword arguments forDAOStarFinderandIRAFStarFinderare now deprecated. Use thesharpness_range=(lower, upper)tuple keyword instead. Setsharpness_range=Noneto disable sharpness filtering. [#2216]The
roundloandroundhikeyword arguments forDAOStarFinderandIRAFStarFinderare now deprecated. Use theroundness_range=(lower, upper)tuple keyword instead. Setroundness_range=Noneto disable roundness filtering. [#2216]The
minsep_fwhmkeyword argument forIRAFStarFinderis now deprecated. Usemin_separationinstead. [#2216]The
peakmaxkeyword argument forDAOStarFinder,IRAFStarFinder, andStarFinderis now deprecated. Usepeak_maxinstead. [#2216]The
brightestkeyword argument forDAOStarFinder,IRAFStarFinder, andStarFinderis now deprecated. Usen_brightestinstead. [#2216]The
npeakskeyword argument forfind_peaksis now deprecated. Usen_peaksinstead. [#2241]The default
min_separationforDAOStarFinder,IRAFStarFinder, andStarFinderis nowNone, which computes a default separation of2.5 * fwhm(or2.5 * (min(kernel.shape) // 2)forStarFinder) consistent across all three star finders. [#2216]The
xcentroidandycentroidcolumn/attribute names forDAOStarFinder,IRAFStarFinder, andStarFindercatalog classes are deprecated. Usex_centroidandy_centroidinstead. Thecutout_xcentroidandcutout_ycentroidattributes are also deprecated in favor ofcutout_x_centroidandcutout_y_centroid. [#2241]The
IRAFStarFinderandStarFinderpaattribute/column has been renamed toorientation. The old name is deprecated. [#2241]The
npixcolumn/attribute inDAOStarFinderandIRAFStarFindercatalogs has been renamed ton_pixels. The old name is deprecated. [#2241]The
IRAFStarFinderandStarFinderorientation(waspa) values are now always returned as aQuantityarray in the range [0, 360) degrees. [#2224, #2225]
photutils.isophoteThe
IsophoteandIsophoteListgrad_errorandgrad_r_errorattributes have been renamed togradient_errandgradient_rel_err, respectively. The old names are deprecated. [#2241]The
EllipseSamplegradient_errorandgradient_relative_errorattributes have been renamed togradient_errandgradient_rel_err, respectively. The old names are deprecated. [#2241]The
grad_errorandgrad_rerrorcolumn names in the isophote output table have been renamed togradient_errandgradient_rel_err, respectively. The old names are deprecated. [#2241]The
nclipparameter inEllipse.fit_image,Ellipse.fit_isophote, andEllipseSamplehas been renamed ton_clip. The old name is deprecated. [#2241]The
IsophoteandIsophotListniter,ndata, andnflagattributes have been renamed ton_iter,n_data, andn_flag, respectively. The old names are deprecated. [#2241]
photutils.profilesCached Gaussian fits to the radial profile are now automatically invalidated when the profile normalization changes, so the fit is always consistent with the current profile. [#2185]
photutils.psfThe
photutils.psf.matchingsubpackage has been moved tophotutils.psf_matching. Importing from the old location is deprecated. [#2167]Removed the deprecated
IntegratedGaussianPRFandPRFAdapterclasses. [#2103]The
grid_from_epsfshelper function is now deprecated. Instead, useGriddedPSFModeldirectly. [#2111]The
EPSFFitterclass is now deprecated. Use thefitter,fit_shape, andfitter_maxitersparameters ofEPSFBuilderinstead. [#2159]Removed the
ModelImageMixinclass. [#2133]Removed the
ModelGridPlotMixinclass. [#2137]Removed the
norm_radiuskeyword fromEPSFBuilder. [#2158]Removed the deprecated
FittableImageModelandEPSFModelclasses. UseImagePSFinstead. [#2158]EPSFBuildernow returns anEPSFBuildResultdataclass containing the ePSF, fitted stars, iteration count, convergence status, and excluded star diagnostics. Tuple unpacking is still supported for backward compatibility. [#2158]LinkedEPSFStarno longer inherits fromEPSFStars. [#2158]The
npixfitcolumn inPSFPhotometryresults has been renamed ton_pixels_fit. The old name is deprecated. [#2241]The
NPIXFIT_PARTIAL(npixfit_partial) PSF flag has been renamed toN_PIXELS_FIT_PARTIAL(n_pixels_fit_partial). The old name is deprecated. [#2241]The
PSFPhotometryandIterativePSFPhotometrylocalbkg_estimatorkeyword argument has been renamed tolocal_bkg_estimator. The old name is deprecated. [#2241]The
PSFPhotometryandIterativePSFPhotometryinclude_localbkgkeyword argument inmake_model_imageandmake_residual_imagehas been renamed toinclude_local_bkg. The old name is deprecated. [#2241]
photutils.psf_matchingRenamed
create_matching_kerneltomake_kernel. The old name is deprecated. [#2171]make_kernelnow raisesValueErrorif PSFs are not 2D, have even dimensions, or do not have the same shape. [#2170]resize_psfnow raisesValueErrorif the PSF is not 2D, has even dimensions, or if pixel scales are not positive. [#2170]make_kernelnow raisesTypeErrorif thewindowparameter is not callable. [#2170]
photutils.segmentationThe
SourceCatalogorientationproperty is now always returned in the range [0, 360) degrees. [#2224]The
SegmentationImagenlabels,data_ma,deblended_labels_map, anddeblended_labels_inverse_mapattributes have been renamed ton_labels,data_masked,deblended_label_to_parent, andparent_to_deblended_labels, respectively. The old names are deprecated. [#2241]The
Segmentdata_maattribute has been renamed todata_masked. The old name is deprecated. [#2241]The
SourceCatalogdata,error,background, andsegmentattributes have been renamed todata_cutout,error_cutout,background_cutout, andsegment_cutout, respectively. The old names are deprecated. [#2241]The
SourceCatalogdata_ma,error_ma,background_ma, andsegment_maattributes have been renamed todata_cutout_masked,error_cutout_masked,background_cutout_masked, andsegment_cutout_masked, respectively. The old names are deprecated. [#2241]The
SourceCatalogconvdataandconvdata_maattributes have been renamed toconv_data_cutoutandconv_data_cutout_masked, respectively. The old names are deprecated. [#2241]The
SourceCatalogcutout_minval_indexandcutout_maxval_indexattributes have been renamed tocutout_min_value_indexandcutout_max_value_index, respectively. The old names are deprecated. [#2241]The
SourceCatalogminval_index,maxval_index,minval_xindex,minval_yindex,maxval_xindex, andmaxval_yindexattributes have been renamed tomin_value_index,max_value_index,min_value_xindex,min_value_yindex,max_value_xindex, andmax_value_yindex, respectively. The old names are deprecated. [#2241]The
SourceCatalogcovar_sigx2,covar_sigxy, andcovar_sigy2attributes/columns have been renamed tocovariance_xx,covariance_xy, andcovariance_yy, respectively. The old names are deprecated. [#2241]The
SourceCatalogcxx,cxy, andcyyattributes/columns have been renamed toellipse_cxx,ellipse_cxy, andellipse_cyy, respectively. The old names are deprecated. [#2241]The
SourceCatalogsegment_fluxerrandkron_fluxerrattributes/columns have been renamed tosegment_flux_errandkron_flux_err, respectively. The old names are deprecated. [#2241]The
SourceCatalogfluxfrac_radiusattribute has been renamed toflux_radius. The old name is deprecated. [#2241]The
SourceCatalogget_labelandget_labelsmethods have been renamed toselect_labelandselect_labels, respectively. The old names are deprecated. [#2241]The
SourceCatalogadd_extra_property,remove_extra_property,remove_extra_properties, andrename_extra_propertymethods have been renamed toadd_property,remove_property,remove_properties, andrename_property, respectively. Theextra_propertiesattribute has been renamed tocustom_properties. The old names are deprecated. [#2241]The
SourceCatalognlabelsandlocalbkg_widthattributes have been renamed ton_labelsandlocal_bkg_width, respectively. The old names are deprecated. [#2241]The
SourceCatalogsemimajor_sigmaandsemiminor_sigmaattributes/columns have been renamed tosemimajor_axisandsemiminor_axis, respectively. The old names are deprecated. [#2241]The
SourceCatalogxcentroid,ycentroid,xcentroid_win,ycentroid_win,xcentroid_quad, andycentroid_quadattributes/columns have been renamed tox_centroid,y_centroid,x_centroid_win,y_centroid_win,x_centroid_quad, andy_centroid_quad, respectively. The old names are deprecated. [#2241]The
SourceCatalogsegment_img,localbkg_width,apermask_method, anddetection_catkeyword arguments have been renamed tosegmentation_image,local_bkg_width,aperture_mask_method, anddetection_catalog, respectively. The old names are deprecated. [#2241]The
SourceFindernpixels,nlevels, andnprocattributes have been renamed ton_pixels,n_levels, andn_processes, respectively. The old names are deprecated. [#2241]The
nsigmaparameter indetect_thresholdhas been renamed ton_sigma. The old name is deprecated. [#2241]The
npixelsparameter indetect_sourceshas been renamed ton_pixels. The old name is deprecated. [#2241]The
segment_img,npixels,nlevels, andnprocparameters indeblend_sourceshave been renamed tosegmentation_image,n_pixels,n_levels, andn_processes, respectively. The old names are deprecated. [#2241]The
npixels,nlevels, andnprocparameters inSourceFinderhave been renamed ton_pixels,n_levels, andn_processes, respectively. The old names are deprecated. [#2241]The
SourceCatalogto_tabledefault columns no longer includeslocal_background. [#2252]
photutils.utilsThe
ImageDepthnsigma,napers, andnitersparameters have been renamed ton_sigma,n_apertures, andn_iters, respectively. The old names are deprecated. Thenapers_usedattribute has also been renamed ton_apertures_used. [#2241]The
make_random_cmapncolorsparameter has been renamed ton_colors. The old name is deprecated. [#2241]The
ShepardIDWInterpolatorregparameter in__call__has been renamed toregularization. The old name is deprecated. [#2241]
2.3.0 (2025-09-15)#
General#
New Features#
photutils.isophotephotutils.psfPSFPhotometryandIterativePSFPhotometrynow raise an error if the inputerrorarray contains non-finite or zero values. [#2022]GriddedPSFModelcan now be used with a single input ePSF model, which will be equivalent toImagePSF. [#2034]The
findercallable input toPSFPhotometryandIterativePSFPhotometryis no longer restricted to have x and y column names of'xcentroid'and'ycentroid'. The allowed column names are now the same as those allowed in theinit_paramstable. [#2072]Added a
group_warning_thresholdkeyword toPSFPhotometryandIterativePSFPhotometry. [#2081]The
PSFPhotometryandIterativePSFPhotometryclasses no longer fail for invalid sources, defined as those that have no overlap with the input data, are completely masked, or have too few unmasked pixels for a fit. These classes have new flags (64, 128, 256, respectively) for these invalid conditions. [#2084, #2085]The
PSFPhotometryandIterativePSFPhotometryclasses have newresults_to_init_paramsandresults_to_model_paramsmethods for outputting fit results in different formats. [#2084]When using Astropy 7.0+, the
PSFPhotometryandIterativePSFPhotometryfitterobject now modifies the PSF model in place instead of creating a copy, improving performance and significantly reducing memory usage in some cases. [#2093]PSFPhotometryandIterativePSFPhotometrynow return a reduced chi-squared statistic (reduced_chi2column in the results table). [#2086]The PSF photometry classes now use a dynamically generated “flat” model instead of a compound model for grouped sources. This eliminates recursion limits and significantly reduces memory usage for large groups. [#2100]
photutils.segmentationAn optional
arraykeyword was added to theSourceCatalogmake_cutoutsmethod. [#2023]Added a
groupkeyword to theSegmentationImageto_regionsmethod. [#2060, #2065]Added a
decode_psf_flagsutility function for decoding PSF photometry bit flags. [#2090]Added a
PSF_FLAGSobject to hold all PSF photometry bit flags in one place. PSF_FLAGS provides readable, named constants for each bit flag and helper utilities for decoding bit flags. [#2091]
Bug Fixes#
photutils.centroidsphotutils.datasetsFixed a bug in
make_model_imagewhere the output image would not have units in the case where the input params had units and none of the models overlapped the image shape. [#2082]Fixed a bug in
make_model_imagewhere an error would be raised if any row in the input parameters table contained non-finite model parameters. Such sources are now silently ignored. [#2083]
photutils.psfFixed a bug in
fit_2dgaussianandfit_fwhmwhere the fit would fail if there were NaN values in the input data. [#2030]Fixed the check in
GriddedPSFModelfor rectangular pixel grids. [#2035]Fixed a bug in
PSFPhotometrywhere the'group_id'column would be ignored if included in theinit_paramstable. [#2070]Fixed a bug in
PSFPhotometrywhere the outputflux_errcolumn would not have units if the input data had units and the flux model parameter was fixed in value. [#2072]Fixed a bug in
PSFPhotometryandIterativePSFPhotometrywhere an error would be raised if the x or y columns ininit_paramshad units. [#2079]Fixed a bug in
PSFPhotometryandIterativePSFPhotometryfor the boundary conditions where flag=2 would be set. [#2080]Fixed a bug in
EPSFBuilderwhere the output PSF would have the wrong shape if the inputstarswere non-square cutouts. [#2089, #2092]Fixed a bug in the calculation of the
PSFPhotometryandIterativePSFPhotometryqfitandcfitto not include the fit weights. [#2099]
photutils.segmentation
API Changes#
photutils.backgroundAn explicit
ValueErroris now raised if the inputdatatoBackground2Dcontains all non-finite values. [#2062]
photutils.psfphotutils.segmentationThe
SegmentationImagepolygonslist may now include either ShapelyPolygonorMultiPolygon(non-contiguous) objects. [#2060]The
SegmentationImageto_patchesandplot_patchesmethods now returnmatplotlib.patches.PathPatchobjects. [#2060]The
SegmentationImageto_regionsmethod now returnsPolygonPixelRegionregions that have the segment label stored in the objectmetadictionary. [#2060]
2.2.0 (2025-02-18)#
New Features#
photutils.apertureAdd an
aperture_to_regionfunction to convert an Aperture object to an astropyRegionorRegionsobject. [#2009]
photutils.profilesAdded
data_radiusanddata_profileattributes to theRadialProfileclass for calculating the raw radial profile. [#2001]
photutils.segmentationAdded a
to_regionsmethod toSegmentationImagethat converts the segment outlines to aregions.Regionsobject. [#2010]
Bug Fixes#
photutils.segmentationFixed an issue where the
SegmentationImagepolygonsattribute would raise an error if any source segment contained a hole. [#2005]
API Changes#
photutils.apertureThe
thetaattribute ofEllipticalAperture,EllipticalAnnulus,RectangularAperture, andRectangularAnnulusis now always returned as an angularQuantity. [#2008]
2.1.0 (2025-01-06)#
General#
New Features#
photutils.apertureThe
aperture_photometryoutput table will now include asky_centercolumn ifwcsis input, even if the input aperture is not a sky aperture. [#1965]
photutils.datasetsA
params_mapkeyword was added tomake_model_imageto allow a custom mapping between model parameter names and column names in the parameter table. [#1994]
photutils.detectionThe
find_peaksborder_widthkeyword can now accept two values, indicating the border width along the y and x edges, respectively. [#1957]
photutils.morphologyAn optional
maskkeyword was added to theginifunction. [#1979]
photutils.segmentationAdded
deblended_labels,deblended_labels_map, anddeblended_labels_inverse_mapproperties toSegmentationImageto identify and map any deblended labels. [#1988]
Bug Fixes#
photutils.segmentationFixed a bug where the table output from the
SourceCatalogto_tablemethod could have column names with anp.str_representation instead ofstrrepresentation when using NumPy 2.0+. [#1956]Fixed a bug to ensure that the dtype of the
SegmentationImagelabelsalways matches the image dtype. [#1986]Fixed an issue with the source labels after source deblending when using
relabel=False. [#1988]
API Changes#
photutils.apertureThe
xcenterandycentercolumns in the table returned byaperture_photometryno longer have (pixel) units for consistency with other tools. [#1993]
photutils.detectionWhen
exclude_borderis set toTruein theDAOStarFinderandStarFinderclasses, the excluded border region can be different along the x and y edges if the kernel shape is rectangular. [#1957]Detected sources that match interval ends for sharpness, roundness, and maximum peak values (
sharplo,sharphi,roundlo,roundhi, andpeakmax) are now included in the returned table of detected sources byDAOStarFinderandIRAFStarFinder. [#1978]Detected sources that match the maximum peak value (
peakmax) are now included in the returned table of detected sources byStarFinder. [#1990]
photutils.morphologyThe
ginifunction now returns zero instead of NaN if the (unmasked) data values sum to zero. [#1979]
photutils.psf
2.0.2 (2024-10-24)#
Bug Fixes#
Due to an upstream bug in
bottleneckwithfloat32arrays,bottlenecknan-functions are now used internally only forfloat64arrays. Performance may be impacted for computations involving arrays with dtype other thanfloat64. Affected functions are used in theaperture,background,detection,profiles,psf, andsegmentationsubpackages. This change has no impact ifbottleneckis not installed.photutils.backgroundFixed a bug in
Background2Dwhere an error would be raised when using theBkgIDWInterpolatorinterpolator when any mesh was excluded, e.g., due to an input mask. [#1940]
photutils.detectionFixed a bug in the star finders (
DAOStarFinder,IRAFStarFinder, andStarFinder) whenexclude_border=True. Also, fixed an issue withexclude_border=Truewhere if all sources were in the border region then an error would be raised. [#1943]
2.0.1 (2024-10-16)#
Bug Fixes#
2.0.0 (2024-10-14)#
General#
The
regionspackage 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.matchinginstead ofphotutils.psf. [#1879, #1904]
New Features#
photutils.apertureThe metadata in the tables generated by
aperture_photometryandApertureStatsnow include the aperture name and shape parameters. [#1849]aperture_photometryandApertureStatsnow accept supportedregions.Regionobjects, i.e., those corresponding to circular, elliptical, and rectangular apertures. [#1813, #1852]A new
region_to_apertureconvenience function has been added to convert supportedregions.Regionobjects toApertureobjects. [#1813, #1852]
photutils.backgroundThe
Background2Dclass has been refactored to significantly reduce its memory usage. In some cases, it is also significantly faster. [#1870, #1872, #1873]A new
npixels_meshproperty was added toBackground2Dthat gives a 2D array of the number of pixels used to compute the statistics in the low-resolution grid. [#1870]A new
npixels_mapproperty was added toBackground2Dthat 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.centroidsQuantityarrays can now be input tocentroid_1dgandcentroid_2dg. [#1861]
photutils.datasetsAdded a new
params_table_to_modelsfunction to create a list of models from a table of model parameters. [#1896]
photutils.psfAdded new
xy_boundskeyword toPSFPhotometryandIterativePSFPhotometryto allow one to bound the x and y model parameters during the fitting. [#1805]The
extract_starsfunction can now acceptNDDatainputs with uncertainty types other thanweights. [#1821]Added new
GaussianPSF,CircularGaussianPSF,GaussianPRF,CircularGaussianPRF, andMoffatPSFPSF model classes. [#1838, #1898, #1918]Added new
CircularGaussianSigmaPRFPSF model class. [#1845, #1918]The
IntegratedGaussianPRFmodel now supports units. [#1838]A new
resultsattribute was added toPSFPhotometryto store the returned table of fit results. [#1858]Added new
fit_fwhmconvenience 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_2dgaussianconvenience function to fit a circular 2D Gaussian PSF to one or more sources in an image. [#1859, #1887, #1899]Added new
ImagePSFmodel class to represent a PSF model as an image. [#1890]The
GriddedPSFModelmodel now has abounding_boxmethod to return the bounding box of the model. [#1891]The
GriddedPSFModelclass 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.segmentationReduced the memory usage and improved the performance of source deblending with
deblend_sourcesandSourceFinder. [#1924, #1925, #1926]Improved the accuracy of the progress bar in
deblend_sourcesandSourceFinderwhen using multiprocessing. Also added the source ID label number to the progress bar. [#1925, #1926]
Bug Fixes#
photutils.apertureFixed a bug checking that the
subpixelskeyword is a strictly positive integer. [#1816]
photutils.datasetsFixed an issue in
make_model_imagewhere if thebbox_factorwas input and the model bounding box did not have afactorkeyword then an error would be raised. [#1921]
photutils.detectionFixed an issue where
DAOStarFinderwould not return any sources if the inputthresholdwas set to zero due to thefluxbeing non-finite. [#1882]
photutils.isophoteFixed a bug in
build_ellipse_modelwhere ifhigh_harmonics=True, the harmonics were not correctly added to the model. [#1810]
photutils.psfFixed a bug in
make_psf_modelwhere if the input model had amplitude units, an error would be raised. [#1894]
API Changes#
The
sklearnversion information has been removed from the meta attribute in output tables.sklearnwas removed as an optional dependency in 1.13.0. [#1807]photutils.backgroundThe
Background2Dbackground_meshandbackground_rms_meshproperties will have units if the input data has units. [#1870]The
Background2Dedge_methodkeyword is now deprecated. Whenedge_methodis eventually removed, the'pad'option will always be used. [#1870]The
Background2Dbackground_mesh_masked,background_rms_mesh_masked, andmesh_nmaskedproperties are now deprecated. [#1870]To reduce memory usage,
Background2Dno longer keeps a cached copy of the returnedbackgroundandbackground_rmsproperties. [#1870]The
Background2Ddata,mask,total_mask,nboxes,box_npixels, andnboxes_totattributes have been removed. [#1870]The
BkgZoomInterpolatorgrid_modekeyword is now deprecated. Whengrid_modeis eventually removed, theTrueoption will always be used. [#1870]The
Background2Dbackground,background_rms,background_mesh, andbackground_rms_meshproperties now have the samedtypeas the input data. [#1922]
photutils.centroidsFor consistency with other fitting functions (including PSF fitting), the
centroid_1dgandcentroid_2dgfunctions 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_1dgandcentroid_2dgwas changed fromLevMarLSQFittertoTRFLSQFitter.LevMarLSQFitteruses the legacy SciPy functionscipy.optimize.leastsq, which is no longer recommended. [#1917]
photutils.datasetsThe deprecated
makemodule has been removed. Instead of importing functions fromphotutils.datasets.make, import functions fromphotutils.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, andmake_imagehdufunctions have been removed. [#1884]
photutils.detectionThe deprecated
skykeyword inDAOStarFinderandIRAFStarFinderhas been removed. Also, there will no longer be askycolumn in the output table. [#1884]The
DAOStarFinderfluxandmagcolumns were changed to give sensible values. Previously, thefluxvalue 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. Adaofind_magcolumn was added for comparison to the original IRAF DAOFIND algorithm. [#1885]
photutils.isophoteThe
build_ellipse_modelfunction now raises aValueErrorif the inputisolistis empty. [#1809]
photutils.profilesThe fitter used in
RadialProfileto fit the profile with a Gaussian was changed fromLevMarLSQFittertoTRFLSQFitter.LevMarLSQFitteruses the legacy SciPy functionscipy.optimize.leastsq, which is no longer recommended. [#1899]
photutils.psfThe
IntegratedGaussianPRFclass now must be initialized using keyword-only arguments. [#1838]The
IntegratedGaussianPRFclass has been moved to the newfunctional_modelsmodule. [#1838]The
modelsandgriddedpsfmodelmodules have been renamed toimage_modelsandgridded_models, respectively. [#1838]The
IntegratedGaussianPRFmodel class has been renamed toCircularGaussianPRF.IntegratedGaussianPRFis now deprecated. [#1845]Some PSF tools have moved to new modules. The
PRFAdapterclass and themake_psf_modelandgrid_from_epsfsfunctions have been moved to the newmodel_helpersmodule. Themake_psf_model_imagefunction has been moved to the newsimulationsmodule. It is recommended that all of these tools be imported fromphotutils.psfwithout using the submodule name. [#1854, #1901]The
PSFPhotometryfit_resultsattribute has been renamed tofit_info.fit_resultsis now deprecated. [#1858]The
PRFAdapterclass has been deprecated. Instead, use aImagePSFmodel derived from thediscretize_modelfunction inastropy.convolution. [#1865]The
FittableImageModelandEPSFModelclasses have been deprecated. Instead, use the newImagePSFmodel class. [#1890]The default fitter for
PSFPhotometry,IterativePSFPhotometry, andEPSFFitterwas changed fromLevMarLSQFittertoTRFLSQFitter.LevMarLSQFitteruses the legacy SciPy functionscipy.optimize.leastsq, which is no longer recommended. [#1899]psf_shapeis now an optional keyword in themake_model_imageandmake_residual_imagemethods ofPSFPhotometryandIterativePSFPhotometry. 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.matchingPSF matching tools must now be imported from
photutils.psf.matchinginstead ofphotutils.psf. [#1904]
photutils.segmentationThe
SegmentationImagerelabel_consecutive,resassign_label(s),keep_label(s),remove_label(s),remove_border_labels, andremove_masked_labelsmethods now keep the original dtype of the segmentation image instead of always changing it toint(int64). [#1878, #1923]The
detect_sourcesanddeblend_sourcesfunctions now return aSegmentationImageinstance whose data dtype isnp.int32instead ofint(int64) unless more than (2**32 - 1) labels are needed. [#1878]
1.13.0 (2024-06-28)#
General#
scikit-learnhas been removed as an optional dependency. [#1774]
New Features#
photutils.datasetsAdded a
make_model_imagefunction for generating simulated images with model sources. This function has more options and is significantly faster than the now-deprecatedmake_model_sources_imagefunction. [#1759, #1790]Added a
make_model_paramsfunction to make a table of randomly generated model positions, fluxes, or other parameters for simulated sources. [#1766, #1796]
photutils.detectionphotutils.profilesphotutils.psfAdded an
include_localbkgkeyword to theIterativePSFPhotometrymake_model_imageandmake_residual_imagemethods. [#1756]Added “x_fit”, “xfit”, “y_fit”, “yfit”, “flux_fit”, and “fluxfit” as allowed column names in the
init_paramstable input to the PSF photometry objects. [#1765]Added a
make_psf_model_imagefunction to generate a simulated image from PSF models. [#1785, #1796]PSFPhotometrynow has a newfit_paramsattribute containing a table of the fit model parameters and errors. [#1789]The
PSFPhotometryandIterativePSFPhotometryinit_paramstable 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.apertureFixed an issue in
ApertureStatswhere in very rare cases thecovariancecalculation could take a long time. [#1788]
photutils.backgroundNo longer warn about NaNs in the data if those NaNs are masked in
coverage_maskpassed toBackground2D. [#1729]
photutils.psfFixed an issue where
IterativePSFPhotometrywould fail if the input data was aQuantityarray. [#1746]Fixed the
IntegratedGaussianPRFclassbounding_boxlimits to always be symmetric. [#1754]Fixed an issue where
IterativePSFPhotometrycould sometimes issue a warning when merging tables ifmode='all'. [#1761]Fixed a bug where the first matching column in the
init_paramstable was not used inPSFPhotometryandIterativePSFPhotometry. [#1765]Fixed an issue where
IterativePSFPhotometrycould sometimes raise an error about non-overlapping data. [#1778]Fixed an issue with unit handling in
PSFPhotometryandIterativePSFPhotometry. [#1792]Fixed an issue in
IterativePSFPhotometrywhere thefit_resultsattribute was not cleared between repeated calls. [#1793]
photutils.segmentationFixed an issue in
SourceCatalogwhere in very rare cases thecovariancecalculation could take a long time. [#1788]
API Changes#
The
photutils.testfunction has been removed. Instead use thepytest --pyargs photutilscommand. [#1725]photutils.datasetsThe
photutils.datasetssubpackage has been reorganized and themakemodule has been deprecated. Instead of importing functions fromphotutils.datasets.make, import functions fromphotutils.datasets. [#1726]The
make_model_sources_imagefunction has been deprecated in favor of the newmake_model_imagefunction. The new function has more options and is significantly faster. [#1759]The randomly-generated optional noise in the simulated example images
make_4gaussians_imageandmake_100gaussians_imageis now slightly different. The noise sigma is the same, but the pixel values differ. [#1760]The
make_gaussian_prf_sources_imagefunction is now deprecated. Use themake_model_psf_imagefunction or the newmake_model_imagefunction instead. [#1762]The
make_gaussian_sources_tablefunction now includes an “id” column and always returns both'flux'and'amplitude'columns. [#1763]The
make_model_sources_tablefunction now includes an “id” column. [#1764]The
make_gaussian_sources_tablefunction is now deprecated. Use themake_model_sources_tablefunction instead. [#1764]The
make_test_psf_datafunction is now deprecated. Use the newmake_model_psf_imagefunction instead. [#1785]
photutils.detectionThe
skykeyword inDAOStarFinderandIRAFStarFinderis 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, andStarFinder. [#1750]
photutils.psfPSFPhotometryandIterativePSFPhotometrynow raise aValueErrorif the inputpsf_modelis not two-dimensional withn_inputs=2andn_outputs=1. [#1741]The
IntegratedGaussianPRFclassbounding_boxis now a method instead of an attribute for consistency with Astropy models. The method has afactorkeyword to scale the bounding box. The default scale factor is 5.5 timessigma. [#1754]The
IterativePSFPhotometrymake_model_imageandmake_residual_imagemethods no longer include the local background by default. This is a backwards-incompatible change. If the previous behavior is desired, setinclude_localbkg=True. [#1756]IterativePSFPhotometrywill now only issue warnings after all iterations are completed. [#1767]The
IterativePSFPhotometrypsfphotattribute has been removed. Instead, use thefit_resultsattribute, which contains a list ofPSFPhotometryinstances for each fit iteration. [#1771]The
group_sizecolumn has been moved to come immediately after thegroup_idcolumn in the output table fromPSFPhotometryandIterativePSFPhotometry. [#1772]The
PSFPhotometryinit_paramstable was moved from thefit_resultsdictionary to an attribute. [#1773]Removed
local_bkg,psfcenter_indices,fit_residuals,npixfit, andnmodelskeys from thePSFPhotometryfit_resultsdictionary. [#1773]Removed the deprecated
BasicPSFPhotometry,IterativelySubtractedPSFPhotometry,DAOPhotPSFPhotometry,DAOGroup,DBSCANGroup, andGroupStarsBase, andNonNormalizableclasses and theprepare_psf_model,get_grouped_psf_model, andsubtract_psffunctions. [#1774]A
ValueErroris now raised if the shape of theerrorarray does not match thedataarray when calling the PSF-fitting classes. [#1777]The
fit_param_errskey was removed from thePSFPhotometryfit_resultsdictionary. The fit parameter errors are now stored in thefit_paramstable. [#1789]The
cfitcolumn in thePSFPhotometryandIterativePSFPhotometryresult table will now be NaN for sources whose initial central pixel is masked. [#1789]
1.12.0 (2024-04-12)#
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.backgroundNo longer warn about NaNs in the data if those NaNs are masked in
maskpassed toBackground2D. [#1712]
API Changes#
photutils.utilsThe default value for the
ImageDepthmask_padkeyword is now set to 0. [#1714]
1.11.0 (2024-02-16)#
New Features#
photutils.psfAn
init_paramstable is now included in thePSFPhotometryfit_resultsdictionary. [#1681]Added an
include_localbkgkeyword to thePSFPhotometrymake_model_imageandmake_residual_imagemethods. [#1691]Significantly reduced the memory usage of PSF photometry when using a
GriddedPSFModelPSF model. [#1679]Added a
modekeyword toIterativePSFPhotometryfor controlling the fitting mode. [#1708]
photutils.datasetsImproved the performance of
make_test_psf_datawhen generating random coordinates with a minimum separation. [#1668]
photutils.segmentationThe
SourceFindernpixelskeyword can now be a tuple corresponding to the values used for the source finder and source deblender, respectively. [#1688]
photutils.utilsImproved the performance of
ImageDepthwhen generating random coordinates with a minimum separation. [#1668]
Bug Fixes#
photutils.psf
API Changes#
photutils.aperturePixelApertureinstances now raise an informative error message whenpositionsis input as azipobject containing AstropyQuantityobjects. [#1682]
photutils.psfThe
GridddedPSFModelstring representations now include the modelflux,x_0, andy_0parameters. [#1680]The
PSFPhotometrymake_model_imageandmake_residual_imagemethods no longer include the local background by default. This is a backwards-incompatible change. If the previous behavior is desired, setinclude_localbkg=True. [#1703]The PSF photometry
finder_resultsattribute is now returned as aQTableinstead of a list ofQTable. [#1704]Deprecated the
NonNormalizablecustom warning class in favor ofAstropyUserWarning. [#1710]
photutils.segmentationThe
SourceCatalogget_labelandget_labelsmethods now raise aValueErrorif any of the input labels are invalid. [#1694]
1.10.0 (2023-11-21)#
General#
The minimum required Astropy is now 5.1. [#1627]
New Features#
photutils.datasetsphotutils.detectionAdded a
min_separationkeyword toDAOStarFinderandIRAFStarFinder. [#1663]
photutils.morphologyAdded a
wcskeyword todata_properties. [#1648]
photutils.psfThe
GriddedPSFModelplot_gridmethod now returns amatplotlib.figure.Figureobject. [#1653]Added the ability for the
GriddedPSFModelreadmethod to read FITS files generated by WebbPSF. [#1654]Added “flux_0” and “flux0” as allowed flux column names in the
init_paramstable input to the PSF photometry objects. [#1656]PSF models output from
prepare_psf_modelcan now be input into the PSF photometry classes. [#1657]Added
make_psf_modelfunction for making a PSF model from a 2D Astropy model. Compound models are also supported. [#1658]The
GriddedPSFModeloversampling can now be different in the x and y directions. Theoversamplingattribute is now stored as a 1Dnumpy.ndarraywith two elements. [#1664]
photutils.segmentationThe
SegmentationImagemake_source_maskmethod now uses a much faster implementation of binary dilation. [#1638]Added a
scalekeyword to theSegmentationImage.to_patches()method to scale the sizes of the polygon patches. [#1641, #1646]Improved the
SegmentationImageimshowmethod to ensure that labels are plotted with unique colors. [#1649]Added a
imshow_mapmethod toSegmentationImagefor plotting segmentation images with a small number of non-consecutive labels. [#1649]Added a
reset_cmapmethod toSegmentationImagefor resetting the colormap to a new random colormap. [#1649]
photutils.utilsImproved the generation of random aperture positions in
ImageDepth. [#1666]
Bug Fixes#
photutils.apertureFixed an issue where the aperture
plotmethod**kwargswere not reset to the default values when called multiple times. [#1655]
photutils.psfphotutils.segmentation
API Changes#
The metadata in output tables now contains a timestamp. [#1640]
The order of the metadata in a table is now preserved when writing to a file. [#1640]
photutils.psfDeprecated the
prepare_psf_modelfunction. Use the newmake_psf_modelfunction instead. [#1658]The
GriddedPSFModelnow stores the ePSF grid such that it is first sorted by y then by x. As a result, the order of thedataandxygridattributes may be different. [#1661]The
oversamplingattribute is now stored as a 1Dnumpy.ndarraywith two elements. [#1664]A
ValueErroris raised ifGriddedPSFModelis called with x and y arrays that have more than 2 dimensions. [#1662]
photutils.segmentationRemoved the deprecated
kernelkeyword fromSourceCatalog. [#1613]
1.9.0 (2023-08-14)#
General#
New Features#
photutils.backgroundAdded
LocalBackgroundclass for computing local backgrounds in a circular annulus aperture. [#1556]
photutils.datasetsphotutils.psfPropagate measurement uncertainties in PSF fitting. [#1543]
Added new
PSFPhotometryandIterativePSFPhotometryclasses for performing PSF-fitting photometry. [#1558, #1559, #1563, #1566, #1567, #1581, #1586, #1590, #1594, #1603, #1604]Added a
GriddedPSFModelfill_valueattribute. [#1583]Added a
grid_from_epsfsfunction to make aGriddedPSFModelfrom ePSFs. [#1596]Added a
readmethod toGriddedPSFModelfor reading “STDPSF” FITS files containing grids of ePSF models. [#1557]Added a
plot_gridmethod toGriddedPSFModelfor plotting ePSF grids. [#1557]Added a
STDPSFGridclass for reading “STDPSF” FITS files containing grids of ePSF models and plotting the ePSF grids. [#1557]
Bug Fixes#
photutils.apertureFixed a bug in the validation of
PixelAperturepositions. [#1553]
API Changes#
photutils.psfDeprecated the PSF photometry classes
BasicPSFPhotometry,IterativelySubtractedPSFPhotometry, andDAOPhotPSFPhotometry. Use the newPSFPhotometryorIterativePSFPhotometryclass instead. [#1578]Deprecated the
DAOGroup,DBSCANGroup, andGroupStarsBaseclasses. Use the newSourceGrouperclass instead. [#1578]Deprecated the
get_grouped_psf_modelandsubtract_psffunction. [#1578]
1.8.0 (2023-05-17)#
General#
New Features#
photutils.profilesThe
RadialProfileandCurveOfGrowthradial bins can now be directly input, which also allows for non-uniform radial spacing. [#1540]
Bug Fixes#
photutils.psfFixed an issue with the local model cache in
GriddedPSFModel, significantly improving performance. [#1536]
API Changes#
Removed the deprecated
axeskeyword in favor ofaxfor consistency with other packages. [#1523]photutils.apertureRemoved the
ApertureStatsunpack_nddatamethod. [#1537]
photutils.profilesThe API for defining the radial bins for the
RadialProfileandCurveOfGrowthclasses was changed. While the new API allows for more flexibility, unfortunately, it is not backwards-compatible. [#1540]
photutils.segmentationRemoved the deprecated
kernelkeyword fromdetect_sourcesanddeblend_sources. [#1524]Deprecated the
kernelkeyword inSourceCatalog. [#1525]Removed the deprecated
outline_segmentsmethod fromSegmentationImage. [#1526]The
SourceCatalogkron_paramsattribute is no longer returned as andarray. It is returned as atuple. [#1531]
1.7.0 (2023-04-05)#
General#
The
rasterioandshapelypackages are now optional dependencies. [#1509]
New Features#
photutils.aperturephotutils.profilesphotutils.psfSignificantly improved the performance of evaluating and fitting
GriddedPSFModelinstances. [#1503]
photutils.segmentationAdded a
sizekeyword to theSegmentationImagemake_source_maskmethod. [#1506]Significantly improved the performance of
SegmentationImagemake_source_maskwhen using square footprints for source dilation. [#1506]Added the
polygonsproperty andto_patchesandplot_patchesmethods toSegmentationImage. [#1509]Added
polygonkeyword to theSegmentclass. [#1509]
Bug Fixes#
photutils.centroidsFixed an issue where
centroid_quadraticwould sometimes fail if the input data contained NaNs. [#1495]
photutils.detectionFixed an issue with the starfinders (
DAOStarFinder,IRAFStarFinder, andStarFinder) where an exception was raised ifexclude_border=Trueand there were no detections. [#1512].
photutils.isophotephotutils.psfphotutils.utilsFixed a bug in the calculation of
ImageCutoutxyoriginwhen using the'partial'mode when the cutout extended beyond the right or top edge. [#1508]
API Changes#
photutils.apertureThe
ApertureStatslocal_bkgkeyword can now be broadcast for apertures with multiple positions. [#1504]
photutils.centroidsThe
centroid_sourcesfunction will now raise an error if the cutout mask contains allTruevalues. [#1516]
photutils.datasetsRemoved the deprecated
load_fermi_imagefunction. [#1479]
photutils.psfRemoved the deprecated
sandboxclassesDiscretePRFandReproject. [#1479]
photutils.segmentationRemoved the deprecated
make_source_maskfunction in favor of theSegmentationImage.make_source_maskmethod. [#1479]The
SegmentationImageimshowmethod now uses “nearest” interpolation instead of “none” to avoid rendering issues with some backends. [#1507]The
repr()notebook output for theSegmentclass now includes a SVG polygon representation of the segment if therasterioandshapelypackages are installed. [#1509]Deprecated the
SegmentationImageoutline_segmentsmethod. Use theplot_patchesmethod instead. [#1509]
1.6.0 (2022-12-09)#
General#
New Features#
photutils.aperturephotutils.psfphotutils.segmentationAdded the ability to slice
SegmentationImageobjects. [#1413]Added
modeandfill_valuekeywords toSourceCatalogmake_cutoutsmethod. [#1420]Added
segment_areasource property andwcs,localbkg_width,apermask_method, andkron_paramsattributes toSourceCatalog. [#1425]Added the ability to use
Quantityarrays withdetect_threshold,detect_sources,deblend_sources, andSourceFinder. [#1436]The progress bar used when deblending sources now is prepended with “Deblending”. [#1439]
Added a
progress_baroption toSourceCatalogfor displaying progress bars when calculating some source properties. [#1471]
photutils.utils
Bug Fixes#
photutils.aperturephotutils.datasetsFixed a bug in the various
loadfunctions where FITS files were not closed. [#1455]
photutils.segmentationFixed an issue in the
SourceCatalogkron_photometry,make_kron_apertures, andplot_kron_aperturesmethods where the input minimum Kron and circular radii would not be applied. Instead the instance-level minima would always be used. [#1421]Fixed an issue where the
SourceCatalogplot_kron_aperturesmethod would raise an error for a scalarSourceCatalog. [#1421]Fixed an issue in
SourceCatalogget_labelsfor the case when the labels are not sorted (due to slicing). [#1423]
API Changes#
Deprecated
axeskeyword in favor ofaxfor consistency with other packages. [#1432]Importing tools from all subpackages now requires including the subpackage name.
photutils.aperturephotutils.centroidsRemoved the deprecated
oversamplingkeyword incentroid_com. [#1398]
photutils.datasetsDeprecated the
load_fermi_imagefunction. [#1455]
photutils.psfphotutils.segmentationRemoved the deprecated
sigclip_sigmaandsigclip_iterskeywords indetect_threshold. Use thesigma_clipkeyword instead. [#1398]Removed the
mask_value,sigclip_sigma, andsigclip_iterskeywords indetect_threshold. Use themaskorsigma_clipkeywords instead. [#1398]Removed the deprecated the
filter_fwhmandfilter_sizekeywords inmake_source_mask. Use thekernelkeyword instead. [#1398]If
detection_catis input toSourceCatalog, then the detection catalog source centroids and morphological/shape properties will be returned instead of calculating them from the input data. Also, ifdetection_catis input, then the inputwcs,apermask_method, andkron_paramskeywords will be ignored. [#1425]
1.5.0 (2022-07-12)#
General#
Added
tqdmas an optional dependency. [#1364]
New Features#
photutils.psfphotutils.segmentationAdded
SourceFinderclass, which is a convenience class combiningdetect_sourcesanddeblend_sources. [#1344]Added a
sigma_clipkeyword todetect_threshold. [#1354]Added a
make_source_maskmethod toSegmentationImage. [#1355]Added a
make_2dgaussian_kernelconvenience function. [#1356]Allow
SegmentationImage.make_cmapbackground_colorto be in any matplotlib color format. [#1361]Added an
imshowconvenience method toSegmentationImage. [#1362]Improved performance of
deblend_sources. [#1364]Added a
progress_barkeyword todeblend_sources. [#1364]Added a
'sinh'mode todeblend_sources. [#1368]Improved the resetting of cached
SegmentationImageproperties so that custom (non-cached) attributes can be kept. [#1368]Added a
nprockeyword to enable multiprocessing indeblend_sourcesandSourceFinder. [#1372]Added a
make_cutoutsmethod toSourceCatalogfor making custom-shaped cutout images. [#1376]Added the ability to set a minimum unscaled Kron radius in
SourceCatalog. [#1381]
photutils.utils
Bug Fixes#
API Changes#
photutils.centroidsphotutils.psfInvalid data values (i.e., NaN or inf) are now automatically masked when performing PSF fitting. [#1350]
Deprecated the
sandboxclassesDiscretePRFandReproject. [#1357]Changed the axes order of
oversamplingkeywords when input as a tuple. [#1358]Removed the unused
shift_valkeyword inEPSFBuilderandEPSFModel. [#1377]Renamed the
flux_residual_sigclipkeyword (now deprecated) tosigma_clipinEPSFBuilder. [#1378]The
EPSFBuilderprogress bar now requires that the optionaltqdmpackage be installed. [#1379]The tools in the PSF package now require keyword-only arguments. [#1386]
photutils.segmentationRemoved the deprecated
circular_aperturemethod fromSourceCatalog. [#1329]The
SourceCatalogplot_kron_aperturesmethod now sets a defaultkron_apersvalue. [#1346]deblend_sourcesno longer allows an array to be input as a segmentation image. It must be aSegmentationImageobject. [#1347]SegmentationImageno longer allows array-like input. It must be a numpyndarray. [#1347]Deprecated the
sigclip_sigmaandsigclip_iterskeywords indetect_threshold. Use thesigma_clipkeyword instead. [#1354]Deprecated the
make_source_maskfunction in favor of theSegmentationImage.make_source_maskmethod. [#1355]Deprecated the
kernelkeyword indetect_sourcesanddeblend_sources. Instead, if filtering is desired, input a convolved image directly into thedataparameter. [#1365]Sources with a data minimum of zero are now treated the same as negative minima (i.e., the mode is changed to “linear”) for the “exponential” deblending mode. [#1368]
A single warning (as opposed to 1 per source) is now raised about negative/zero minimum data values using the ‘exponential’ deblending mode. The affected labels is available in a new “info” attribute. [#1368]
If the mode in
deblend_sourcesis “exponential” or “sinh” and there are too many potential deblended sources within a given source (watershed markers), a warning will be raised and the mode will be changed to “linear”. [#1369]The
SourceCatalogmake_circular_aperturesandmake_kron_aperturesmethods now return a single aperture (instead of a list with one item) for a scalarSourceCatalog. [#1376]The
SourceCatalogkron_paramskeyword now has an optional third item representing the minimum circular radius. [#1381]The
SourceCatalogkron_radiusis now set to the minimum Kron radius (the second element ofkron_params) if the data or radially weighted data sum to zero. [#1381]
photutils.utilsThe colormap returned from
make_random_cmapnow has colors in RGBA format. [#1361]
1.4.0 (2022-03-25)#
General#
The minimum required Python is now 3.8. [#1279]
The minimum required Numpy is now 1.18. [#1279]
The minimum required Astropy is now 5.0. [#1279]
The minimum required Matplotlib is now 3.1. [#1279]
The minimum required scikit-image is now 0.15.0 [#1279]
The minimum required gwcs is now 0.16.0 [#1279]
New Features#
photutils.apertureAdded a
copymethod toApertureobjects. [#1304]Added the ability to compare
Apertureobjects for equality. [#1304]The
thetakeyword forEllipticalAperture,EllipticalAnnulus,RectangularAperture, andRectangularEllipsecan now be an AstropyAngleorQuantityin angular units. [#1308]Added an
ApertureStatsclass for computing statistics of unmasked pixels within an aperture. [#1309, #1314, #1315, #1318]Added a
dtypekeyword to theApertureMaskto_imagemethod. [#1320]
photutils.backgroundphotutils.segmentation
Bug Fixes#
photutils.apertureFixed a bug in
aperture_photometrywhere an error was not raised if the data and error arrays have different units. [#1285].
photutils.backgroundFixed a bug in
Background2Dwhere using thepadedge method would result in incorrect image padding if only one of the axes needed padding. [#1292]
photutils.centroidsphotutils.segmentationFixed a bug in
SourceCatalogwhere aUFuncTypeErrorwould be raised if the inputdatahad an integerdtype[#1312].
API Changes#
photutils.apertureA
ValueErroris now raised if non-positive sizes are input to sky-based apertures. [#1295]The
BoundingBox.plot()method now returns amatplotlib.patches.Patchobject. [#1305]Inputting
PixelAperturepositions as an AstropyQuantityin pixel units is deprecated. [#1310]Inputting
SkyApertureshape parameters as an AstropyQuantityin pixel units is deprecated. [#1310]
photutils.backgroundRemoved the deprecated
background_mesh_maandbackground_rms_mesh_maBackground2Dproperties. [#1280]By default,
BkgZoomInterpolatorusesclip=Trueto prevent the interpolation from producing values outside the given input range. If backwards-compatibility is needed with older Photutils versions, setclip=False. [#1324]
photutils.centroidsphotutils.morphologyImporting tools from the morphology subpackage now requires including the subpackage name. [#1280]
photutils.segmentationRemoved the deprecated
source_propertiesfunction and theSourcePropertiesandLegacySourceCatalogclasses. [#1280]Removed the deprecated the
filter_kernelkeyword in thedetect_sources,deblend_sources, andmake_source_maskfunctions. [#1280]A
TypeErroris raised if the input array toSegmentationImagedoes not have integer type. [#1319]A
SegmentationImagemay contain an array of all zeros. [#1319]Deprecated the
mask_valuekeyword indetect_threshold. Use themaskkeyword instead. [#1322]Deprecated the
filter_fwhmandfilter_sizekeywords inmake_source_mask. Use thekernelkeyword instead. [#1322]
1.3.0 (2021-12-21)#
General#
The metadata in output tables now contains version information for all dependencies. [#1274]
New Features#
photutils.centroidsphotutils.segmentationAdded
copymethod toSourceCatalog. [#1264]Added
kron_photometrymethod toSourceCatalog. [#1264]Added
add_extra_property,remove_extra_property,remove_extra_properties, andrename_extra_propertymethods andextra_propertiesattribute toSourceCatalog. [#1264, #1268]Added
nameandoverwritekeywords toSourceCatalogcircular_photometryandfluxfrac_radiusmethods. [#1264]SourceCatalogfluxfrac_radiuswas improved for cases where the source flux doesn’t monotonically increase with increasing radius. [#1264]Added
metaandpropertiesattributes toSourceCatalog. [#1268]The
SourceCatalogoutput table (usingto_table)metadictionary now includes a field for the date/time. [#1268]Added
SourceCatalogmake_kron_aperturesmethod. [#1268]Added
SourceCatalogplot_circular_aperturesandplot_kron_aperturesmethods. [#1268]
Bug Fixes#
photutils.segmentationIf
detection_catalogis input toSourceCatalogthen the detection centroids are used to calculate thecircular_aperture,circular_photometry, andfluxfrac_radius. [#1264]Units are applied to
SourceCatalogcircular_photometryoutput if the input data has units. [#1264]SourceCatalogcircular_photometryreturns scalar values if catalog is scalar. [#1264]SourceCatalogfluxfrac_radiusreturns aQuantitywith pixel units. [#1264]Fixed a bug where the
SourceCatalogdetection_catalogwas not indexed/sliced whenSourceCatalogwas indexed/sliced. [#1268]SourceCatalogcircular_photometrynow returns NaN for completely-masked sources. [#1268]SourceCatalogkron_fluxis always NaN for sources wherekron_radiusis NaN. [#1268]SourceCatalogfluxfrac_radiusnow returns NaN ifkron_fluxis zero. [#1268]
API Changes#
photutils.centroidsA
ValueErroris now raised incentroid_sourcesif the inputxposoryposis outside of the inputdata. [#1276]A
ValueErroris now raised incentroid_quadraticif the inputxpeakorypeakis outside of the inputdata. [#1276]NaNs are now returned from
centroid_sourceswhere the centroid failed. This is usually due to abox_sizethat is too small when using a fitting-based centroid function. [#1276]
photutils.segmentationRenamed the
SourceCatalogcircular_aperturemethod tomake_circular_apertures. The old name is deprecated. [#1268]The
SourceCatalogkron_paramskeyword must have a minimum circular radius that is greater than zero. The default value is now 1.0. [#1268]detect_sourcesnow usesastropy.convolution.convolve, which allows for masking pixels. [#1269]
1.2.0 (2021-09-23)#
General#
The minimum required scipy version is 1.6.0 [#1239]
New Features#
photutils.apertureAdded a
maskkeyword to thearea_overlapmethod. [#1241]
photutils.backgroundImproved the performance of
Background2Dby up to 10-50% when the optionalbottleneckpackage is installed. [#1232]Added a
maskedkeyword to the background classesMeanBackground,MedianBackground,ModeEstimatorBackground,MMMBackground,SExtractorBackground,BiweightLocationBackground,StdBackgroundRMS,MADStdBackgroundRMS, andBiweightScaleBackgroundRMS. [#1232]Enable all background classes to work with
Quantityinputs. [#1233]Added a
markersizekeyword to theBackground2Dmethodplot_meshes. [#1234]Added
__repr__methods to all background classes. [#1236]Added a
grid_modekeyword toBkgZoomInterpolator. [#1239]
photutils.detectionAdded a
xycoordskeyword toDAOStarFinderandIRAFStarFinder. [#1248]
photutils.psf
Bug Fixes#
photutils.apertureFixed a bug when converting between pixel and sky apertures with a
gwcsobject. [#1221]
photutils.backgroundFixed an issue where
Background2Dcould fail when using the'pad'edge method. [#1227]
photutils.detectionFixed the
DAOStarFinderimport deprecation message. [#1195]
photutils.morphologyFixed an issue in
data_propertieswhere a scalar background input would raise an error. [#1198]
photutils.psfFixed an issue in
prepare_psf_modelwhenxnameorynamewasNonewhere the model offsets were applied in the wrong direction, resulting in the initial photometry guesses not being improved by the fit. [#1199]
photutils.segmentationphotutils.utilsFixed an issue in
ShepardIDWInterpolatorto allow its initialization with scalar data values and coordinate arrays having more than one dimension. [#1226]
API Changes#
photutils.aperturephotutils.backgroundInvalid data values (i.e., NaN or inf) are now automatically masked in
Background2D. [#1232]The background classes
MeanBackground,MedianBackground,ModeEstimatorBackground,MMMBackground,SExtractorBackground,BiweightLocationBackground,StdBackgroundRMS,MADStdBackgroundRMS, andBiweightScaleBackgroundRMSnow return by default anumpy.ndarraywithnp.nanvalues representing masked pixels instead of a masked array. A masked array can be returned by settingmasked=True. [#1232]Deprecated the
Background2Dattributesbackground_mesh_maandbackground_rms_mesh_ma. They have been renamed tobackground_mesh_maskedandbackground_rms_mesh_masked. [#1232]By default,
BkgZoomInterpolatornow usesgrid_mode=True. For zooming 2D images, this keyword should be set to True, which makes the interpolator’s behavior consistent withscipy.ndimage.map_coordinates,skimage.transform.resize, andOpenCV (cv2.resize). If backwards-compatibility is needed with older Photutils versions, setgrid_mode=False. [#1239]
photutils.centroidsDeprecated the
gaussian1d_momentsandcentroid_epsffunctions. [#1240]
photutils.datasetsphotutils.detectionphotutils.isophoteThe
Isophoteto_tablemethod nows return an astropyQTablewith version metadata. [#1247]
photutils.psfBasicPSFPhotometry,IterativelySubtractedPSFPhotometry, andDAOPhotPSFPhotometrynow return an astropyQTablewith version metadata. [#1247]
photutils.segmentationDeprecated the
filter_kernelkeyword in thedetect_sources,deblend_sources, andmake_source_maskfunctions. It has been renamed to simplykernelfor consistency withSourceCatalog. [#1242]Removed the deprecated
random_statekeyword in themake_cmapmethod. [#1244]The
SourceCatalogto_tablemethod nows return an astropyQTablewith version metadata. [#1247]
photutils.utils
1.1.0 (2021-03-20)#
General#
The minimum required python version is 3.7. [#1120]
New Features#
photutils.apertureThe
PixelAperture.plot()method now returns a list ofmatplotlib.patches.Patchobjects. [#923]Added an
area_overlapmethod forPixelApertureobjects that gives the overlapping area of the aperture on the data. [#874]Added a
get_overlap_slicesmethod and acenterattribute toBoundingBox. [#1157]Added a
get_valuesmethod toApertureMaskthat returns a 1D array of mask-weighted values. [#1158, #1161]Added
get_overlap_slicesmethod toApertureMask. [#1165]
photutils.backgroundThe
Background2Dclass now accepts astropyNDData,CCDData, andQuantityobjects as data inputs. [#1140]
photutils.detectionAdded a
StarFinderclass to detect stars with a user-defined kernel. [#1182]
photutils.isophoteAdded the ability to specify the output columns in the
IsophoteListto_tablemethod. [#1117]
photutils.psfphotutils.segmentationAdded a modified, significantly faster,
SourceCatalogclass. [#1170, #1188, #1191]Added
circular_apertureandcircular_photometrymethods to theSourceCatalogclass. [#1188]Added
fwhmproperty to theSourceCatalogclass. [#1191]Added
fluxfrac_radiusmethod to theSourceCatalogclass. [#1192]Added a
bboxattribute toSegmentationImage. [#1187]
Bug Fixes#
photutils.apertureSlicing a scalar
Apertureobject now raises an informative error message. [#1154]Fixed an issue where
ApertureMask.multiplyfill_valuewas not applied to pixels outside of the aperture mask, but within the aperture bounding box. [#1158]Fixed an issue where
ApertureMask.cutoutwould raise an error iffill_valuewas non-finite and the input array was integer type. [#1158]Fixed an issue where
RectangularAnnuluswith a non-defaulth_inwould give an incorrectApertureMask. [#1160]
photutils.isophoteFix computation of gradient relative error when gradient=0. [#1180]
photutils.psfFixed a bug in
EPSFBuildwhere a warning was raised if the inputsmoothing_kernelwas annumpy.ndarray. [#1146]Fixed a bug that caused photometry to fail on an
EPSFmodelwith multiple stars in a group. [#1135]Added a fallback
aperture_radiusfor PSF models without a FWHM or sigma attribute, raising a warning. [#740]
photutils.segmentationFixed
SourcePropertieslocal_backgroundto work with Quantity data inputs. [#1162]Fixed
SourcePropertieslocal_backgroundfor sources near the image edges. [#1162]Fixed
SourcePropertieskron_radiusfor sources that are completely masked. [#1164]Fixed
SourcePropertiesKron properties for sources near the image edges. [#1167]Fixed
SourcePropertiesKron mask correction. [#1167]
API Changes#
photutils.apertureDeprecated the
BoundingBoxslicesattribute. Use theget_overlap_slicesmethod instead. [#1157]
photutils.centroidsphotutils.detectionImporting the
DAOStarFinder,IRAFStarFinder, andStarFinderBaseclasses from the deprecatedfindstars.pymodule is now deprecated. These classes can be imported usingfrom photutils.detection import <class>. [#1173]Importing the
find_peaksfunction from the deprecatedcore.pymodule is now deprecated. This function can be imported usingfrom photutils.detection import find_peaks. [#1173]
photutils.morphologyImporting tools from the morphology subpackage without including the subpackage name is deprecated. [#1190]
photutils.segmentationDeprecated the
"mask_all"option in theSourcePropertieskron_paramskeyword. [#1167]Deprecated
source_properties,SourceProperties, andLegacySourceCatalog. Use the newSourceCatalogfunction instead. [#1170]The
detect_thresholdfunction was moved to thesegmentationsubpackage. [#1171]Removed the ability to slice
SegmentationImage. Instead slice thesegmentsattribute. [#1187]
1.0.2 (2021-01-20)#
General#
Bug Fixes#
photutils.backgroundFixed a bug with
Background2Dwhere usingBkgIDWInterpolatorwould give incorrect results. [#1104]
photutils.isophotephotutils.psfphotutils.segmentation
1.0.1 (2020-09-24)#
Bug Fixes#
photutils.psfFixed checks on
oversamplingfactors. [#1086]
1.0.0 (2020-09-22)#
General#
New Features#
photutils.aperturephotutils.backgroundAdded
coverage_maskandfill_valuekeyword options toBackground2D. [#1061]
photutils.centroidsAdded quadratic centroid estimator function (
centroid_quadratic). [#1067]
photutils.psfAdded the ability to use odd oversampling factors in
EPSFBuilder. [#1076]
photutils.segmentation
Bug Fixes#
photutils.isophoteFixed a typo in the calculation of the
b4higher-order harmonic coefficient inbuild_ellipse_model. [#1052]Fixed a bug where
build_ellipse_modelfalls into an infinite loop when the pixel to fit is outside of the image. [#1039]Fixed a bug where
build_ellipse_modelfalls into an infinite loop under certain image/parameters input combinations. [#1056]
photutils.psfFixed a bug in
subtract_psfcaused by using a fill_value of np.nan with an integer input array. [#1062]
photutils.segmentationFixed a bug where
source_propertieswould fail with unitlessgwcs.wcs.WCSobjects. [#1020]
photutils.utilsThe
effective_gainparameter incalc_total_errorcan now be zero (or contain zero values). [#1019]
API Changes#
photutils.apertureAperture pixel positions can no longer be shaped as 2xN. [#953]
Removed the deprecated
unitskeyword inaperture_photometryandPixelAperture.do_photometry. [#953]PrimaryHDU,ImageHDU, andHDUListcan no longer be input toaperture_photometry. [#953]Removed the deprecated the Aperture
mask_areamethod. [#953]Removed the deprecated Aperture plot keywords
axandindices. [#953]
photutils.backgroundphotutils.centroidsphotutils.datasetsphotutils.detectionRemoved the deprecated
snrkeyword indetect_threshold. [#953]
photutils.psfphotutils.segmentationRemoved the deprecated
SegmentationImagemethodscmapandrelabel. [#953]Removed the deprecated
SourcePropertiesvaluesandcoordsattributes. [#953]Removed the deprecated
xmin/yminandxmax/ymaxproperties. [#953]Removed the deprecated
snrandmask_valuekeywords inmake_source_mask. [#953]Renamed the
random_statekeyword (deprecated) toseedin themake_cmapmethod. [#1080]
photutils.utilsRemoved the deprecated
random_cmap,mask_to_mirrored_num,get_version_info,filter_data, andstd_blocksumfunctions. [#953]Removed the deprecated
wcs_helpersfunctionspixel_scale_angle_at_skycoord,assert_angle_or_pixel,assert_angle, andpixel_to_icrs_coords. [#953]Deprecated the
check_random_statefunction. [#1080]Renamed the
random_statekeyword (deprecated) toseedin themake_random_cmapfunction. [#1080]
0.7.2 (2019-12-09)#
Bug Fixes#
photutils.isophoteFixed computation of upper harmonics
a3,b3,a4, andb4in the ellipse fitting algorithm. [#1008]
photutils.psfFix to algorithm in
EPSFBuilder, causing issues where ePSFs failed to build. [#974]Fix to
IterativelySubtractedPSFPhotometrywhere an error could be thrown when aFinderwas passed which did not returnNoneif no sources were found. [#986]Fix to
centroid_epsfwhere the wrong oversampling factor was used along the y axis. [#1002]
0.7.1 (2019-10-09)#
Bug Fixes#
0.7 (2019-08-14)#
General#
Any WCS object that supports the astropy shared interface for WCS is now supported. [#899]
Added a new
photutils.__citation__andphotutils.__bibtex__attributes which give a citation for photutils in bibtex format. [#926]
New Features#
photutils.apertureAdded parameter validation for all aperture classes. [#846]
Added
from_float,as_artist,unionandintersectionmethods toBoundingBoxclass. [#851]Added
shapeandisscalarproperties to Aperture objects. [#852]Significantly improved the performance (~10-20 times faster) of aperture photometry, especially when using
errorsandQuantityinputs with many aperture positions. [#861]aperture_photometrynow supportsNDDatawithStdDevUncertaintyto input errors. [#866]The
modekeyword in theto_skyandto_pixelaperture methods was removed to implement the shared WCS interface. All WCS transforms now include distortions (if present). [#899]
photutils.datasetsAdded
make_gwcsfunction to create an examplegwcs.wcs.WCSobject. [#871]
photutils.isophotephotutils.psfAdded new centroiding function
centroid_epsf. [#816]
photutils.segmentationSignificantly improved the performance of relabeling in segmentation images (e.g.,
remove_labels,keep_labels). [#810]Added new
background_areaattribute toSegmentationImage. [#825]Added new
data_maattribute toSegment. [#825]Added new
SegmentationImagemethods:find_index,find_indices,find_areas,check_label,keep_label,remove_label, andreassign_labels. [#825]Added
__repr__and__str__methods toSegmentationImage. [#825]Added
slices,indices, andfiltered_data_cutout_maattributes toSourceProperties. [#858]Added
__repr__and__str__methods toSourcePropertiesandSourceCatalog. [#858]Significantly improved the performance of calculating the
background_at_centroidproperty inSourceCatalog. [#863]The default output table columns (source properties) are defined in a publicly-accessible variable called
photutils.segmentation.properties.DEFAULT_COLUMNS. [#863]Added the
ginisource property representing the Gini coefficient. [#864]Cached (lazy) properties can now be reset in
SegmentationImagesubclasses. [#916]Significantly improved the performance of
deblend_sources. It is ~40-50% faster for large images (e.g., 4k x 4k) with a few thousand of sources. [#924]
photutils.utilsAdded
NoDetectionsWarningclass. [#836]
Bug Fixes#
photutils.apertureFixed an issue where the
ApertureMask.cutoutmethod would drop the data units whencopy=True. [#842]Fixed a corner-case issue where aperture photometry would return NaN for non-finite data values outside the aperture but within the aperture bounding box. [#843]
Fixed an issue where the
celestial_centercolumn (for sky apertures) would be a length-1 array containing aSkyCoordobject instead of a length-1SkyCoordobject. [#844]
photutils.isophotephotutils.psfphotutils.segmentationFixed an issue where
deblend_sourcescould fail for sources with labels that are a power of 2 and greater than 255. [#806]SourcePropertiesandsource_propertieswill no longer raise an exception if a source is completely masked. [#822]Fixed an issue in
SourcePropertiesandsource_propertieswhere inf values in the data array were not automatically masked. [#822]errorandbackgroundarrays are now always masked identically to the inputdata. [#822]Fixed the
perimeterproperty to take into account the source mask. [#822]Fixed the
background_at_centroidsource property to use bilinear interpolation. [#822]Fixed
SegmentationImageoutline_segmentsto include outlines along the image boundaries. [#825]Fixed
SegmentationImage.is_consecutiveto returnTrueonly if the labels are consecutive and start with label=1. [#886]Fixed a bug in
deblend_sourceswhere sources could be deblended too much whenconnectivity=8. [#890]Fixed a bug in
deblend_sourceswhere thecontrastparameter had little effect if the original segment contained three or more sources. [#890]
photutils.utilsFixed a bug in
filter_datawhere units were dropped for dataQuantityobjects. [#872]
API Changes#
photutils.apertureDeprecated inputting aperture pixel positions shaped as 2xN. [#847]
Renamed the
celestial_centercolumn tosky_centerin theaperture_photometryoutput table. [#848]Aperture objects defined with a single (x, y) position (input as 1D) are now considered scalar objects, which can be checked with the new
isscalarAperture property. [#852]Non-scalar Aperture objects can now be indexed, sliced, and iterated. [#852]
Scalar Aperture objects now return scalar
positionsandbounding_boxesproperties and itsto_maskmethod returns anApertureMaskobject instead of a length-1 list containing anApertureMask. [#852]Deprecated the Aperture
mask_areamethod. [#853]Aperture
areais now an attribute instead of a method. [#854]The Aperture plot keyword
axwas deprecated and renamed toaxes. [#854]Deprecated the
unitskeyword inaperture_photometryand thePixelAperture.do_photometrymethod. [#866, #861]Deprecated
PrimaryHDU,ImageHDU, andHDUListinputs toaperture_photometry. [#867]The
aperture_photometryfunction moved to a newphotutils.aperture.photometrymodule. [#876]Renamed the
bounding_boxesattribute for pixel-based apertures tobboxfor consistency. [#896]Deprecated the
BoundingBoxas_patchmethod (instead useas_artist). [#851]
photutils.backgroundThe
Background2Dplot_mesheskeywordaxwas deprecated and renamed toaxes. [#854]
photutils.datasetsThe
make_noise_imagetypekeyword was deprecated and renamed todistribution. [#877]
photutils.detectionphotutils.isophotephotutils.psfFittableImageModeland subclasses now allow for differentoversamplingfactors to be specified in the x and y directions. [#834]Removed
pixel_scalekeyword fromEPSFStar,EPSFBuilder, andEPSFModel. [#815]Added
oversamplingkeyword tocentroid_com. [#816]Removed deprecated
Star,Stars, andLinkedStarclasses. [#894]Removed
recentering_boxsizeandcenter_accuracykeywords and addednorm_radiusandshift_valuekeywords inEPSFBuilder. [#817]Added
norm_radiusandshift_valuekeywords toEPSFModel. [#817]
photutils.segmentationRemoved deprecated
SegmentationImageattributesdata_masked,max, andis_sequentialand methodsareaandrelabel_sequential. [#825]Renamed
SegmentationImagemethodscmap(deprecated) tomake_cmapandrelabel(deprecated) toreassign_label. The newreassign_labelmethod gains arelabelkeyword. [#825]The
SegmentationImagesegmentsandslicesattributes now have the same length aslabels(noNoneplaceholders). [#825]detect_sourcesnow returnsNoneif no sources are found. Also, for this case aNoDetectionsWarningis issued. [#836]The
SegmentationImageinputdataarray must contain at least one non-zero pixel and must not contain any non-finite values. [#836]A
ValueErroris raised if an empty list is input intoSourceCatalogor no valid sources are defined insource_properties. [#836]Deprecated the
valuesandcoordsattributes inSourceProperties. [#858]Deprecated the unused
mask_valuekeyword inmake_source_mask. [#858]The
bboxproperty now returns aBoundingBoxinstance. [#863]The
xmin/yminandxmax/ymaxproperties have been deprecated with the replacements having abbox_prefix (e.g.,bbox_xmin). [#863]The
orientationproperty is now returned as aQuantityinstance in units of degrees. [#863]Renamed the
snr(deprecated) keyword tonsigmainmake_source_mask. [#917]
photutils.utilsRenamed
random_cmaptomake_random_cmap. [#825]Removed deprecated
cutout_footprintfunction. [#835]Deprecated the
wcs_helpersfunctionspixel_scale_angle_at_skycoord,assert_angle_or_pixel,assert_angle, andpixel_to_icrs_coords. [#846]Removed deprecated
interpolate_masked_datafunction. [#895]Deprecated the
mask_to_mirrored_numfunction. [#895]Deprecated the
get_version_info,filter_data, andstd_blocksumfunctions. [#918]
0.6 (2018-12-11)#
General#
Versions of Numpy <1.11 are no longer supported. [#783]
New Features#
photutils.detectionDAOStarFinderandIRAFStarFindergain two new parameters:brightestto keep the topbrightest(based on the flux) objects in the returned catalog (after all other filtering has been applied) andpeakmaxto exclude sources with peak pixel values larger or equal topeakmax. [#750]Added a
maskkeyword toDAOStarFinderandIRAFStarFinderthat can be used to mask regions of the input image. [#759]
photutils.psfThe
Star,Stars, andLinkedStarsclasses are now deprecated and have been renamedEPSFStar,EPSFStars, andLinkedEPSFStars, respectively. [#727]Added a
GriddedPSFModelclass for spatially-dependent PSFs. [#772]The
pixel_scalekeyword inEPSFStar,EPSFBuilderandEPSFModelis now deprecated. Use theoversamplingkeyword instead. [#780]
API Changes#
photutils.detectionThe
find_peaksfunction now returns an emptyastropy.table.Tableinstead of an empty list if the input data is an array of constant values. [#709]The
find_peaksfunction will no longer issue a RuntimeWarning if the input data contains NaNs. [#712]If no sources/peaks are found,
DAOStarFinder,IRAFStarFinder, andfind_peaksnow will return an empty table with column names and types. [#758, #762]
photutils.psfThe
photutils.psf.funcs.pymodule was renamedphotutils.psf.utils.py. Theprepare_psf_modelandget_grouped_psf_modelfunctions were also moved to this newutils.pymodule. [#777]
Bug Fixes#
photutils.apertureIf a single aperture is input as a list into the
aperture_photometryfunction, then the output columns will be calledaperture_sum_0andaperture_sum_err_0(if errors are used). Previously these column names did not have the trailing “_0”. [#779]
photutils.segmentationFixed a bug in the computation of
sky_bbox_ul,sky_bbox_lr,sky_bbox_urin theSourceCatalog. [#716]
Other Changes and Additions#
Updated background and detection functions that call
astropy.stats.SigmaCliporastropy.stats.sigma_clipped_statsto support both theiriters(for astropy < 3.1) andmaxiterskeywords. [#726]
0.5 (2018-08-06)#
General#
Versions of Python <3.5 are no longer supported. [#702, #703]
Versions of Numpy <1.10 are no longer supported. [#697, #703]
Versions of Pytest <3.1 are no longer supported. [#702]
pytest-astropyis now required to run the test suite. [#702, #703]The documentation build now uses the Sphinx configuration from
sphinx-astropyrather than fromastropy-helpers. [#702]
New Features#
photutils.aperturephotutils.centroidsphotutils.datasetsAdded a
load_simulated_hst_star_imagefunction to load a simulated HST WFC3/IR F160W image of stars. [#695]
photutils.detectionAdded a
centroid_funckeyword tofind_peaks. Thesubpixelskeyword is now deprecated. [#656]The
find_peaksfunction now returnsSkyCoordobjects in the table instead of separate RA and Dec. columns. [#656]The
find_peaksfunction now returns an empty Table and issues a warning when no peaks are found. [#668]
photutils.psfphotutils.segmentationAdded a
maskkeyword to thedetect_sourcesfunction. [#621]Renamed
SegmentationImagemaxattribute tomax_label.maxis deprecated. [#662]Added a
Segmentclass to hold the cutout image and properties of single labeled region (source segment). [#662]Deprecated the
SegmentationImageareamethod. Instead, use theareasattribute. [#662]Renamed
SegmentationImagedata_maskedattribute todata_ma.data_maskedis deprecated. [#662]Renamed
SegmentationImageis_sequentialattribute tois_consecutive.is_sequentialis deprecated. [#662]Renamed
SegmentationImagerelabel_sequentialattribute torelabel_consecutive.relabel_sequentialis deprecated. [#662]Added a
missing_labelsproperty toSegmentationImage. [#662]Added a
check_labelsmethod toSegmentationImage. Thecheck_labelmethod is deprecated. [#662]
photutils.utilsDeprecated the
cutout_footprintfunction. [#656]
Bug Fixes#
photutils.apertureFixed a bug where quantity inputs to the aperture classes would sometimes fail. [#693]
photutils.detectionphotutils.isophoteFixed a bug where isophote fitting would fail when the initial center was not specified for an image with an elongated aspect ratio. [#673]
photutils.segmentationFixed
deblend_sourceswhen other sources are in the neighborhood. [#617]Fixed
source_propertiesto handle the case where the data contain one or more NaNs. [#658]Fixed an issue with
deblend_sourceswhere sources were not deblended where the data contain one or more NaNs. [#658]Fixed the
SegmentationImageareasattribute to not include the zero (background) label. [#662]
Other Changes and Additions#
photutils.isophoteCorrected the units for isophote
sareain the documentation. [#657]
0.4 (2017-10-30)#
General#
Dropped python 3.3 support. [#542]
Dropped numpy 1.8 support. Minimal required version is now numpy 1.9. [#542]
Dropped support for astropy 1.x versions. Minimal required version is now astropy 2.0. [#575]
Dropped scipy 0.15 support. Minimal required version is now scipy 0.16. [#576]
Explicitly require six as dependency. [#601]
New Features#
photutils.apertureAdded
BoundingBoxclass, used when defining apertures. [#481]Apertures now have
__repr__and__str__defined. [#493]Improved plotting of annulus apertures using Bezier curves. [#494]
Rectangular apertures now use the true minimal bounding box. [#507]
Elliptical apertures now use the true minimal bounding box. [#508]
Added a
to_skymethod for pixel apertures. [#512]
photutils.backgroundMesh rejection now also applies to pixels that are masked during sigma clipping. [#544]
photutils.datasetsphotutils.isophotephotutils.segmentationAdded a
cmapmethod toSegmentationImageto generate a random matplotlib colormap. [#513]Added
sky_centroidandsky_centroid_icrssource properties. [#592]Added new source properties representing the sky coordinates of the bounding box corner vertices (
sky_bbox_ll,sky_bbox_ulsky_bbox_lr, andsky_bbox_ur). [#592]Added new
SourceCatalogclass to hold the list ofSourceProperties. [#608]The
properties_tablefunction is now deprecated. Use theSourceCatalog.to_table()method instead. [#608]
photutils.psf
API Changes#
photutils.aperturephotutils.backgroundThe
Background2Dkeywordsexclude_mesh_methodandexclude_mesh_percentilewere removed in favor of a single keyword calledexclude_percentile. [#544]Renamed
BiweightMidvarianceBackgroundRMStoBiweightScaleBackgroundRMS. [#547]Removed the
SigmaClipclass.astropy.stats.SigmaClipis a direct replacement. [#569]
photutils.datasetsThe
make_poisson_noisefunction was renamed toapply_poisson_noise. [#527]The
make_random_gaussiansfunction was renamed tomake_random_gaussians_table. The parameter ranges must now be input as a dictionary. [#527]The
make_gaussian_sourcesfunction was renamed tomake_gaussian_sources_image. [#527]The
make_random_modelsfunction was renamed tomake_random_models_table. [#527]The
make_model_sourcesfunction was renamed tomake_model_sources_image. [#527]The
unit,hdu,wcs, andwcsheaderkeywords inphotutils.datasetsfunctions were removed. [#527]'photutils-datasets'was added as an optionallocationin theget_pathfunction. This option is used as a fallback in case the'remote'location (astropy data server) fails. [#589]
photutils.detectionThe
daofindandirafstarfinderfunctions were removed. [#588]
photutils.psfIterativelySubtractedPSFPhotometryissues a “no sources detected” warning only on the first iteration, if applicable. [#566]
photutils.segmentationphotutils.utils
Bug Fixes#
photutils.segmentationphotutils.utilsAdded a check that
dataandbkg_errorhave the same units incalc_total_error. [#537]
0.3.2 (2017-03-31)#
General#
Fixed file permissions in the released source distribution.
0.3.1 (2017-03-02)#
General#
Bug Fixes#
photutils.backgroundphotutils.geometryFixed a bug in
circular_overlap_gridaffecting 32-bit machines that could cause errors circular aperture photometry. [#475]
photutils.psf
0.3 (2016-11-06)#
New Features#
photutils.apertureAdded new
originkeyword to apertureplotmethods. [#395]Added new
idcolumn toaperture_photometryoutput table. [#446]Added
__len__method for aperture classes. [#446]Added new
to_maskmethod toPixelApertureclasses. [#453]Added new
ApertureMaskclass to generate masks from apertures. [#453]Added new
mask_area()method toPixelApertureclasses. [#453]The
aperture_photometry()function now accepts a list of aperture objects. [#454]
photutils.backgroundAdded new
MeanBackground,MedianBackground,MMMBackground,SExtractorBackground,BiweightLocationBackground,StdBackgroundRMS,MADStdBackgroundRMS, andBiweightMidvarianceBackgroundRMSclasses. [#370]Added
axiskeyword to new background classes. [#392]Added new
removed_masked,meshpix_threshold, andedge_methodkeywords for the 2D background classes. [#355]Added new
std_blocksumfunction. [#355]Added new
SigmaClipclass. [#423]Added new
BkgZoomInterpolatorandBkgIDWInterpolatorclasses. [#437]
photutils.datasetsAdded
load_irac_psffunction. [#403]
photutils.detectionphotutils.psfphotutils.psf_matchAdded
create_matching_kernelandresize_psffunctions. Also, addedCosineBellWindow,HanningWindow,SplitCosineBellWindow,TopHatWindow, andTukeyWindowclasses. [#403]
photutils.segmentation
API Changes#
photutils.apertureRemoved the
effective_gainkeyword fromaperture_photometry. Users must now input the total error, which can be calculated using thecalc_total_errorfunction. [#368]aperture_photometrynow outputs aQTable. [#446]Renamed
source_idkeyword toindicesin the apertureplot()method. [#453]Added
maskandunitkeywords to aperturedo_photometry()methods. [#453]
photutils.backgroundFor the background classes, the
filter_shapekeyword was renamed tofilter_size. Thebackground_low_resandbackground_rms_low_resclass attributes were renamed tobackground_meshandbackground_rms_mesh, respectively. [#355, #437]The
Background2Dmethodandbackfunckeywords have been removed. In its place one can input callable objects via thesigma_clip,bkg_estimator, andbkgrms_estimatorkeywords. [#437]The interpolator to be used by the
Background2Dclass can be input as a callable object via the newinterpolatorkeyword. [#437]
photutils.centroidsCreated
photutils.centroidssubpackage, which contains thecentroid_com,centroid_1dg, andcentroid_2dgfunctions. These functions now return a two-element numpy ndarray. [#428]
photutils.detectionChanged finding algorithm implementations (
daofindandstarfind) from functional to object-oriented style. Deprecated old style. [#379]
photutils.morphologyphotutils.psfRemoved the
effective_gainkeyword frompsf_photometry. Users must now input the total error, which can be calculated using thecalc_total_errorfunction. [#368]
photutils.segmentationRemoved the
effective_gainkeyword fromSourcePropertiesandsource_properties. Users must now input the total error, which can be calculated using thecalc_total_errorfunction. [#368]
photutils.utilsRenamed
calculate_total_errortocalc_total_error. [#368]
Bug Fixes#
photutils.apertureFixed a bug in
aperture_photometryso that single-row output tables do not return a multidimensional column. [#446]
photutils.centroidsFixed a bug in
centroid_1dgandcentroid_2dgthat occurred when the input data contained invalid (NaN or inf) values. [#428]
photutils.segmentationFixed a bug in
SourcePropertieswhereerrorandbackgroundunits were sometimes dropped. [#441]
0.2.2 (2016-07-06)#
General#
Bug Fixes#
photutils.detectionphotutils.utilsFixed a bug in
pixel_to_icrs_coordswhere the incorrect pixel origin was being passed. [#348]
0.2.1 (2016-01-15)#
Bug Fixes#
0.2 (2015-12-31)#
General#
Photutils has the following requirements:
Python 2.7 or 3.3 or later
Numpy 1.6 or later
Astropy v1.0 or later
New Features#
photutils.detectionfind_peaksnow returns an Astropy Table containing the (x, y) positions and peak values. [#240]find_peakshas newmask,error,wcsandsubpixelprecision options. [#244]detect_sourceswill now issue a warning if the filter kernel is not normalized to 1. [#298]Added new
deblend_sourcesfunction, an experimental source deblender. [#314]
photutils.morphologyphotutils.segmentationphotutils.utils
API Changes#
photutils.segmentationThe
relabel_sequential,relabel_segments,remove_segments,remove_border_segments, andremove_masked_segmentsfunctions are nowSegmentationImagemethods (with slightly different names). [#306]The
SegmentPropertiesclass has been renamed toSourceProperties. Likewise, thesegment_propertiesfunction has been renamed tosource_properties. [#306]The
segment_sumandsegment_sum_errattributes have been renamed tosource_sumandsource_sum_err, respectively. [#306]The
background_atcentroidattribute has been renamed tobackground_at_centroid. [#306]
Bug Fixes#
photutils.apertureFixed an issue where
np.nanornp.infwere not properly masked. [#267]
photutils.geometryoverlap_area_triangle_unit_circlehandles correctly a corner case in some i386 systems where the area of the aperture was not computed correctly. [#242]rectangular_overlap_gridandelliptical_overlap_gridfixes to normalization of subsampled pixels. [#265]overlap_area_triangle_unit_circlehandles correctly the case where a line segment intersects at a triangle vertex. [#277]
Other Changes and Additions#
Updated astropy-helpers to v1.1. [#302]
0.1 (2014-12-22)#
Photutils 0.1 was released on December 22, 2014. It requires Astropy version 0.4 or later.