An Algorithm to Mitigate Charge Migration Effects in Data from the Near Infrared Imager and Slitless Spectrograph on the James Webb Space Telescope

We present an algorithm that mitigates the effects of charge migration due to the “brighter-fatter effect” (BFE) that occurs for highly illuminated stars in the Teledyne HAWAII-2RG detectors used in the NIRCam, NIRISS, and NIRSpec science instruments aboard the James Webb Space Telescope (JWST). The impact of this effect is most significant for photometry and spectrophotometry of bright stars in data for which the point-spread function (PSF) is undersampled, which is the case for several observing modes of the NIRISS instrument. The main impact of BFE to NIRISS data is incorrect count rate determinations for pixels in the central regions of PSFs of bright stars due to jump detections that are caused by charge migration from peak pixels to surrounding pixels. The effect is especially significant for bright compact sources in resampled, distortion-free images produced by the drizzle algorithm: quantitatively, apparent flux losses of >50% can occur in such images due to BFE. We describe the algorithm of the “charge_migration” mitigation step that has been implemented in version 10.0 of the operational JWST calibration pipeline as of 2023 December 5. We illustrate the impact of this step in terms of the resulting improvements of the precision of imaging photometry of point sources. The algorithm renders the effects of BFE on photometry and surface brightness measurements to stay within 1%.

The brighter-fatter effect (BFE) is a non-linear process that blurs the intensity distribution of brighter sources on the detector to a larger extent than it does for fainter sources.BFE was first observed and characterized in charge coupled devices (CCDs) of several instruments such as Euclid (Niemi et al. 2015), the Dark Energy Camera (Gruen et al. 2015) and the LSST/Rubin telescope (Lage et al. 2017).In CCDs, the effect is due to changes in the electric field geometry within detector pixels as photoelectrons accumulate within the pixel potential well (e.g., Antilogus et al. 2014).Further accumulation of photoelectrons is progressively hindered by the increasing transverse electric field which repulses additional incoming photoelectrons to neighboring pixels (see also Hirata & Choi 2020).In NIR detectors such as those on JWST, where photogenerated charges are collected in a depletion region generated at a p-n diode at the detector layer which induces a change of voltage that is read using non-destructive sampling, the physical reason to expect a BFE is different: as charge accumulates in a pixel, the substrate voltage changes and the local depletion region shrinks.If it shrinks significantly relative to that of a neighboring pixel, then new charge generated in that area has a larger probability to get collected in the neighboring pixel (with larger depletion region).The effect has been reported in ground testing of a H2RG near-infrared detector for Euclid (Plazas et al. 2017(Plazas et al. , 2018; see also Zengilowski et al. 2021).The latter differ from the H2RG detectors used on JWST in terms of wavelength coverage, with the Euclid devices having a HgCdTe cutoff of 2.3 µm, while most JWST devices cut off at ∼ 5.2 µm.As such, a study of the impact of the BFE on science with H2RG detectors on JWST seems warranted.
The BFE is not the only effect that involves nearest-neighbor interactions between H2RG detector pixels.Infrared detectors also suffer from electronic cross-talk due to capacitive coupling between neighboring pixels, an effect usually referred to as inter-pixel capacitance (IPC).Although the main effect of IPC is signal-independent, it can have a non-linear component that is signal-dependent (NL-IPC; see, e.g., Donlon et al. 2018, and references therein)).While the data and analysis used in the current paper formally do not allow one to separate the effects of NL-IPC and BFE, we note that Hirata & Choi (2020) introduced a framework to connect the cross-correlation signal of different flat field time samples to different non-linear detector behaviors.This formalism was applied to a large dataset of flat field exposures with long ramps taken with a development H4RG detector for the WFIRST (now Roman) mission by Choi & Hirata (2020) and Freudenburg et al. (2020).In each of several different tests, they found that the BFE dominated over the NL-IPC.In this paper, we assume that the signal-dependent effect of charge transfer to neighboring pixels in JWST H2RG devices is due to the BFE.
An important feature of the BFE is that the magnitude of its effect scales with pixel-to-pixel contrast: the larger the contrast between the charge accumulated in neighboring pixels, the more efficient is the transfer of charge from the brightest pixel to its neighbors.As such, the effect is strongest for bright point sources, especially in observing modes for which the point spread function (PSF) is undersampled by the detector pixels.Severe PSF undersampling with JWST occurs for three NIRISS observing modes.This includes NIRISS Imaging and WFSS using filter passbands at wavelengths ≲ 2 µm, for which the PSF is undersampled by factors ≳ 2, and AMI observations with the non-redundant aperture mask for which the spatial resolution is given by the Michelson criterion (δθ = 0.5λ/D), a resolution roughly twice as high as for regular direct imaging (e.g., Sivaramakrishnan et al. 2023).
The BFE is particularly problematic for projects that rely on PSF modeling to provide the highest possible precision in photometric, astrometric, or morphological measurements.Good examples in terms of JWST science are PSF-fitting photometry of point sources for studies of resolved stellar populations and/or highprecision proper motion measurements of sources that are either too faint for GAIA or in regions that are too crowded to be resolved by GAIA (e.g., Libralato et al. 2023), or cosmological studies of weak lensing and cosmic shear (e.g., Amara & Réfrégier 2008;Amara et al. 2010).The issue is that a systematic misrepresentation of the PSF when measured from profiles of bright stars (to reach the necessary signal-to-noise ratio) biases the resulting brightnesses of fainter stars, or shape measurements of galaxies, to levels that can significantly limit the possible science goals.An additional issue caused by the BFE that specifically affects data that is read out using non-destructive reads (i.e., NIR and mid-IR data) is that the BFE changes the effective count rate during integration ramps, rendering the ramp non-linear.For pixels with intrinsically high count rates, this causes false positives in outlier detection schemes during detector-level data processing.In the absence of a BFE mitigation algorithm, this causes problems for point source photometry when multiple dithered images are combined and resampled onto a common distortion-free pixel grid using the drizzle algorithm (Fruchter & Hook 2002) in conjunction with the common weighting method of inverse variance mapping (IVM; see Casertano et al. 2000).This is discussed in detail in Section 3.
In this paper we describe the effects of BFE on NIRISS data and its impact on science, and we introduce an algorithm that mitigates these effects and was recently implemented as a new step in the JWST Calibration Pipeline.

