NIRISS 1/f Noise Removal

While an investigation of optimal methods and parameters for 1/f noise correction of NIRISS data is still in progress, here is a summary of the current recommendations for removing 1/f pattern noise in NIRISS data. 

On this page

For now, we recommend the use of the "image1overf" algorithm for NIRISS data. While this algorithm has been implemented as an optional step in the calwebb_detector1 stage of the JWST Science Calibration Pipeline (i.e., the "clean_flicker_noise" step), we do not recommend use of that step for NIRISS data in the current implementation, since it affects the quality of flatfielding of NIRISS data. While this issue is planned to be addressed in the future, we currently recommend use of the "onefcorr" and "onefcorr_wfss" functions available at this GitHub repository. While "onefcorr" supports both NIRISS and NIRCam images, in this article we only illustrate examples for NIRISS.

Key Parameters of onefcorr and onefcorr_wfss

fit_by_channel: True (default in onefcorr) or False (default in onefcorr_wfss)

  • If set to True, the 1/f pattern in the data is fitted and corrected separately for the regions read out by each individual amplifier. This is recommended for scenes without significant intrinsic structure in the background (see below). 

backsub: True (default in onefcorr_wfss) or False (default in onefcorr)

  • In general, the 1/f pattern is superposed onto the astrophysical background of the image. If the latter has structure across the image, the algorithm is generally unable to disentangle that structure from the 1/f pattern. Setting this parameter to True will subtract a smooth 2-D fit to the background structure prior to fitting the 1/f pattern, then adds that fit to the background back into the image after 1/f correction. 

boxsize: integer (default is 32)

  • This parameter is only relevant if backsub = True. It sets the box size used in fitting the 2-D background image. A box size of 32 has been tested to work well with many target scenes.

makebkg: True or False (default)

  • This parameter allows one to create a FITS file containing the fitted 2-D background image that was created if backsub = True (see above). The name of this output file is derived from the input file, replacing ".fits" in the input file name by "_bkg.fits". 

bkgmethod: 'median' (default) or 'mode'

  • The algorithm to fit the 1/f pattern relies upon a mask to flag pixels to ignore when fitting the 1/f pattern (e.g., pixels occupied by astrophysical sources). By default, this is done automatically using a sigma-clipping algorithm to mask pixels with values not associated with the astrophysical background. This parameter allows the user to select the background value to be the clipped median or the clipped mode. The clipped mode is recommended in cases of crowded fields (see below).

makemask: True or False (default)

  • This parameter allows one to create a FITS file containing the mask created within the onefcorr script to flag pixels not associated with the astrophysical background. The name of this output file is derived from the input file, replacing ".fits" in the input file name by "_mask.fits".

user_mask:  string (default is None)

  • This parameter allows one to input a custom mask that flags pixels not associated with the astrophysical background. This needs to be a single-extension FITS file with the same image dimension as the exposure being processed. Pixels in the mask with value 1 will not be used during the fitting of the 1/f pattern.  If provided, this mask will skip the automatic mask creation within the script.

sigma_bgmask: float (default is 3.0)

  • This parameter sets the sigma level of outliers for masking when estimating the background.

sigma_1fmask: float (default is 2.0)

  • This parameter sets the sigma level of outliers for masking when fitting the 1/f pattern.


Guidelines are given below for reasonable default parameters for data taken in the NIRISS Imaging and NIRISS Wide Field Slitless Spectroscopy (WFSS) observing modes, and for different types of scenes. Optimal techniques to remove 1/f noise in NIRISS Single Object Slitless Spectroscopy (SOSS) and NIRISS Aperture Masking Interferometry (AMI) modes are currently under investigation.


Imaging

For NIRISS imaging data (exposure type keyword EXP_TYPE = 'NIS_IMAGE' in the main header), the most applicable settings of onefcorr depend significantly on the type of target scene. Three main examples are listed below along with illustrations of the impact of the onefcorr algorithm. 

Flat backgrounds

  • For imaging data without significant intrinsic structure in the background, low background level, and relatively sparse scenes, we recommend the default settings for onefcorr. An illustration of its efficacy is shown in Figure 1. 

Figure 1.  1/f noise correction for sparse-field NIRISS images with no significant intrinsic structure in background 

Left panel: Animated figure showing example of 1/f correction applied to NIRISS sparse-field image. Right panel: Residual image after subtracting 1/f-corrected image from original image. Pixel value range in right panel is from -0.06 to 0.06 ADU/s.

  • For imaging data of crowded fields, we recommend the following settings:

Intrinsic 2D structure

  • For imaging data with significant structure in the background, we recommend the following settings. A few examples are shown in Figure 2.

Figure 2.  1/f noise correction for  NIRISS images with structure in background 

Left panels: Animated figures showing example of 1/f correction applied to NIRISS images with structure in the background. Right panels: Residual images after subtracting 1/f-corrected image from original image. Pixel value range in the right panels is from -0.008 to 0.008 ADU/s. Note that some long vertical diffraction spikes in the top image are fit as part of the 1/f pattern by the algorithm.



WFSS

1/f correction for NIRISS WFSS data is best done on the level 1 products (the files ending with 'rate.fits'). This is done using the "onefcorr_wfss" function, which divides the input image by the appropriate flat field prior to the 1/f correction, then multiplies the flat field back in afterwards. 

All NIRISS WFSS data taken with a (slitless) grism (GR150R or GR150C) in the optical path contain significant structure in the background due to a superposition of several spectral orders from the astrophysical background in and around the target field. As such,  the option to subtract a 2-D background prior to 1/f correction is default in onefcorr_wfss. For now, we recommend the default settings for all NIRISS WFSS data (exposure type EXP_TYPE = 'NIS_WFSS'): 

This has been found to work well in all WFSS exposures tested so far. Figures 3 and 4 show examples for exposures with the GR150R and GR150C grism, respectively.

Figure 3.  1/f noise correction for NIRISS WFSS images using GR150R grism 

Left panel: Animated figure showing 1/f correction applied to NIRISS WFSS GR150R image. Right panel: Residual image after subtracting 1/f-corrected image from original image. Pixel value range is from -0.03 to 0.03 ADU/s.
Figure 4.  1/f noise correction for NIRISS WFSS images using GR150C grism 

Left panel: Animated figure showing example of 1/f correction applied to NIRISS WFSS GR150C image. Right panel: Residual image after subtracting 1/f-corrected image from original image. Pixel value range is from -0.03 to 0.03 ADU/s. Note the significant residual offsets in the right-hand side of the image. However, this part of the image does not contain useful science data anyway due to obscuration by the NIRISS pick-off mirror.  

Links

GitHub link to onefcorr and onefcorr_wfss

GitHub link to original image1overf




Notable updates
Originally published