Releases: astropy/specreduce
Release list
v1.9.0
specreduce 1.9.0
Released 2026-05-06.
This release introduces new 2D tilt correction classes for measuring
and removing spectral line tilt, adds a specreduce-specific Glossary
to the documentation, and deprecates the legacy terminology page.
Highlights
Tilt correction (#303)
Two new modules give specreduce a complete 2D tilt-correction workflow:
-
specreduce.tilt_correction.TiltCorrectiondetects arc-lamp lines and
fits a 2D model of the spectral tilt across the detector. -
specreduce.tilt_solution.TiltSolutionstores the fitted model and
provides:- bidirectional coordinate transforms between the detector frame and the
tilt-corrected frame, - flux-conserving 2D resampling of the input image onto the rectified grid,
- export of the solution as a
gwcs.WCSobject via thegwcsproperty, - reconstruction from a previously exported GWCS object via
TiltSolution.from_gwcs().
- bidirectional coordinate transforms between the detector frame and the
The GWCS round-trip means tilt solutions can be persisted in standard
FITS/ASDF WCS containers and reloaded without specreduce-specific
serialisation.
Glossary (#304)
A new specreduce-specific Glossary consolidates the
terminology used across the package in a single reference page.
Other changes
- The legacy
docs/terms.rstterminology document is deprecated and will be
removed in a future release. A deprecation banner now points readers to the
new Glossary. (#304)
Compatibility
No new minimum-dependency bumps in this release. The specutils ≥ 2.0 / astropy
≥ 6.0 / scipy ≥ 1.14 / photutils ≥ 1.11 floors introduced in 1.8.0 still apply.
Full changelog
See CHANGES.rst for the complete list of changes.
v1.8.0
Specreduce 1.8
This release focuses on uncertainty propagation throughout the spectral reduction pipeline, ensuring that extracted spectra carry proper error estimates.
New Features
- Uncertainty propagation in background estimation — Background.bkg_image(), bkg_spectrum(), sub_image(), and sub_spectrum() now return results with proper uncertainties. When the input image has uncertainty, it is propagated using variance
formulas appropriate for the chosen statistic. When no uncertainty is provided, it is estimated from the flux values in the background region. (#297) - Uncertainty propagation in spectrum extraction — BoxcarExtract and HorneExtract now produce extracted spectra with proper uncertainties. (#295, #296)
- Sigma clipping in background estimation — New optional sigma parameter on Background for outlier rejection (default: 5.0; set to None to disable). (#297)
API Changes
- Migrated to specutils 2.0 — Removed the specreduce.compat module; all internal code now uses specutils.Spectrum directly. Users must update to specutils >= 2.0. (#299)
- Bumped minimum dependencies — specutils >= 2.0, astropy >= 6.0, scipy >= 1.14, photutils >= 1.11. (#299)
Other Changes
- Switched to sphinx_astropy.conf.v2 and revised documentation. (#275)
Installation
pip install specreduce==1.8.0
v1.7.0
New Features
- Added a new
specreduce.wavecal1d.WavelengthCalibration1Dclass for one-dimensional wavelength
calibration. The oldspecreduce.wavelength_calibration.WavelengthCalibration1Dis
deprecated and will be removed in v. 2.0. [#265] - Added a
disp_boundsargument totracing.FitTrace. The argument allows for adjusting the
dispersion-axis window from which the trace peaks are estimated. [#277]
v1.6.0
v1.5.1
1.5.1 (2024-03-08)
Bug Fixes
- Changed Horne extraction to behave as before when using an interpolated spatial profile
and not explicitly settingbkgrd_proftoNone. The changed default behavior in 1.5.0
caused problems in codes using specreduce.
v1.5.0
New Features
-
Added the
mask_treatmentparameter to Background, Trace, and Boxcar Extract
operations to handle non-finite data and boolean masks. Available options are
apply,ignore,propagate,zero_fill,nan_fill,apply_mask_only,
orapply_nan_only. [#216, #254] -
Modified
background.Background.bgk_spectrumto allow the user to select the statistic
used for background estimation betweenmedianoraverage. [#253] -
Modified
extract.BoxcarExtractto ignore non-finite pixels whenmask_treatmentis set
toapply; otherwise, non-finite values are propagated. Boxcar extraction is
now carried out as a weighed sum over the window. When no non-finite values are
present, the extracted spectra remain unchanged from the previous behaviour.
Bug Fixes
- Fixed Astropy v7.0 incompatibility bug in
tracing.FitTrace: changed to use
astropy.modeling.fitting.DogBoxLSQFitterwhen fitting a Gaussian peak model instead of
astropy.modeling.fitting.LevMarLSQFitterthat may be deprecated in the future. Also
changed to usefitting.LMLSQFitterinstead offitting.LevMarLSQFitterwhen fitting
a generic nonlinear trace model. [#229]
Other changes
- Changed
tracing.FitTraceto useastropy.modeling.fitting.LinearLSQFitter
if the trace model is linear.
New Contributors
- @hpparvi made their first contribution in #231
- @gibsongreen made their first contribution in #253
Full Changelog: v1.4.1...v1.5.0
v1.4.1
Bug Fixes
Fix bug where Background one sided / two sided was not correctly assigning units to data. [#221]
v1.4.0: parent 080b288fd29ec64810432bf9127c1a34a4f0ed68 (#220)
New Features
^^^^^^^^^^^^
-
Added 'interpolated_profile' option for HorneExtract. If The
interpolated_profileoption
is used, the image will be sampled in various wavelength bins (set by
n_bins_interpolated_profile), averaged in those bins, and samples are then
interpolated between (linear by default, interpolation degree can be set with
theinterp_degree_interpolated_profileparameter) to generate a continuously varying
spatial profile that can be evaluated at any wavelength. [#173] -
Added a function to measure a cross-dispersion profile. A profile can be
obtained at a single pixel/wavelength, or an average profile can be obtained
from a range/set of wavelengths. [#214]
API Changes
^^^^^^^^^^^
- Fit residuals exposed for wavelength calibration in
WavelengthCalibration1D.fit_residuals. [#446]
Bug Fixes
^^^^^^^^^
-
Output 1D spectra from Background no longer include NaNs. Output 1D
spectra from BoxcarExtract no longer include NaNs when none are present
in the extraction window. NaNs in the window will still propagate to
BoxcarExtract's extracted 1D spectrum. [#159] -
Backgrounds using median statistic properly ignore zero-weighted pixels.
[#159] -
HorneExtract now accepts 'None' as a vaild option for
bkgrd_prof. [#171] -
Fix in FitTrace to set fully-masked column bin peaks to NaN. Previously, for
peak_method='max' these were set to 0.0, and for peak_method='centroid' they
were set to the number of rows in the image, biasing the final fit to all bin
peaks. Previously for Gaussian, the entire fit failed. [#205, #206] -
Fixed input of
tracesinBackground. Added a condition to 'FlatTrace' that
trace position must be a positive number. [#211]
Other changes
^^^^^^^^^^^^^
- The following packages are now optional dependencies because they are not
required for core functionality:matplotlib,photutils,synphot.
To install them anyway, use the[all]specifier when you install specreduce; e.g.:
pip install specreduce[all][#202]
v1.3.0
New Features
- The new FitTrace class (see "API Changes" below) introduces the
ability to take a polynomial trace of an image [#128]
API Changes
-
Renamed KosmosTrace as FitTrace, a conglomerate class for traces that
are fit to images instead of predetermined [#128] -
The default number of bins for FitTrace is now its associated image's
number of dispersion pixels instead of 20. Its default peak_method is
now 'max' [#128] -
All operations now accept Spectrum1D and Quantity-type images. All
accepted image types are now processed internally as Spectrum1D objects
[#144, #154] -
All operations'
imageattributes are now coerced Spectrum1D
objects [#144, #154] -
HorneExtract can now handle non-flat traces [#148]
Bug Fixes
-
Fixed passing a single
Traceobject toBackground[#146] -
Moved away from creating image masks with numpy's
mask_invalid()
function after change to upstream API. This will make specreduce
be compatible with numpy 1.24 or later. [#155]
What's Changed
- BUG: fix passing single Trace object to Background by @kecnry in #146
- Introducing polynomial tracing by @ojustino in #128
- Better handled Spectrum1D images across classes by @ojustino in #144
- Add summary of capabilities/user stories to docs index page by @rosteen in #149
- Fix changelog formatting by @larrybradley in #150
- Introducing spectral extractions for non-flat traces by @bmorris3 in #148
- Update image handling in notebooks by @ojustino in #154
- Use simpler checks for invalid values by @ojustino in #155
- Prepare changelog for release v1.3.0 by @ojustino in #156
New Contributors
- @rosteen made their first contribution in #149
- @larrybradley made their first contribution in #150
- @bmorris3 made their first contribution in #148
Full Changelog: v1.2.0...v1.3.0
v1.2.0
New Features
Backgroundhas new methods for exposing the 1D spectrum of the background or
background-subtracted regions [#143]
Bug Fixes
- Improved errors/warnings when background region extends beyond bounds of image [#127]
- Fixed boxcar weighting bug that often resulted in peak pixels having weight
above 1 and erroneously triggered overlapping background errors [#125] - Fixed boxcar weighting to handle zero width and edge of image cases [#141]
What's Changed
- DOC: No need to automodapi the top-level package by @pllim in #135
- MNT: Remove dead code from APE 17 by @pllim in #136
- MNT: Remove version template by @pllim in #134
- logic to detect background regions extending beyond image limits by @kecnry in #127
- Found cause of background "overlap" error by @ojustino in #125
- Enable nitpicky mode for sphinx and get docs to build cleanly by @tepickering in #140
- basic quickstart examples for spectral extraction by @kecnry in #142
- Background.bkg_spectrum and sub_spectrum by @kecnry in #143
- Rewrite boxcar weights logic by @kecnry in #141
- Prepare changelog for release v1.2.0 by @ojustino in #145
Full Changelog: v1.1.0...v1.2.0