DATA PROCESSING
Before describing examples of the impact of BFE on NIRISS data, we briefly review the relevant processing steps in the JWST Calibration Pipeline (see Bushouse et al. 2023).

Overview of JWST Pipeline Processing of H2RG Data
Detector-level processing of JWST H2RG exposures is done in the first pipeline stage, calwebb_detector1, which processes the data from non-destructively read integration ramps to slope images (with count rate units of ADU/s).The first steps flag the dead, hot, noisy, and saturated pixels, followed by the subtraction of a superbias frame and a reference pixel correction which corrects for drifts between rows and columns of the charge injected by the readout electronics.A non-linearity correction and optional persistence correction are then applied, followed by subtraction of the dark signal.Jumps (such as those caused by cosmic ray hits) are then flagged in the so-called jump step which uses the two-point difference method described in Anderson & Gordon (2011).The final step in calwebb_detector1 is the ramp_fitting step which fits a slope to the reads of each pixel during an integration ramp, after discarding the reads that were flagged during the previous steps.If an exposure contains multiple ramps, a file with the slope averaged over all integrations is also produced.
During the second pipeline stage, called calwebb_image2, world coordinate system (WCS) and flux calibration information is added to the file and a flat-field correction is applied.Finally, calwebb_image2 resamples the input image into a distortion-free product, using the WCS and distortion information added earlier.By default, the input-to-output pixel mapping applied during this resample step uses the IVM weighting scheme that uses the inverse of the read noise variance array that was stored in each image during the ramp_fitting step in calwebb_detector1.Relevant suffix names of output files of the calwebb_detector1 and calwebb_image2 pipelines are listed in Table 1.
The third and last pipeline stage, calwebb_image3, combines multiple exposures (e.g., all dither positions in a dithered exposure sequence) taken with a given filter into a single drizzled image, using the same resampling and weighting scheme as that mentioned above during the calwebb_image2 stage.
The impact of BFE on science with point source imaging data of undersampled PSFs with H2RG detectors is mainly due to the logic of the jump and ramp_fitting steps of the calwebb_detector1 pipeline stage.This will be described in detail in the next Section.

