NIRSpec IFU Known Issues

Known issues specific to NIRSpec IFU data processing in the JWST Science Calibration Pipeline are described in this article. This is not intended as a how-to guide or as full documentation of individual pipeline steps, but rather to give a scientist-level overview of issues that users should be aware of for their science. 

On this page


Specific artifacts are described in the Artifacts section below. Guidance on using the pipeline data products is provided in the Pipeline Notes section along with a summary of some common issues and workarounds in the summary section.

Please also refer to NIRSpec IFU Calibration Status for an overview of the current astrometric, photometric, and wavelength calibration accuracy of NIRSpec IFU data products.



Artifacts

Cube building resampling artifacts

The NIRSpec IFU PSF is spatially under-sampled by the NIRSpec detector pixels, which can lead to pixel aliasing effects when resampling observed data during cube building.  When in the vicinity of unresolved point sources this results in "ringing" or oscillations in the spectra of individual spaxels or in the spectra extracted from regions that are small relative to the FWHM of the NIRSpec PSF (Law et al. 2023).  An example of this is shown in Figure 1 (Law & Clarke 2026). As of JWST pipeline v2.0.0 (and later versions) there is an optional pipeline step, the adaptive_trace_model step, that can be used to greatly reduce these resampling artifacts in IFU cube data as can be seen in the right-hand of Figure 1. The NIRSpec IFU pipeline notebook shows how this step can be run as part of pipeline processing.  

More information about these undersampling effects and how to correct them can be found on the Resampling Artifacts page.  The adaptive_trace_model step is described in more detail in the JWST pipeline ReadTheDocs and in Law & Clarke (2026)


Figure 1. An example of cube building resampling artifacts and correcting them with adaptive trace modeling.

Click on the figure for a larger view

Normalized JWST/NIRSpec G395H/F290LP spectra of standard star J1743045 (spectral type A5 IIIm) measured from an IFU cube (modified from Figure 6 in Law & Clarke 2026).  The solid black lines show the aperture-integrated spectrum of the source in the cube, while the colored lines show spectra from individual spaxels in increasing brightness from purple (top) to blue (second to the bottom).  (Left) spectra extracted from a standard IFU cube, demonstrating resampling artifacts that appear as oscillations in the spectra that change from spaxel-to-spaxel.  (Right) spectra extracted from an IFU cube that has been built using the adaptive_trace_model step (ATM) to oversample 2-D detector data prior to cube building.  Use of this step can greatly reduce the oscillating resampling artifacts.


Pipeline notes

The topics below affect imaging observations and reflect common questions about how to improve the quality of the data from the pipeline. For issues that affect all observing modes, see NIRSpec Known Issues.

Cube building

The cube_build step of the pipeline combines the individual 2-D IFU slice images and creates a 3-D spectral cube. The IFU cubes are, by default, constructed with north pointing up and east to the left. Cube building can be done using either the default 3-D drizzle algorithm, or alternatively, the Shepard's method of weighting. The current pipeline default setting is the 3-D drizzle algorithm.

  • To use 3-D drizzle, set weighting = drizzle
  • To use Shepard's method with exponential or linear weighting, set weighting = emsm or msm  

It is sometimes useful to build a cube in the detector frame (for example, when analyzing the point spread function), rather than in sky coordinates. To build the cube in detector coordinates:

Set coord_system = ifualign

The default cube building uses a linear wavelength sampling. The NIRSpec PRISM in particular has a non-linear wavelength solution, however, so the linear sampling oversample some wavelengths and can lead to strong resampling artifacts in the PRISM cubes. As of jwst pipeline version v2.0.0 (and onwards) NIRSpec IFU cubes can be built with the option linear_wave = False to use a more natural, non-linear wavelength sampling.  The examples below show how to access the wavelength arrays of non-linearly sampled cubes:

cube_file = 'my_nonlinear_cube_s3d.fits'

