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 artifacts

There is spatial undersampling in the IFU that may result in an apparent "ringing" in the spectrum upon resampling during cube building, as demonstrated in Figure 1  (Law et al. 2023). This is inherent to the cube building process and there is currently no correction in the pipeline for it. Ways to mitigate this effect are currently being investigated. It may help to use a larger spatial extraction region to reduce the amplitude of the effect in extracted 1-D spectra.

Figure 1. An example of cube building artifacts.

An example of spectrum "ringing" artifacts resulting from cube resampling during cube building (© Law et al. 2023, Figure 11). The figure shows a JWST/NIRSpec G140H/F100LP spectrum of G2V star GSPC P330-E. The solid blue line shows the spectrum of the brightest spaxel in a single exposure, and exhibits significant resampling noise compared to the orange spectrum extracted from a 3 spaxel radius region from a cube built from four dithered exposures.


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

Correlated 1/f read noise

The effects of 1/f noise for NIRSpec/IFU are shown in IFU 1/f noise workaround notebook, which also demonstrates the use of the NSClean algorithm to remove most of this effect. NSClean is now implemented in the pipeline (v1.13.4 onwards) as a non-default option. Further details on how to invoke NSClean within the JWST Science Calibration Pipeline and adjust default parameters are described in the 1/f noise workaround notebook. 

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. However, if leakage observations were only acquired at one dither or nod, the pipeline may not process the data correctly. In this case, custom background subtraction may be necessary.

Spectral and spatial distortions

Credit: T. Beck JWST Technical Memo (in-prep).

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, with the worst effects seen in the PRISM, G140H, and G395M settings (as demonstrated in Figure 2). Pixels with high flux gradients are also seen to exhibit a ringed flux structure. These PSF effects, which are seen in undersampled data, do improve with an increased number of dithers but are not removed completely.  The "ringing" structure can affect continuum subtraction accuracy in spatial pixels that suffer from this effect. Variation in PSF position and spatial issues from the IFU distortion mean that spectra extracted from individual spatial elements can have the incorrect level of flux throughout the cube.  As a result, this can affect spatially resolved flux ratio maps or small aperture flux extractions. 

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: T. Beck JWST Technical Memo (in-prep).


(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. 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: T. Beck JWST Technical Memo (in-prep).

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. 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 acquiring data to characterize the issues and are addressing the problems. Once the root cause is identified a mitigation plan will be released to the community



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 if extracting spectra on scales smaller than the PSF.  See detailed discussion by Law et al. 2023.

Extract spectra from larger apertures comparable in width to the PSF. Combining dithers/nods also reduces, but does not eliminate, the effect.

 N/A

Updated issue

None at this time.

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

Issue related to a combination of filter transmission effects and the calibration of the IFU instrument model. The drift is typically of order 20 milliarcsec over the wavelength range of a given disperser.

None at present.

 N/A

Updated issue

None at this time. Any action regarding pipeline or post-processing mitigation await an investigation on the root cause, which is underway via Spatial IFU Distortion calibration program 6641.

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

Issue related to how the NIRSpec IFU instrument model is anchored to the RA, Dec, wavelength mapping on the sky.

None at present.

 N/A

Created issue

None at this time. Any action regarding pipeline or post-processing mitigation await an investigation on the root cause, which is underway via Spectra IFU Distortion calibration program 6640.

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.



References

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




Notable updates
  •  
    • 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