Undersampled PSFs
A good example of the significant impact BFE can have on point source science with undersampled PSFs is provided by the dataset for exposure specification # 9 of JWST program 1094 (PI: A. Martel).This dataset consists of F090W images of a flux standard star (LDS 749, a DBQ4 white dwarf, cf.Bohlin & Koester 2008) taken at two dither positions that differ in pixel phase ϕ by (∆ϕ x , ∆ϕ y ) = (0.5, 0.5) pixels.In this particular case, the star was centered near a pixel corner in the first dither position and near a pixel center in the second position.As shown in Figure 1, this setup resulted in the peak pixel reaching a count rate ∼ 50% higher in dither position 2 than in position 1.Obviously, the F090W PSF is strongly undersampled by the NIRISS detector.
The plus signs in the top panels of Figure 1 show the linearized count levels attained during the integration ramp of those two images, for their peak pixels and two neighboring pixels.For comparison, two lines are drawn for the peak pixels: the solid line depicts the ramp slope calculated by the ramp_fitting step in calwebb_detector1, while the dashed line depicts a linear fit to the first three reads (hereafter referred to as "groups" following the JWST nomenclature) of the ramp.Note that the two slopes are virtually identical for the first dither position and fit the data very well (and this is also the case for the neighboring pixels), while the signal levels of the data for the second dither position get progressively below the dashed line at accumulated signal levels ≳ 25,000 ADU.This is the BFE, and it is accompanied by signal levels in the neighboring pixels that are above their respective linear fits to the groups of the ramp for which the peak pixel stays below ∼ 25,000 ADU.This "surplus charge" in the pixels next to the peak pixel represents charge that migrated from the peak pixel to its neighbors with significantly lower signal levels.Before going into details regarding the impact of BFE to science with undersampled images, it is important to realize that the linearity correction that is applied to JWST H2RG data in the calibration pipeline is not affected by the BFE.This linearity correction is derived from a set of images taken with a dedicated external lamp during ground testing, providing stable and uniform illumination of the flight detector (see Morishita et al. 2020).The BFE has no detectable effect on such uniformly illuminated data, as illustrated in Figure 2.  1, but now for exposure jw01083001001_0210a_00001_nis_uncal.fits, an image illuminated by a lamp internal to NIRISS, for 3 adjacent pixels in an uniformly illuminated part of the image.Note the absence of any appreciable BFE effect on such data.The count rate levels of the 3 adjacent pixels are the same to within ∼ 1%.
The impact of BFE to the derived ramp slopes for stars in undersampled H2RG data is mainly due to the flagging done in the jump step within calwebb_detector1, which iteratively flags groups N if the absolute two-point difference |group N − group N−1 | is larger than the median absolute two-point difference of the full ramp by a certain threshold; this threshold is defaulted at 4 σ where σ refers to the read noise for two groups.This default threshold value was found from testing to provide solid flagging of cosmic ray hits (see Anderson & Gordon 2011).However, the jump step introduces negative side effects for exposures that suffer from significant BFE.Taking the second dither position of the dataset presented here as an example, the jump step assigned flags to all groups except # 1 and 5 in case of the peak pixel, while jump flags were assigned to groups ≥ 4 in the neighboring pixels.This caused two problems: 1.The ramp slope calculated by the pipeline for the peak pixel is lower (in this case by 4.5%) than that calculated from the groups with accumulated signal levels of ≲ 25,000 ADU, while the charge that migrated from the peak pixel to the surrounding pixels is not used by the ramp slope calculations for the latter pixels, since that surplus charge is flagged as jumps, and groups with jumps are excluded from ramp slope calculations.As a result, the integrated flux for the star is skewed low, which was noticed during NIRISS commissioning when comparing the measured integrated fluxes from the two dithered exposures.
2. Perhaps more importantly for science applications that involve image combination of distortion-free images using the drizzle algorithm, the flagging of multiple groups by the jump step in pixels affected by BFE can cause significant loss of flux in the resampled and combined images.This is due to the IVM weighting used to resample images onto a distortion-free pixel grid within the drizzle algorithm to combine dithered images in the calwebb_image3 pipeline.IVM weights are derived for each pixel as (var RNOISE ) −1 where var RNOISE is the variance of the slope of a ramp (or ramp segment) due to read noise (see ReadTheDocs article for the ramp_fitting step for details), which is represented by the VAR_RNOISE extension of the _rate and _cal pipeline products.The IVM weight maps of the 30 × 30 pixel region around the star in the two dither positions in the dataset discussed here are shown in the bottom panels of Figure 1.Note the low IVM weights assigned to the central pixels of the star in the second dither position (i.e., the one significantly affected by BFE), which are due to significant numbers of groups getting flagged as "jumps" in that image for those pixels.The consequence of these low IVM weights for the pixels with high signal level is that the resample step, which resamples the input image onto a distortion-free pixel grid, effectively lowers the pixel values in the PSF region in the output _i2d image relative to the situation in the input image.This is readily seen when comparing aperture photometry of the star from the _cal and _i2d pipeline products using multiple measurement radii: Figure 3 shows that the integrated count rate of the star in the _i2d image of the second dither position is lower by ∼ 36% relative to the input _cal image, while the _cal and _i2d count rates of the star in the first dither position (for which only one group in the central pixels was affected by BFE) are consistent with each other to within 2%.Filter: F090W Figure 3. "cal / i2d" ratio of integrated count rates measured from the _cal and _i2d pipeline products as a function of circular aperture radius for the dataset shown in Figure 1.Panels (a) and (b) are for dither positions 1 and 2, respectively.Plus signs represent aperture photometry measurements which are connected by the solid lines.Note that the resampling process for the star in dither position 1 (for which only one group in the central pixels suffered from the BFE) only changed its integrated count rate by a small amount (∼ 2%), as expected.However, the resampling process for the same star in dither position 2 resulted in a net loss of integrated count rate of ∼ 36% as a consequence of the low IVM weights assigned to the central few pixels of the PSF (see bottom right panel of Figure 1) due to the significant BFE.