# when importing the cube using astropy.io fits:
from astropy.io import fits
cube = fits.open(cube_file)
wavelength_array = cube['WCS-TABLE'].data['wavelength'][0]
 
# or when opening the cube using jwst datamodels:
from jwst import datamodels
cube = datamodels.open(cube_file)
wavelength_array = cube.wavetable['wavelength'][0]

Correlated 1/f read noise

The effects of 1/f noise for NIRSpec MOS are shown in the IFU 1/f noise cleaning notebook, which also demonstrates the use of the NSClean algorithm to remove most of this effect. NSClean is implemented in the pipeline versions from v1.13.4 through v1.20.2 as a non-default option. As of jwst pipeline v2.0.0 (and later versions) there are multiple 1/f cleaning options provided by the optional clean_flicker_noise step available in both calwebb_detector1 and calwebb_spec2.  The IFU pipeline notebook shows how this step can be run as part of pipeline processing.  Further information on 1/f noise can be found on the main NIRSpec Known Issues and 1/f Noise pages.

Background subtraction

ReadTheDocs documentation: Background Subtraction

Background subtraction is automatically applied by the calwebb_spec2 pipeline for nodded observations or observations with dedicated background or leakage observations. It is not automatically applied for observations that have off-scene background observations that were not linked to the target in APT. Custom background subtraction may be required depending on science use case. In particular, a 1-D master background spectrum may be specified when running the calwebb_spec3 pipeline. A notebook is currently under construction to demonstrate this workaround. 

Leakage of flux through the MSA may be significant in the case of bright extended targets or point sources in stuck-open shutters. If dedicated leakage observations were obtained at every dither or nod, the pipeline will use them to subtract the leakage signal. If leakage observations were only acquired at one dither or nod, the pipeline will use that leakage observation for all dither/nod positions. If the leakage changes significantly with dither/nod position and only a single leakage observation was taken, the pipeline may not process the data correctly. In this case, custom background subtraction may be necessary.

Outliers in background and leakcal subtracted data

NIRSpec/IFU data can feature more outliers if using the default pipeline processing when nods, dedicated background exposures, or leakage exposures are subtracted.  These outliers are often due to new or changing hot pixels that are not flagged by the bad pixel mask.  The outlier_detection step in calwebb_spec3 is designed to identify outliers that are consistently bad in multiple exposures, such as hot pixels. However, if nod/background/leakcal subtraction is performed, the subtraction of a hot pixel often leaves large poisson noise that differs between exposures. This large poisson noise, itself, can cause a pixel to appear as an outlier, however, because it changes significantly between exposures, these outliers can be missed by the outlier_detection step and show up in the final level 3 IFU cubes.  

The JWST pipeline includes an optional step, badpix_selfcal, in calwebb_spec2, which can be used to flag these hot pixels (and other bad pixels) prior to background and leakcal subtraction, reducing the number of outliers that show up in the final IFU cubes. To run the badpix_selfcal step, the calwebb_spec2 step must be run on an association listing all of the relevant exposures (e.g., the science, background and/or leakcal exposures) as "selfcal" members in the association and the badpix_selfcal parameter skip = False must be set. Note that when adding selfcal exposures to an association some exposures would show up twice in the association, once as a "science," "background," or "imprint" member and once as a "selfcal" member. More information on the badpix_selfcal step can be found on the Bad Pixel Self-Calibration ReadTheDocs page, and examples of setting up the requisite association files programmatically can be found in the NIRSpec IFU pipeline notebook.

Spectral and spatial distortions

For more information see Beck (2025).

Distortions have been seen in the spatial location of the PSF centroid as a function of wavelength and the spectral centroid of emission lines:

(i) Point sources in the NIRSpec IFU have been seen to wander in x/y positions by up to 0.5 pixels (as shown in Figure 2). This appears to be due to a chromatic effect of the NIRSpec fore-optics that is not accounted for in the NIRSpec instrument model and is therefore common to all NIRSpec filters/dispersers (T. Beck JWST Technical Report, in prep.). Investigations are underway to improve the NIRSpec instrument model and correct for these effects.

