Full Changelog#
2.6.0 (unreleased)#
New Features#
Add
array-api-strict(on a non-default device) as a test backend, a CPU-only proxy for CuPy device behavior. [#942]Allow
ImageFileCollection.ccdsto override the collection’s FITS extension per call withccd_kwargs["hdu"]while preservingext=as a header filter. [#960]Combiner.sigma_clippingnow clips data in a non-NumPy array namespace with an implementation written in terms of the array API standard that reproducesastropy.stats.sigma_clip’s result up to floating-point rounding of the reductions, except for a slice an iteration empties (see the #1009 entry): a value lying exactly on a bound can be classified differently from astropy (NumPy data still use astropy);'median'/'mean'/'std'/'mad_std'use the namespace’s NaN-aware reductions or ccdproc’s fallbacks. [#1001]Combiner.sigma_clippingoutside NumPy now acceptsaxis=Noneand a tuple or list of axes, asastropy.stats.sigma_clipdoes on the NumPy path, and the reduction fallbacks inccdproc._nanfuncsgained the same axis forms; the None/tuple axis handling formerly in_mad_fallbackmoved into the shared_nanfuncs._setup, and a bool or otherwise non-integeraxisnow raisesTypeErrorrather thanNotImplementedError. [#1006]Combiner.sigma_clippingoutside NumPy now masks every value of a slice that an iteration empties, asastropy.stats.sigma_clipdoes from astropy 8.0.2; on earlier astropy the NumPy path leaves such a slice’s finite values unmasked. [#1009]block_reduce,block_averageandblock_replicatekeep non-NumPy input in its own array library and on its own device instead of coercing it to NumPy throughastropy.nddata.block_reducewith an explicitfunc=xp.meanpromotes integer and boolean input to a floating dtype, asblock_averagedoes, so that it gives NumPy’s result on every backend. [#1009]The local window filters used by
median_filter,cosmicray_median,background_deviation_filterandccdmaskno longer copy a non-NumPy array to the host: NumPy input still goes toscipy.ndimageunchanged, while every other array namespace is served by a new implementation written purely in terms of the array API standard. Part of the array API migration tracked in #971. [#1010]Off NumPy those filters reproduce
scipy.ndimageexactly on finite input, but cost O(k**2 log k**2) per pixel for a k-by-k window rather than ndimage’s O(k**2), and need a fully known shape, so a dask array with unknown chunk sizes must havecompute_chunk_sizes()called on it first. [#1010]Off NumPy those filters exclude NaNs from a window and rank among the values that remain, where
scipy.ndimagesorts them in with the values; results on data containing NaN therefore differ between NumPy and every other array library. [#1010]Off NumPy those filters implement only ndimage’s
'reflect'and'nearest'boundary modes, andmedian_filteraccepts onlysizeandmode, raisingTypeErrorfor any otherscipy.ndimageargument. [#1010]Off NumPy those filters promote integer and boolean input to a floating dtype, which
scipy.ndimagedoes not, and reject complex input and floating input narrower thanfloat32, whichscipy.ndimagerejects as well. [#1010]cosmicray_mediannow returns a floating result for integer input on every array library. Previously NumPy kept the input integer dtype, dask returned a float andarray-api-strictraised. [#1010]background_deviation_boxnow accepts a plain array-like such as a nested list, as its docstring has always promised. [#1010]The three operations that depend on a NumPy-only library –
wcs_project(reproject),subtract_overscanwith amodel(astropy.modeling) andcosmicray_lacosmic(astroscrappy) – now make that host round trip explicitly: they copy their input to NumPy on the host, run, and copy every array they return, data and mask alike, back to the array namespace and device of the input, so a non-NumPy caller never receives a NumPy array in its place. Each warns once per call site with the newccdproc.HostCopyWarning(a subclass ofAstropyUserWarning) when an array that is not already NumPy has to be copied to the host, including a non-NumPyinbkgorinvarpassed tocosmicray_lacosmicwith a NumPy image; when every array is NumPy, nothing is copied or warned about.combine(output_file=...)does not warn either: it copies the combined image to NumPy only to write the FITS file, and the image it returns stays in the input’s array namespace. On NumPy,float32data cleaned bycosmicray_lacosmicwith a NumPyfloat64pssl(such asnp.medianoffloat64data) now staysfloat32, as it already did for every other type ofpssl. Likewise,cosmicray_lacosmicwithgain_apply=Truenow returnsfloat32data for integer andfloat32input whatever the gain, as it already did for a gain of 1; previously any other gain promoted the data tofloat64. [#930, #933, #935, #1011, #1023]
Other Changes and Additions#
The
py313-strictCI job is now part of the regular CI matrix and fails CI on a test failure; the expected-failures carve-out and thestrict_status.ymlreporting workflow are retired. [#1005]Add triage tooling for array-API backend failures:
backend_xfail/backend_skipmarkers, an escape-site report (CCDPROC_TRIAGE_ESCAPES=1), and an escape logger (CCDPROC_LOG_ARRAY_ESCAPES=1). [#942]Add a
stricttox environment for running thearray-api-stricttest suite locally:tox -e strictreproduces the CIpy313-strictjob without having to name the interpreter. [#986]combineno longer accepts an array as itsarray_packageargument; pass the array namespace or module instead. [#997]subtract_overscan,subtract_bias,subtract_dark,flat_correct,ccd_process,cosmicray_median,Combinerandcombinenow raiseTypeErrorwhen their images come from different array libraries andValueErrorwhen they are on different devices. Previously some of these calls silently converted one of the images.combinegiven a mix of file names andCCDDataimages in memory reads the files into the array library of the images in memory. [#1025, #1028]The minimum supported numpy is now 2.0 (
normalize_axis_tupleis imported from its numpy 2 location with no 1.26 fallback), which raises the minimum astropy to 6.1, reproject to 0.14 and astroscrappy to 1.2, the oldest releases that work with numpy 2. [#1000]The minimum supported versions now follow SPEC 0: Python 3.12, numpy 2.2, scipy 1.15 and, applying the same two-year window, astropy 7.0. The
oldestdepsand oldest-numpy tox environments now constrain the package install to their pins; previously the oldest-numpy environment was upgraded to the newest numpy by a test dependency (jax). [#1031]
Bug Fixes#
Masks set by
ccdprocfunctions, except the deprecatedrebin, now follow the array library and device of the data, with their shape checked; a mask that cannot, such as a CuPy mask with NumPy data, raises. For masked jax or dask images,create_deviation,subtract_overscanandccd_processreturned a NumPy mask, and several others used the default device. [#1024]ccd_processagain raisesValueErrorfor abad_pixel_maskwhose shape differs from the data’s, as it did in 2.5.1. [#1027]wcs_projectno longer returns a NumPy-backedCCDDatafor non-NumPy input: the reprojected data and mask are converted back to the array namespace and device of the input image. [#930, #1011]wcs_project,subtract_overscanwith amodelandcosmicray_lacosmicnow return floating data in its input dtype rather than in the dtype of the NumPy-only library that does the work. [#1023]cosmicray_lacosmicnow accepts afloat64invar, which it passes to astroscrappy asfloat32instead of letting astroscrappy raiseValueError. [#1032]flat_correctnow checks the flat’s mask withxp.anyinstead of themask.any()method, which arrays of spec-only array-API namespaces do not have. [#1005]Exclude masked and clipped pixels, and their weights, when computing weighted average combinations. [#952]
cosmicray_mediannow honors the mask of aCCDDataor masked-array input: masked pixels are never flagged as cosmic rays, no longer seedgboxgrowth into their neighbors, are returned unchanged, and are excluded from the noise estimate whenerror_imageis not given. Previously the mask of a masked array was silently dropped by the array conversion. [#932]Add a NaN-aware median written purely in terms of the array API standard and use it in
Combiner.median_combinewhen the selected array namespace has nonanmedian, instead of raisingRuntimeError. [#906]Add NaN-aware sum, mean and standard deviation written purely in terms of the array API standard and use them in
Combiner.average_combineandCombiner.sum_combinewhen the selected array namespace has nonansum/nanmean/nanstd, instead of raisingRuntimeError. [#986]Make the
Combinercombination internals array-API compatible and size images formem_limitfrom the element count and dtype width instead of the non-standardnbytes. [#988]Make
flat_correctandccdmaskuse functional array updates so they support immutable array-API backends. [#956]Build the
Combinerdata and mask arrays withxp.stackinstead of passing a nested list of arrays toxp.asarray, and keep the mask and scaling arrays in the namespace and on the device of the input data.Combiner.scalingis now cast to the dtype of the data, accepts an array-API array without__len__, and is reshaped to exactly one broadcast axis per image dimension, so a(N, 1)scaling array or a callable returning a one-element array no longer adds a spurious trailing dimension to the combined image. [#965]Fix the fallback percentile calculation for array namespaces that do not provide
percentile. [#957]Cast the boolean mask to the data dtype in
create_deviationso thatdisregard_nan=Trueworks with strict array-API backends. [#968]Keep
VarianceUncertaintyandInverseVariancepropagation in the array namespace of the data instead of converting to NumPy. [#962]Make array-API escape logging thread-safe so concurrent worker escapes are not missed. [#955]
Create the dark scale factor in
subtract_dark(scale=True)on the same device as the master dark, and stop reporting non-unit errors from the subtraction as unit mismatches. [#966]Remove stale comments in the
Combiner*_combinemethods and rebind the uncertainty instead of modifying it in place, so the methods work with immutable array-API backends. [#980]Fix dtype conversion in
Combiner._weighted_sumto use the array-API namespace formxp.astype(weights, xp.float64)instead of the deprecated string-based.astype("float64"). This resolves theDeprecationWarningthat was being promoted to a test failure in the JAX CI job. [#924]Return plain
CCDDataobjects from array-API wrapper-copy paths, and public uncertainty types from arithmetic paths. [#953]Propagate gain correction to CCDData uncertainties in
cosmicray_lacosmic, and preserve data and uncertainty units when gain correction is disabled. [#958, #729]Use Bottleneck combination functions only with NumPy arrays, preserving the selected Array API namespace for other backends. [#904, #959]
Make
rebinbuild its index array withxp.astypeon the input array’s device instead of the NumPy-only.astypemethod, so it works with array-API backends such asarray-api-strict. [#967]Keep
Combiner.clip_extremaindex arithmetic in the selected array namespace so GPU-backed arrays do not require an implicit conversion to NumPy. [#954]Fix
background_deviation_boxdiscarding the result of the functional array update, which left the output at the global standard deviation on immutable array-API backends such as JAX. [#963]Add a
medianfallback written purely in terms of the array API standard, built on the existing NaN-awarenanmedian, and use it insubtract_overscanwhen the selected array namespace has nomedian, instead of raisingAttributeError. [#989]Keep the mask of the result of
Combiner.average_combine,median_combine,sum_combineandcombinein the array namespace and on the device of the data instead of converting it to NumPy. [#992]Fix
gain_correctandflat_correctfor images on a non-default device: put the gain and flat normalization on the device of the data, cast an integer gain to float, and keep the uncertainty propagation for multiplication and division out of NumPy. [#993]Use the array namespace’s
boolfor theccd_processbad-pixel mask, cast the mask intransform_imageto the data dtype before transforming it, and convert FITS data to native byte order before handing it to a non-NumPy array namespace incombineandImageFileCollection. [#995]Compute the
Combiner.clip_extremamask with a rank comparison instead of scattering into the mask through per-pixel integer indices, which the array API standard does not support. [#994]Accept a plain module such as
numpyordask.arrayasarray_packageincombine, normalising it to its array-api-compat namespace. [#997]Keep the uncertainty propagation for correlated addition and subtraction through
_CCDDataWrapperForArrayAPIin the array namespace instead of falling back to NumPy. [#997]combinewritesoutput_filefrom a NumPy copy of the result, so a result in a non-NumPy array namespace can be written to FITS and is returned unchanged in its namespace. [#999]Combinerandcombinemap adtypegiven as a builtin type, string or NumPy dtype (e.g.dtype=int) to the array namespace’s own dtype instead of passing it through unchanged. [#999]Size the overscan model fit in
subtract_overscanwithshapeinstead oflen, which the array API standard does not provide. [#999]Compute
sigma_func(themedian_combineuncertainty) with a median absolute deviation written purely in terms of the array API when the array namespace is not numpy, instead of converting the data to numpy throughastropy.stats.median_absolute_deviation. Numpy input still uses astropy. [#1000]sigma_funcnow always excludes the masked pixels of a maskedCCDData. Previously the mask was only honored on numpy for small arrays with a single integeraxisandignore_nan=True, and, when bottleneck is installed, not for float64 data at all. [#1000]Passing
axis,copyormaxiterstoCombiner.sigma_clippingno longer raisesTypeError. [#1001]Correct the
Combiner.sigma_clippingdocstring, which said the defaultfuncwas'median'; the runtime default has always been'mean'. [#1001]combineon array-api-strict no longer raisesmismatched dtypeswhen the first image’s uncertainty dtype differs fromdtype. [#1028]
2.5.1 (2025-07-05)#
Other Changes and Additions#
2.5.0 (2025-07-03)#
New Features#
Other Changes and Additions#
Bug Fixes#
2.4.3 (2025-01-15)#
New Features#
Other Changes and Additions#
There was extensive modernization of the package infrastructure that should not affect users.
Bug Fixes#
Fixes incorrect parameter passed to helper in
cosmicray_lacosmic. [#796]
2.4.2 (2024-05-03)#
New Features#
Other Changes and Additions#
Make ccdproc compatible with numpy 2. [#824]
2.4.1 (2023-05-30)#
New Features#
Other Changes and Additions#
Bug Fixes#
2.4.0 (2022-11-16)#
New Features#
Other Changes and Additions#
The sigma clipping option in the image combiner now always uses the astropy sigma clipping function, and supports specifying the functions to use for estimating the center and deviation values as strings for common cases (which significantly improves performance). [#794]
The image combiner now allows the optional overwrite of the optional output FITS file. [#797]
Bug Fixes#
2.3.1 (2022-05-09)#
New Features#
Other Changes and Additions#
Bug Fixes#
In python 3.7 the
versionmethod frompackagingmust be imported directly. [#786]
2.3.0 (2021-12-21)#
Other Changes and Additions#
The
rebinfunction has been more clearly marked with a deprecation milestone. It will be removed in v3. [#780]
Bug Fixes#
2.2.0 (2021-05-24)#
New Features#
Other Changes and Additions#
Bug Fixes#
When filtering an
ImageFileCollectionby keyword value, and not explicitly using a regex search pattern (regex_match=True), escape all special characters in the keyword value for a successful search. [#770]Return mask and uncertainty from
combineeven if input images have no mask or uncertainty. [#775]
2.1.1 (2021-03-15)#
New Features#
Improve integration of
ImageFileCollectionwith image combination and document that integration [#762]
Other Changes and Additions#
Bug Fixes#
test_image_collection.pyin the test suite no longer produces permanent files on disk and cleans up after itself. [#738]Change
Combinerto allow accepting either a list or a generator [#757]ImageFileCollectionnow correctly returns an empty collection when an existing collection is filtered restrictively enough to remove all files. [#750]Logging now preserves all of the arguments when the keyword argument names are not used. [#756]
2.1.0 (2019-12-24)#
New Features#
Other Changes and Additions#
Remove astropy_helpers from the package infrastructure, which also changes how the tests are run and how the documentation is built. [#717]
Bug Fixes#
2.0.1 (2019-09-05)#
New Features#
Other Changes and Additions#
Bug Fixes#
2.0.0 (2019-09-02)#
New Features#
Allow initialization of
ImageFileCollectionfrom a list of files with no location set. [#374, #661, #680]Allow identification of FITS files in
ImageFileCollectionbased on content of the files instead of file name extension. [#620, #680]Add option to use regular expression matching when filtering items in
ImageFileCollection. [#480, #595, #682]Added an option to disregard negative values passed to
create_deviationand assume the error is represented by the read noise [#688]Add
filtermethod toImageFileCollectionthat creates a new collection by filtering based on header keywords. [#596, #690]
Other Changes and Additions#
Dropped support for Python 2.x and Astropy 1.x.
Removed deprecated property
summary_infoofImageFileCollection.Improved handling of large flags in the
bitfieldmodule. [#610, #611]Improved the performance of several
ImageFileCollectionmethods. [#599]Added support for .fz,.bz2, .Z and .zip file formats in
ImageFileCollection. [#623, #644]Modified weights function to also accept 1D array in
Combiner. [#634, #670]Added warning that
transform_imagedoes not apply the transformation to the WCS [#684]When creating a new object in
wcs_transform, WCS keywords in the header are removed so that they are only stored in the WCS object [#685]Improved warning for negative values in the array passed to
create_deviation[#688]Removed support for initializing
ImageFileCollectionfrom a table instead of files. [#680]More consistent typing of
ImageFileCollection.summarywhen the collection is empty. [#601, #680]
Bug Fixes#
Function
median_combinenow correctly calculates the uncertainty for maskedCCDData. [#608]Function
combineavoids keeping files open unnecessarily. [#629, #630]Function
combinemore accurately estimates memory use when deciding how to chunk files. [#638, #642]Raise
ValueErrorerror insubtract_darkfor when the errors have different shapes [#674, #677]Fix problem with column dtypes when initializing
ImageFileCollectionfrom a list of file names. [#662, #680]
1.3.0 (2017-11-1)#
New Features#
Added ext parameter and property to ImageFileCollection to specify the FITS extension. [#463]
Add keywords.deleter method to ImageFileCollection. [#474]
Added
glob_includeandglob_excludeparameter toImageFileCollection. [#484]Add
bitfield_to_boolean_maskfunction to convert abitfieldto a boolean mask (following the numpy conventions). [#460]Added
gain_correctedoption in ccd_process so that calibration files do not need to previously been gain corrected. [#491]Add a new
wcs_relaxargument toCCDData.to_header()that is passed through to theWCSmethod of the same name to allow more flexible handing of headers with SIP distortion. [#501]combinenow acceptsnumpy.ndarrayas the inputimg_list. [#493, #503]Add
norm_valueargument toflat_correctthat allows the normalization of the flat frame to be manually specified. [#584, #577]
Other Changes and Additions#
removed ability to set unit of CCDData to None. [#451]
deprecated
summary_infoproperty ofImageFileCollectionnow raises a deprecation warning. [#486]Logging will include the abbreviation even if the
metaattribute of the processedCCDDataisn’t afits.Header. [#528]The
CCDDataclass and the functionsfits_ccddata_readerandfits_ccddata_writerwill be imported fromastropy.nddataif astropy >= 2.0 is installed (instead of the one defined inccdproc). [#528]Building the documentation requires astropy >= 2.0. [#528]
When reading a
CCDDatafrom a file the WCS-related keywords are removed from the header. [#568]The
info_fileargument forImageFileCollectionis now deprecated. [#585]
Bug Fixes#
ImageFileCollectionnow handles Headers with duplicated keywords (other thanCOMMENTandHISTORY) by ignoring all but the first. [#467]The
ccdmethod ofImageFileCollectionwill raise anNotImplementedErrorin case the parameteroverwrite=Trueorclobber=Trueis used instead of silently ignoring the parameter. [#527]The
sortmethod ofImageFileCollectionnow requires an explicitly givenkeysargument. [#534]Fixed a problem with
CCDData.readwhen the extension wasn’t given and the primary HDU contained nodatabut another HDU did. In that case the header were not correctly combined. [#541]Suppress errors during WCS creation in CCDData.read(). [#552]
The generator methods in
ImageFileCollectionnow don’t leave open file handles in case the iterator wasn’t advanced or an exception was raised either inside the method itself or during the loop. [#553]Allow non-string columns when filtering an
ImageFileCollectionwith a string value. [#567]
1.2.0 (2016-12-13)#
ccdproc has now the following additional dependency:
scikit-image.
New Features#
Add an optional attribute named
filenamestoImageFileCollection, so that users can pass a list of FITS files to the collection. [#374, #403]Added
block_replicate,block_reduceandblock_averagefunctions. [#402]Added
median_filterfunction. [#420]combinenow takes an additionalcombine_uncertainty_functionargument which is passed asuncertainty_funcparameter toCombiner.median_combineorCombiner.average_combine. [#416]
Other Changes and Additions#
Bug Fixes#
The default dtype of the
combine-result doesn’t depend on the dtype of the first CCDData anymore. This also corrects the memory consumption calculation. [#391, #392]ccd_processnow copies the meta of the input when subtracting the master bias. [#404]Fixed
combinewithCCDDataobjects usingStdDevUncertaintyas uncertainty. [#416, #424]ccdsgenerator fromImageFileCollectionnow uses the full path to the file when callingfits_ccddata_reader. [#421 #422]
1.1.0 (2016-08-01)#
New Features#
Other Changes and Additions#
cosmicray_lacosmicdefaultsatlevelchanged from 65536 to 65535. [#347]Auto-identify files with extension
ftsas FITS files. [#355, #364]Raise more explicit exception if unit of uncalibrated image and master do not match in
subtract_biasorsubtract_dark. [#361, #366]Updated the
Combinerclass so that it could process images with >2 dimensions. [#340, #375]
Bug Fixes#
1.0.1 (2016-03-15)#
The 1.0.1 release was a release to fix some minor packaging issues.
1.0.0 (2016-03-15)#
General#
ccdproc has now the following requirements:
Python 2.7 or 3.4 or later.
astropy 1.0 or later
numpy 1.9 or later
scipy
astroscrappy
reproject
New Features#
Add a WCS setter for
CCDData. [#256]Allow user to set the function used for uncertainty calculation in
average_combineandmedian_combine. [#258]Add a new keyword to ImageFileCollection.files_filtered to return the full path to a file [#275]
Added ccd_process for handling multiple steps. [#211]
CCDData.write now writes multi-extension-FITS files. The mask and uncertainty are saved as extensions if these attributes were set. The name of the extensions can be altered with the parameters
hdu_mask(default extension name'MASK') andhdu_uncertainty(default'UNCERT'). CCDData.read can read these files and has the same optional parameters. [#302]
Other Changes and Additions#
Issue warning if there are no FITS images in an
ImageFileCollection. [#246]The overscan_axis argument in subtract_overscan can now be set to None, to let subtract_overscan provide a best guess for the axis. [#263]
Add support for wildcard and reversed FITS style slicing. [#265]
When reading a FITS file with CCDData.read, if no data exists in the primary hdu, the resultant header object is a combination of the header information in the primary hdu and the first hdu with data. [#271]
Changed cosmicray_lacosmic to use astroscrappy for cleaning cosmic rays. [#272]
CCDData arithmetic with number/Quantity now preserves any existing WCS. [#278]
Update astropy_helpers to 1.1.1. [#287]
Drop support for Python 2.6. [#300]
The
add_keywordparameter now has a default ofTrue, to be more explicit. [#310]Return name of file instead of full path in
ImageFileCollectiongenerators. [#315]
Bug Fixes#
Adding/Subtracting a CCDData instance with a Quantity with a different unit produced wrong results. [#291]
The uncertainty resulting when combining CCDData will be divided by the square root of the number of combined pixel [#309]
Improve documentation for read/write methods on
CCDData[#320]Add correct path separator when returning full path from
ImageFileCollection.files_filtered. [#325]
0.3.3 (2015-10-24)#
New Features#
add a
sortmethod to ImageFileCollection [#274]
Other Changes and Additions#
Bug Fixes#
0.3.2 (never released)#
There was no 0.3.2 release because of a packaging error.
0.3.1 (2015-05-12)#
New Features#
Add CCDData generator for ImageCollection [#405]
Other Changes and Additions#
Bug Fixes#
0.3.0 (2015-03-17)#
New Features#
When reading in a FITS file, the extension to be used can be specified. If it is not and there is no data in the primary extension, the first extension with data will be used.
Set wcs attribute when reading from a FITS file that contains WCS keywords and write WCS keywords to header when converting to an HDU. [#195]
Other Changes and Additions#
Updated CCDData to use the new version of NDDATA in astropy v1.0. This breaks backward compatibility with earlier versions of astropy.
Bug Fixes#
Ensure
dtypeof combined images matches thedtypeof theCombinerobject. [#189]
0.2.2 (2014-11-05)#
New Features#
Add dtype argument to
ccdproc.Combinerto help control memory use [#178]
Other Changes and Additions#
Added Changes to the docs [#183]
Bug Fixes#
Allow the unit string “adu” to be upper or lower case in a FITS header [#182]
0.2.1 (2014-09-09)#
New Features#
Add a unit directly from BUNIT if it is available in the FITS header [#169]
Other Changes and Additions#
Relaxed the requirements on what the metadata must be. It can be anything dict-like, e.g. an astropy.io.fits.Header, a python dict, an OrderedDict or some custom object created by the user. [#167]
Bug Fixes#
Fixed a new-style formating issue in the logging [#170]
0.2 (2014-07-28)#
Initial release.