Adequately Sampled PSFs
For purposes of comparison with the case of undersampled PSFs, we now illustrate the impact of BFE on images with adequately sampled PSFs, using filter F480M for which the PSF has a FWHM of ∼ 2.5 pixels.This is done using direct images taken during observation # 23 of JWST program 1093 (PI: D. Thatte).This dataset consists of F480M images of CPD−67−607, a bright K giant star used as PSF reference star, taken in two dither positions, again differing in pixel phase by (∆ϕ x , ∆ϕ y ) = (0.5, 0.5) pixels.In this case the star was centered very close to a pixel center in the first dither position and near a pixel corner in the second position.The difference of the measured count rates for the peak pixel between the two dithers is only ∼ 14% in this case, as opposed to ∼ 50% for the strongly undersampled F090W images described in Sect.3.1.1, but now for a spatially adequately sampled star in an imaging exposure sequence using the F480M filter at two dither positions.See Section 3.2 for discussion.
The linearized ramps and IVM weight maps for the two F480M images as determined by the operational pipeline are shown in Figure 4 which has the same setup as Figure 1.For the F480M exposure in which the PSF was centered on a pixel, the BFE caused the jump step to flag 5 out of the 13 groups up the ramp for the peak pixel, yielding a ramp slope that is lower by 2.1% than the slope calculated from the groups with accumulated signal levels of ≲ 25,000 ADU (see top left panel of Figure 4).This is reflected in a relatively low IVM weight for the peak pixel (see bottom left panel).However, in contrast with the case of the undersampled PSF in the F090W image that was centered on a pixel, the amount of charge that was migrated to the adjacent pixels due to the BFE was too low to cause jump detections there, likely because of the relatively low contrast in signal level between the peak pixel and its neighbors.For the F480M exposure that was centered near a pixel corner (see right-hand panels of Figure 4), the peak pixel and one adjacent pixel had very similar count rates and only one of the 13 groups was flagged by the jump step, while the neighboring pixel with the lowest count rate did receive a detectable amount of migrated charge (as evidenced by jump detections) in the last two groups, likely because of the relatively large contrast in signal level with its neighbors.As such, several pixels near the center of the PSF received a small but non-negligible lowering of IVM weights (see bottom left panel of Figure 4).Furthermore, the ramp slope for the peak pixel calculated by the operational pipeline for this exposure is 1.8% lower than that calculated from the groups with accumulated signal levels of ≲ 25,000 ADU.
The impact of the IVM weights for these F480M images is shown in terms of the "cal/i2d" ratio of integrated count rates in Figure 5.The resampling process used to create the _i2d image resulted in a net loss of integrated count rate of ∼ 2% for both dithers, due to the jump detections in some groups for the pixels at or near the PSF centers as described above.While this count rate loss for adequately sampled PSFs due to the BFE is significantly lower than it is in undersampled data with similar levels of total charge, it is still significant and relevant to mitigate the issue to improve photometric precision.3, but now for the F480M dataset shown in Figure 4.The resampling process in the resample step for this star resulted in a net loss of integrated count rate of ∼ 2% in both dither positions due to the lowered IVM weights assigned to the central 1-5 pixels of the PSF (see bottom panels of Figure 4).