Figure 2. Spatial distortion of PSF.

The x and y position of the PSF from 2-D Gaussian fits as a function of wavelength for the NIRSpec IFU observation of the (point source) planetary nebula IRAS 05248-7007 using the PRISM+CLEAR disperser/filter combination. Each panel shows a different dither observation, combined here for illustration purposes.  The color bar to the left shows the wavelengths of the measured x and y positions from 1 to 5 µm. In this view, the cross-slice direction goes from bottom to top, while the right-left direction is the axis along the IFU slices. Hence, the larger shift in the x pixel direction shows that the PSF centroid is predominantly varying within a slice, and the y shift in centroid position across slices is small and less than one slice width. Credit: Beck (2025).

(ii) Gaussian line-fit kinematic analysis of compact emission lines are showing a blue/red shifted character across slices at the 1–1.5 pixel level, as demonstrated in Figure 3. The shift is seen across the NIRSpec IFU slices, with similar shift in pixel magnitude regardless of disperser used. This effect appears to be due to uneven slice illumination effects (T. Beck JWST Technical Report, in prep.). Gradients in the illumination along the dispersion direction of a given IFU slice mean that light will be weighted towards one edge of the slice. When imaged on the detector spatial gradients along the dispersion direction of the slice are degenerate with wavelength shifts of the light and can, therefore, result in apparent kinematic shifts across sources with steep light profiles (such as the PSF of unresolved sources). The kinematic analyses of all spatially resolved emission line sources with compact morphologies can be affected at this level.

Figure 3. Spectral shift in emission lines.

Spectral shifts seen in the emission line data from the PRISM data analysis using the Brɑ emission line at 4.05 µm and the pipeline default cube building weighting (drizzle). The panel shows 4 different dither observations combined into a single FoV for illustration purposes. Each observation shows a kinematic pixel centroid shift of nearly 1.5 pixels across the PSF position from the upper left (blue shifted centroids) to the lower right (red shifted centroids). It should be noted that the maximum expected velocity and kinematic shift from this PN should have been well below NIRSpec instrument sensitivities. Credit: Beck (2025).

These issues with the NIRSpec spatial PSF wander and spectral shifts point toward a non-trivial problem in the calibration of the NIRSpec IFU instrument model, particularly the portion of the model that anchors the internal instrument model to the RA, Dec, wavelength mapping on the sky. While these issues occur independent of the filter/disperser that is used, it has been established that these issues can have a different character depending on disperser mode used, and are not related to the cube building algorithm in the pipeline. Both issues are currently under investigation via spatial and spectral IFU distortion calibration programs (PID 6641 and 6640, respectively). STScI is investigating these issues and more information will be available in an upcoming JWST Technical Report, T. Beck (in prep).  Mitigation plans will be released to the community once potential solutions have been identified.



Summary of common issues and workarounds

The sections above provide detail on each of the known issues affecting NIRSpec IFU data; the table below summarizes some of the most likely issues users may encounter along with any workarounds, if available. Note that greyed-out issues have been retired, and are fixed as of the indicated pipeline build.

SymptomsCauseWorkaroundFix buildMitigation Plan
NS-IFU05: Spectra extracted from single spaxels on/near point sources show a sinusoidal modulation.

NIRSpec is undersampled, and distortion causes spectral traces (particularly for the gratings) to be curved on the detector. Resampling the raw data to a rectified data cube introduces artifacts (e.g., oscillations) if extracting spectra from individual spaxels or on scales smaller than the PSF.  See detailed discussion by Law et al. 2023.

As of jwst 2.0.0 (and later versions), the JWST pipeline includes an optional step in calwebb_spec2 and calwebb_spec3, called adaptive_trace_model, that oversamples 2D detector data prior to cube building, which can greatly reduce resampling artifacts in IFU cubes.

