REVIEW
$\texttt{raccoon}$: A Python package for removing wiggle artifacts in the JWST NIRSpec integral field spectroscopy
Instrumentation and Methods for Astrophysics · Submitted 17 Jul 2025 · 2 references
Pith's verdict: A plausible, clearly written software paper for a real JWST NIRSpec artifact, but the central empirical premise—that aperture sums are wiggle-free—is untested and needs quantitative validation before the claims carry weight.
T0 · AI review
Why Pith says this
Highlight any text to comment on it.
Referee report
The paper
The paper claims
raccoon claims that a NIRSpec spaxel spectrum is a chirp wiggle multiplied by a smooth template, and that fitting both at once and dividing out the wiggle restores the underlying spectrum.
The reading
What carries the argument
The central object is the product model $M(\lambda) = W(\lambda) T(\lambda)$: a chirp wiggle $W$ times a wiggle-free template $T$. The wiggle is written as $W(\lambda) = 1 + A(\lambda)[\sin \phi + a_1 \sin^2\phi + a_2 \sin(3\phi)]$ with phase $\phi = \lambda k(\lambda) + \phi_0$, allowing wavelength-dependent amplitude and wavenumber plus asymmetric or sharpened peak shapes. The template is built as $T(\lambda) = c_1 C(\lambda) + c_2 S(\lambda) + c_3 \lambda^b + \sum_{n=0}^N p_n \lambda^n$, where $C$ is the circular-aperture-summed spectrum and $S$ an optional shell sum, making the template empirical and local. B-splines for $A(\lambda)$ and $k(\lambda)$, the linear coefficients, and the shape parameters are all solved by one $\chi^2$ minimization across the full spectrum, after which the fitted $W$ is divided out of the data.
Extended reading notes
Core claim
The central claim is that the artifact obeys the multiplicative model $D(\lambda) = W(\lambda) T(\lambda)$ (Eq. 2), with $W(\lambda)$ a parametrized chirp (Eq. 1) whose amplitude and wavenumber are smooth B-spline functions of wavelength, and $T(\lambda)$ a linear-template combination of the circular-aperture-summed spectrum, an optional shell-summed spectrum, and a power-law-plus-polynomial continuum. Fitting $M(\lambda) = W(\lambda) T(\lambda)$ to the observed single-spaxel spectrum by minimizing $\chi^2$ over the whole wavelength range yields the wiggle signal in one step, and dividing the data by the best-fit $W$ removes the artifacts while propagating the associated uncertainties. The paper argues that this simultaneous fit preserves wiggle signal that earlier subtract-then-fit methods lose, and that a multiplicative correction is physically motivated because the wiggles act multiplicatively on the spectrum.
Load-bearing premise
The argument depends on the aperture-summed spectrum being essentially free of wiggles and representative of the true single-spaxel spectrum; if the wiggles do not cancel in the sum, or if the true spectrum varies within the aperture in a way the linear template cannot capture, the corrected spectrum will carry artifacts of that mismatch.
Editorial extensions
If this is right
- Corrected spaxel-level spectra retain the native NIRSpec spatial resolution instead of requiring large-aperture sums, so kinematics and line measurements can be made at the finest sampling the instrument provides.
- Because the fit covers the entire wavelength range in one step, masked regions or gaps from outlier rejection do not break the wiggle estimate.
- A user-set detection threshold means corrections are applied only to spaxels with significant wiggles, leaving already clean spectra untouched.
- The same chirp-plus-template machinery can incorporate a shell spectrum to track line-shape changes across a galaxy, extending the correction to kinematically varying sources.
Reading between the lines
- If the multiplicative chirp model generalizes, the same approach could be adapted to other undersampled integral-field or dithered instruments, since resampling artifacts commonly act as wavelength-dependent multiplicative ripples.
- A testable prediction is that injecting a synthetic chirp of known amplitude and phase into a wiggle-free spaxel spectrum should be recovered by raccoon, and the corrected output should match the original spectrum within noise.
- When the aperture-summed template fails to cancel wiggles for compact or highly variable sources, the correction would imprint template mismatch; users could detect this by comparing corrected spectra produced from two different aperture radii.
- The claimed advantage over subtract-then-fit methods implies that the extracted wiggle depends on the template family, so systematic checks across template choices would quantify the remaining model-dependent uncertainty.
Original abstract
$\texttt{raccoon}$ is a Python package for removing resampling noise - commonly referred to as "wiggles'' - from spaxel-level spectra in datacubes obtained from the JWST Near Infrared Spectrograph's (NIRSpec) integral field spectroscopy (IFS) mode. These wiggles arise as artifacts during resampling of the 2D raw data into 3D datacubes, due to the point spread function (PSF) being undersampled. The standard JWST data reduction pipeline does not correct for this noise. The wiggle artifacts can significantly degrade the scientific usability of the data, particularly at the spaxel level, undermining the exquisite spatial resolution of NIRSpec. $\texttt{raccoon}$ provides an empirical correction by modeling and removing these artifacts, thereby restoring the fidelity of the extracted spectra. $\texttt{raccoon}$ forward-models the wiggles as a chirp function impacting one or more template spectra that are directly fit to the original data across the entire wavelength range. The best-fit wiggle model is then used to clean the data while propagating the associated uncertainties.
The compiled record
The paper's own sentences, arranged, kept beside the review and separate from it. Each label is drawn from a closed vocabulary; the number beside it is the probability the classifier gave that label. Numbers in the tables are the authors', checked by code. No sentence in this record was written by a model.
The abstract, sentence by sentence
$\texttt{raccoon}$ is a Python package for removing resampling noise - commonly referred to as "wiggles'' - from spaxel-level spectra in datacubes obtained from the JWST Near Infrared Spectrograph's (NIRSpec) integral field spectroscopy (IFS) mode. These wiggles arise as artifacts during resampling of the 2D raw data into 3D datacubes, due to the point spread function (PSF) being undersampled. The standard JWST data reduction pipeline does not correct for this noise. The wiggle artifacts can significantly degrade the scientific usability of the data, particularly at the spaxel level, undermining the exquisite spatial resolution of NIRSpec. $\texttt{raccoon}$ provides an empirical correction by modeling and removing these artifacts, thereby restoring the fidelity of the extracted spectra. $\texttt{raccoon}$ forward-models the wiggles as a chirp function impacting one or more template spectra that are directly fit to the original data across the entire wavelength range. The best-fit wiggle model is then used to clean the data while propagating the associated uncertainties.
background contribution method result interpretation main claim
| # | sentence | role | the authors' own work | states the main conclusion | strength |
|---|---|---|---|---|---|
| s0 | $\texttt{raccoon}$ is a Python package for removing resampling noise - commonly referred to as "wiggles'' - from spaxel-level spectra in datacubes obtained from the JWST Near Infrared Spectrograph's (NIRSpec) integral field spectroscopy (IFS) mode. | contribution 1.00 | 0.49 | 0.22 | asserted 1.00 |
| s1 | These wiggles arise as artifacts during resampling of the 2D raw data into 3D datacubes, due to the point spread function (PSF) being undersampled. | background 1.00 | 0.15 | 0.04 | asserted 1.00 |
| s2 | The standard JWST data reduction pipeline does not correct for this noise. | gap 0.77 | 0.10 | 0.04 | asserted 1.00 |
| s3 | The wiggle artifacts can significantly degrade the scientific usability of the data, particularly at the spaxel level, undermining the exquisite spatial resolution of NIRSpec. | background 0.93 | 0.18 | 0.09 | asserted 0.70 |
| s4 | $\texttt{raccoon}$ provides an empirical correction by modeling and removing these artifacts, thereby restoring the fidelity of the extracted spectra. | contribution 0.96 | 0.81 | 0.53 | asserted 1.00 |
| s5 | $\texttt{raccoon}$ forward-models the wiggles as a chirp function impacting one or more template spectra that are directly fit to the original data across the entire wavelength range. | method 1.00 | 0.80 | 0.12 | asserted 1.00 |
| s6 | The best-fit wiggle model is then used to clean the data while propagating the associated uncertainties. | method 1.00 | 0.78 | 0.14 | asserted 1.00 |
What was examined, and what was not
- arXiv listing abstract v1
- full text
- figures and tables
- references and citing sentences
- relations to other papers
- P abstract
- S sections
- T body sentences
- C citations
- R cross-paper relations
Figures
Figures reproduced from arXiv:2507.13341 by the authors.
References
How the literature uses it
1 arXiv paper cite this in 2 sentences
Papers citing it · 1 sentence without a confident label
Contests it 1 paper
-
Several public tools have been developed to remove these artifacts [ref] by forward modeling them with sinusoidal functions; however, these methods do not perform effectively for our data, likely due to the faint and noisy nature of the spectra, which makes analytical modeling difficult.
Spatially Resolved Physical Properties of Young Star Clusters and Star-forming Clumps in the Brightest z>6 Galaxy, the Strongly Lensed Cosmic Spear at z=6.2 · Generating Spectrophotometric Data Cube · contest 0.85
Discussion
Disagree with the review, or know something it missed? Leave a comment, highlight any passage above to comment on it, or challenge this review formally.