Description
To address the issues caused by the BFE for undersampled H2RG data described in the previous section, we designed an additional step within the calwebb_detector1 pipeline called charge_migration which is inserted in between the dark_current and jump steps.The new step has one input parameter signal_threshold, which has a default value of 25,000 ADU which can be replaced by other values for a given exposure type or set of optical elements by means of parameter reference files.The determination of the values of signal_threshold for NIRISS modes is described in the Appendix.
The charge_migration step assigns a data quality (DQ) flag called CHARGELOSS to any nonsaturated group in any integration whose accumulated signal is above the value of signal_threshold.Furthermore, the same DQ flag is also assigned to the same groups of the pixels that are immediate neighbors of those high-signal pixels.This is done to ensure that the inclusion or exclusion of groups from calculations in the jump and ramp_fitting steps is done in the same way for pixels with values above signal_threshold and their neighbors who receive "surplus" charge that is migrated from the highsignal pixel due to the BFE.The presence of the CHARGELOSS DQ flag (which are saved in the GROUPDQ array associated with the data file) results in certain actions in the subsequent jump and ramp_fitting steps, both of which have been updated along with the implementation of the charge_migration step1 .These actions are as follows: • in the jump step, the groups with the CHARGELOSS DQ flag are being excluded from the jump detection calculations (i.e., the two-point difference calculations), similar to groups with the SATURATION DQ flag.The groups with the CHARGELOSS flag are therefore not issued a jump DQ flag.
• in the subsequent ramp_fitting step, the groups with the CHARGELOSS flag are being excluded from the ramp slope calculations.However, since those groups were not assigned a jump DQ flag, they are included in the calculation of the variance of the slope due to read noise (i.e., the VAR_RNOISE array).This prevents them from being assigned a low IVM weight during the resample step in the calwebb_image2 and calwebb_image3 pipelines, which they were before the implementation of the charge_migration step.
We remind the reader that the main purpose of the use of IVM weights based on read noise during image combination (as opposed to weighting by exposure time) is to optimize sensitivity for faint objects (see Casertano et al. 2000).The modification of the IVM weighting scheme performed by the charge_migration step only affects the brightest objects in images, for which the read noise is typically negligible relative to the poisson noise associated with the source2 .As such, the benefits of IVM weighting are fully retained when running the charge_migration step.