The JWST pipeline notebook for IFU provides examples of how to turn on the adaptive_trace_model step in calwebb_spec3 when reprocessing data. 

More information about these undersampling effects and how to correct them can be found on the Resampling Artifacts page, and the adaptive_trace_model step is described in more detail in Law & Clarke (2026)

 N/A

Updated issue

As of jwst 2.0.0 (and later versions), the adaptive_trace_model step can reduce resampling artifacts in IFU cubes.  Investigations are needed to determine whether this step could be turned on by default in the pipeline.

NS-IFU06: The centroid of point sources appears to drift by up to 0.5 pixels as a function of wavelength.

Issue due to a chromatic effect in the NIRSpec fore-optics that is not accounted for in the optical instrument model. The drift can be up to ~30 mas over the wavelength range of a given disperser.  More information will be provided in an upcoming JWST Technical Report (T. Beck, in prep.).

None at present.

 N/A

Updated issue

Updates are required to the NIRSpec instrument model.  A potential solution has been identified and is being investigated for potential inclusion in JWST Pipeline Build 13.0 expected to be released in late Summer 2026.

NS-IFU07: The spectral centroid of emission lines shows unexpected structure across IFU slices.

Issue appears to be due to uneven slice illumination effects where light gradients across the dispersion direction of a given slice are degenerate with wavelength shifts when imaged onto a 2D detector.  More information will be provided in an upcoming JWST Technical Report (T. Beck, in prep.).

None at present.

 N/A

Updated issue

The root cause of this issue is has been identified.  Investigations into potential mitigation plans are ongoing.

SymptomsCauseWorkaroundFix BuildMitigation Plan
NS-IFU01: There is a hole at the peak of the PSF or an otherwise distorted PSF in IFU "s3d" cube.This is due to overly aggressive outlier detection.

Option 1: Turn off outlier rejection in the cube_build step of calwebb_spec3. However, this may allow other outliers to remain in the cube.

Option 2: Reprocess data using the  Science Calibration Pipeline, jwst 1.11.3 and onward. This version will be installed in the Operations Pipeline with build 9.3), planned for installation on .

Updated Operations Pipeline

The outlier detection algorithm was updated. STScI reprocessed affected data products with an updated Operations Pipeline that was installed on August 24, 2023. (Reprocessing of affected data typically takes 2–4 weeks after the update.)


NS-IFU02: Flux is not conserved in 1-D-extracted spectra of point sources when using a different output spaxel sampling.

The cube_build algorithm was designed to conserve flux assuming input units of surface brightness. However, the NIRSpec point source calibration produces units of flux density, which is not compatible.

If using data processed with the current Operations Pipeline build, do the following:

  1. change the header keyword SRCTYAPT in the primary extension of each "rate.fits" file to EXTENDED
  2. re-run the calwebb_spec2 pipeline to apply the surface brightness calibration
  3. change the header keyword SRCTYPE in the "SCI" extension header of the new "s3d" products to POINT
  4. re-run the extract_1d step

Otherwise, install the release candidate for the coming Operations Pipeline (jwst 1.11.3 and onward) and re-run calwebb_spec2.

 9.3

Updated Operations Pipeline

Point source calibration for IFU data was changed to surface brightness units, and 1-D spectra converted back to flux density. STScI reprocessed affected data products with an updated Operations Pipeline that was installed on August 24, 2023. (Reprocessing of affected data typically takes 2–4 weeks after the update.)

NS-IFU03: Negative and/or surplus flux in the extracted 1-D spectra is seen, typically with an irregular wavelength-dependent undulation.

Correlated noise from low-level detector thermal instabilities, seen as vertical banding in 2-D count rate images, particularly in exposures of the NRS2 detector. While the IRS2 readout modes reduces this effect, it is not completely eliminated.