Results
The impact of the charge_migration step in addressing the effect of the BFE on science for H2RG data can be significant, especially in the case of spatially undersampled data of bright stars.This is illustrated in this section using files produced by re-running the calwebb_detector1 pipeline on the _uncal.fitsfiles, now with the charge_migration step activated.

Undersampled data
Figure 6 is the same as Figure 1 for the F090W dataset, but now showing the ramps, ramp-fitting results, and IVM weight assignments of the pixels around the star in the two dither positions in the data produced after activating the charge_migration step.Note that the inappropriate assignments of low IVM weights  1, but now illustrating the situation after the charge_migration step was implemented and activated.In the top panels, note that the jump step now correctly avoids flagging the groups for which the peak pixel accumulated linearized counts < 25,000 ADU (if they do not show actual jumps, that is).This is especially relevant for dither position 2 (see right-hand panel).Note also that all (non-saturated) groups are now included in the IVM weighting process in the resample step.In the bottom panel, note that the low IVM weights that were assigned to the central pixels of the star in dither position 2 prior to the implementation of the charge_migration step have now disappeared.See Section 4 for discussion.
to the central pixels of the PSF have now disappeared.Furthermore, the integrated flux measurements of the star in the resampled _i2d images are now consistent with those in the flat-fielded _cal images to within 1% for both dither positions, as shown in Figure 7.
Another effect of BFE is that it causes an apparent widening of the PSF due to the peak signal being depressed relative to that of the surrounding pixels.As already described in Section 3 and shown in Fig- Filter: F090W, charge_migration applied Figure 7. Same as Figure 3, but now illustrating the situation after the charge_migration step was implemented and activated.Scale of the ordinate is the same as in Figure 3.The integrated count rate of the star in dither position 2 after the resample step is now the same as that from the flat-fielded (_cal) image to within 1% as opposed to being ∼ 36% lower without the charge_migration step (cf. Figure 3).ure 1, the efficacy of the BFE scales with pixel-to-pixel contrast, which for undersampled PSFs includes the placement of PSFs within pixel boundaries.As such, this issue affects efforts to create proper sets of empirical PSFs (ePSFs; see, e.g., Anderson & King 2000, 2006;Libralato et al. 2023) for high-precision astrometry and photometry of point sources in undersampled H2RG data from JWST.The effect on PSF width and shape is again most significant in the resampled _i2d files due to the IVM weighting described above.To illustrate this effect, we use an F200W image with a ramp of 8 groups taken as part of JWST Commissioning Program 1096 (PI: A. Martel) in which a star is centered very close to a pixel center.The data for this star show a particularly strong efficacy of the BFE because the signal level of the peak pixel almost reaches the saturation threshold at the last group, causing a particularly strong downward curvature of the (linearity-corrected) ramp beyond the signal_threshold value, which is already reached at the third group.As shown in panel (a) of Figure 8, the jump step causes the ramp slope to be derived from only 2 groups for the peak pixel (one of which is significantly affected by BFE), and from 3 (different) groups for its neighbors.This in turn causes very low IVM weight assignments for the central pixels as shown in panel (c) of Figure 8.
The effect of this to the PSF shape in the _cal and _i2d images is shown in panels (b) and (d) of Figure 8, respectively, both before and after the charge_migration step was implemented into the pipeline.In the case of the flatfielded _cal image, the application of the charge_migration step yielded a flux increase of 13% in the peak pixel, the integrated flux of the star was increased by 2%, and the measured FWHM of the PSF showed a moderate decrease (from 1.55 to 1.46 pixels).However, for the resampled _i2d images, the differences are quite dramatic: the peak pixel flux increased by 144%, the integrated flux increased by 52%, and the FWHM decreased significantly as well (from 2.02 to 1.56 pixels).As such, the implementation of the charge_migration step yields a significant improvement of the quality and internal consistency of PSFs and PSF (or ePSF) reference libraries for PSF-fitting photometry of undersampled JWST imaging modes such as NIRISS imaging at wavelengths ≲ 2 µm and NIRISS AMI data.