Run the NSClean script developed by B. Rauscher on count rate images, using an appropriate mask. (Rauscher, B. 2023, arXiv:2306.03250)

notebook demonstrating the use of the NSClean algorithm is now available. 

Updated workaround notebook link

NSClean was implemented in the pipeline (v1.13.4 onwards) as a non-default option. 

Details on how to invoke NSClean within the science calibration pipeline are provided in the workaround notebook.

NS-IFU04: There is missing flux in the "x1d" spectrum of point sources.

Astrometric or pointing uncertainty may cause the default extraction aperture to miss the intended target or be off-center.

Option 1: Rerun the extract_1d pipeline step in calwebb_spec3 at specified coordinates.

Option 2: Install the latest release of the jwst package and then run the Science Calibration Pipeline on the affected dataset. Starting in jwst 1.11.0, the extract_1d step supports setting ifu_autocen = True.

Updated issue

An IFU astrometric solution was updated in July 2023, but small pointing offsets may remain. Reprocessing of affected data typically takes 2–4 weeks after the update.

NS-IFU08:  Leakcals are not properly associated in pipeline processing when there are separate leakcals for science and background exposures.

The pipeline does not check whether leakcals were taken for a background or science exposure.  Additionally, when one leakcal is taken for all science dithers and a separate leakcal is taken for all background dithers the pipeline will attempt to match based on dither position which will fail to find matches for all but the first dither position.

Reprocess data through calwebb_spec2 with jwst 1.18.0 (or later versions) using calwebb_spec2 association files that include all of the appropriate leakcal exposures as "exptype" = "imprint" members.

Resolved issue.

Leakcal matching in the pipeline and association file generation has been fixed as of jwst 1.18.0 (and later versions), and will be included in the Operations Pipeline update to be released in May 2025.  Reprocessing of affected data typically takes 2–4 weeks after the update.


References

Beck, T. 2025, JWST Technical Memorandum JWST-STScI-009029
Evidence for Problems in the JWST NIRSpec IFU Calibration Distortion Model

Law, D., et al. 2023 AJ 166, 45
A 3D Drizzle Algorithm for JWST and Practical Application to the MIRI Medium Resolution Spectrometer

Law, D. R. and Clarke, M. 2026, arXiv 2603.26916 (Adaptive Trace Model)
Mitigating Resampling Artifacts for the JWST IFU Spectrometers with Adaptive Trace Modeling




Notable updates
  •  
    • Updated text on cube building artifacts to provide additional information on resampling artifacts and how to correct using the new adaptive_trace_model step in jwst 2.0.0.
    • Updated 1/f section for consistency with other Known Issues pages.
    • Updated references to documenting spatial and spectral distortions and updated text to reflect current understanding about the cause of these effects.
    • Updated issue NS-IFU05 to provide workaround and mitigation plan pointing to the new adaptive_trace_model step.
    • Updated issues NS-IFU06 and NS-IFU07 for their cause and mitigation plan. 

  •  
    • Revised cube building section to describe pipeline option to build PRISM cubes with a non-linear wavelength solution.
    • Updated status of mitigation plans for issues NS-IFU05, NS-IFU06, and NS-IFU07.

    • New section"Outliers in background and leakcal subtracted data."
    • Moved issue NS-IFU08 to the list of retired issues.
    • Updated issues NS-IFU06 and NS-IFU07
      .
  •  
    Resolved issue NS-IFU08, and updated its workaround and mitigation plan.
    Updated for improved clarity the description of how leakage observations are used when a single leakcal is taken for observations with multiple nods/dithers.

  •  
    Created known issue NS-IFU08: Leakcals are not properly associated in pipeline processing when there are separate leakcals for science and background exposures.


  • New section, "Spectral and spatial distortions"
    Added issue NS-IFU07: The spectral centroid of emission lines shows unexpected structure across IFU-slices.
    Updated issues NS-IFU03NS-IFU05, NS-IFU06.
Originally published