Adequately Sampled Data
The ramps, ramp-fitting results, and IVM weight assignments of the pixels around the star in the two dither positions in the F480M images produced after activating the charge_migration step are shown in Figure 9. Similar to the case of the undersampled F090W images, the low IVM weights of the central pixels of the PSF have now disappeared.This is reflected in the integrated flux measurements of the star in the resampled images, which are now consistent with those in the flat-fielded images to within 0.5% for both dither positions (see Figure 10).Filter: F480M, charge_migration applied Figure 10.Same as Figure 5, but now illustrating the situation after the charge_migration step was implemented and activated.Scale of the ordinate is the same as in Figure 5.The integrated count rate of the star after the resample step is now the same as that from the flat-fielded (_cal) image to within 0.5% (for both dither positions) as opposed to being ∼ 2% lower when processed without the charge_migration step.

SUMMARY
We describe the negative impacts of the Brighter-Fatter Effect (BFE) to data of the NIRISS instrument aboard the James Webb Space Telescope (JWST).The efficacy of the BFE becomes significant when a pixel's accumulated signal levels reaches beyond a certain threshold (of order 20,000 -25,000 ADU depending on the sharpness of the point spread function (PSF)), at which point charge starts to migrate to neighboring pixels with lower signal levels by detectable amounts.This process leads to detections of "jumps" in reads within integration ramps of the affected pixels by the JWST calibration pipeline.The reads that get flagged as jumps for the peak pixel due to this effect are typically different from those flagged for the neighboring pixels, causing incorrect determinations of both peak pixel count rate and total source signal.Furthermore, the jump flags caused by this effect (which can be significant in number) cause low weights for the central pixels of PSFs of bright stars in the "inverse variance mapping" (IVM) weighting scheme, which is the default scheme used in the resample step of the JWST calibration pipeline which resamples images onto a distortion-free pixel grid.These low IVM weights for the bright central pixels can cause significant loss of source flux in the output images of the resample step relative to the input images, especially in the case of spatially undersampled images.Flux losses of > 50% have been identified in this context.
We describe an algorithm to mitigate the effects mentioned above, called the charge_migration step, which has been implemented within the calwebb_detector1 stage of build 10.0 of the JWST calibration pipeline, which was released on December 5, 2023.This step limits the negative impacts of the BFE in NIRISS imaging data to within 1% in signal level, both for flatfielded images and images resampled to a distortion-free pixel grid.
Finally, values for the signal_threshold parameter of the charge_migration step were chosen according to eq.A2.These values have been implemented as parameter reference files in the JWST Calibration Reference Data System (CRDS) (context # 1135) as of the release of version 10.0 of the Operational JWST Calibration Pipeline.As such, the charge_migration pipeline step will be automatically applied to NIRISS AMI, imaging, and WFSS data taken after December 5, 20234 .NIRISS data taken before that date will be recalibrated over the few weeks after that date and made available again in the MAST archive.In the mean time, users can download the JWST python package version 1.12.3 (or higher) using pip5 in order to run the charge_migration package on NIRISS data that was downloaded before December 5, 2023.

Figure 1 .
Figure1.Illustration of impact of BFE for well-illuminated stars with spatially undersampled PSF in an imaging exposure sequence using the F090W filter at two dither positions.Left and right panels are for dither positions 1 and 2, respectively.Top panels: linearized pixel ramps (plus signs) for the peak pixel (red) and the neighboring pixels with the maximum and minimum signal levels (black and blue, respectively).Dashed lines show linear fits to the groups for which the peak pixel accumulated linearized counts < 25,000 ADU.For comparison, the red solid line represents the ramp slope for the peak pixel calculated by calwebb_detector1 with default parameter settings, and the open circles indicate groups that did not get flagged during the jump step.Yellow circles indicate groups that are included in the IVM weighting process in the resample step.Note the charge migrating from pixels with accumulated signal level ≳ 25,000 ADU to neighboring pixels with lower intrinsic signal levels.Bottom panels: greyscale weight maps as derived from the VAR_RNOISE extension of the _rate files, used by the IVM weighting scheme to resample images into distortion-free products by the drizzle algorithm.Darker color indicate lower IVM weights.Note the low weights assigned to the central pixels of the star in dither position 2. See Section 3.1 for discussion.

Figure 2 .
Figure2.Same as top panels in Figure1, but now for exposure jw01083001001_0210a_00001_nis_uncal.fits, an image illuminated by a lamp internal to NIRISS, for 3 adjacent pixels in an uniformly illuminated part of the image.Note the absence of any appreciable BFE effect on such data.The count rate levels of the 3 adjacent pixels are the same to within ∼ 1%.

Figure 4 .
Figure 4. Same as Figure1, but now for a spatially adequately sampled star in an imaging exposure sequence using the F480M filter at two dither positions.See Section 3.2 for discussion.

Figure 5 .
Figure5.Same as Figure3, but now for the F480M dataset shown in Figure4.The resampling process in the resample step for this star resulted in a net loss of integrated count rate of ∼ 2% in both dither positions due to the lowered IVM weights assigned to the central 1-5 pixels of the PSF (see bottom panels of Figure4).

Figure 6 .
Figure6.Same as Figure1, but now illustrating the situation after the charge_migration step was implemented and activated.In the top panels, note that the jump step now correctly avoids flagging the groups for which the peak pixel accumulated linearized counts < 25,000 ADU (if they do not show actual jumps, that is).This is especially relevant for dither position 2 (see right-hand panel).Note also that all (non-saturated) groups are now included in the IVM weighting process in the resample step.In the bottom panel, note that the low IVM weights that were assigned to the central pixels of the star in dither position 2 prior to the implementation of the charge_migration step have now disappeared.See Section 4 for discussion.
Figure 8. Impact of the new charge_migration step on the BFE effect on a star in NIRISS exposure jw01096001001_02101_00001, a F200W imaging exposure with NGROUPS = 8 described in Section 4. Panel (a): same as top panels in Figure 1 but now for this exposure.Panel (b): the blue and red plus signs show the X crosscut of the PSF profile of this star in _rate images without and with the charge_migration applied, respectively.The blue and red solid lines represent best-fit EFF functions (Elson et al. 1987) to those data.FWHM values are indicated.The charge_migration step increased the flux of the peak pixel in the _rate image by 13%, and the integrated flux by 2%.Panel (c): same as bottom panels in Figure 1 but now for this exposure.Note the low IVM weights for the inner 3 × 3 pixels of the PSF due to the BFE effect.Panel (d): Same as panel (b), but now for the _i2d images.In this case, the charge_migration step increased the flux of the peak pixel by 144% and the integrated flux of the star by 52%.

Figure 9 .
Figure 9. Same as Figure4, but now illustrating the situation after the charge_migration step was implemented and activated.Note that no jump detections remain in the central pixels of the PSFs, and hence all groups are now included in the IVM weighting process in the resample step.See Section 4.2.2 for discussion.

Figure 12 .
Figure12.Signal levels S 0.99 (red circles) and S 0.98 (blue circles) versus filter pivot wavelength.Small circles represent measurements of individual stars while large circles with black rims and errorbars represent average values and standard deviations of the measurements for a given filter.Linear fits to the average values of S 0.99 and S 0.98 as function of pivot wavelength are shown as solid lines with the respective line colors.See Appendix A for discussion.

Table 1 .
JWST Calibration Pipeline Output File Nomenclature