7.8 IR Flat Fields

Standard calwf3 processing allows for up to three types of flat field reference files for calibration: 1) a P-flat, which corrects for high-frequency 'pixel-to-pixel' variations in the spatial sensitivity as a function of bandpass, 2.) a delta-correction or D-flat which accounts for any 'pixel-to-pixel' changes in the P-flat with time, and 3.) a low-frequency L-flat which provides a smooth correction to the P-flat. When two or more types of flats are provided, they are multiplied together by calwf3 to form a combined flat field image.

Prior to 2020, only P-flats were used in the pipeline, acquired first in 2008 during ground testing (see Section 7.8.1), and again in 2010 using sky flats to derive a smooth, wavelength-independent correction to the ground flats (see Section 7.8.2). With over 10 years of on-orbit imaging, sky flats now have sufficient signal-to-noise to fully replace the ground-based solutions in six filters (F098M, F105W, F110W, F125W, F140W, and F160W). For the remaining nine imaging filters, new P-flats were computed by multiplying the ground flat by a smooth (L-flat) correction derived via wavelength interpolation from residuals in the six most-used filters (see Section 7.8.3; WFC3 ISR 2021-01). Using the same archival observations to derive sky flats, new delta-flats were computed to correct for 'blobs', low-sensitivity artifacts in IR images appearing over time (WFC3 ISR 2021-10). A detailed description of IR blobs is provided in Section 7.5 and a discussion of the new blob flats in Section 7.8.4.

Because of the effect of geometric distortion, the area of the sky seen by a given detector pixel is not constant; therefore, observations of a constant surface brightness object will have count rates per pixel that vary over the detector, even if every pixel has the same sensitivity. In order to produce images that appear uniform for a uniform illumination, the flat fields include the effect of the variable pixel area across the field. A consequence of dividing by the flat fields is that two stars of equal brightness positioned on different regions of the detector will not have the same countrate after the flat fielding step. Thus, point source photometry extracted from calibrated FLT (*flt.fits) images must be multiplied by an effective pixel area map, as described in Section 9.1.1. Alternatively, this correction is accounted for by AstroDrizzle, which uses the geometric distortion solution to correct all pixels to equal areas i.e. for drizzled DRZ (*drz.fits) images, photometry is correct for both point and extended sources at any position on the detector.

7.8.1 Ground Flats

During the spring of 2008, flat field images for the IR channel were produced in the laboratory during the third and final thermal vacuum campaign (TV3) using the CASTLE Optical Stimulus (OS) system (WFC3 ISR 2008-28). The CASTLE is an HST simulator designed to deliver an OTA-like external beam to WFC3. It can provide either point-source or flat-field illumination in either monochromatic or broadband mode. Flat fields with the OS tungsten lamp were taken with the detector at its nominal operating temperature. These were acquired using the SPARS10 sample sequence, with varying numbers of readouts (samples) per exposure, chosen to obtain a signal of about 60,000 electrons per pixel in the final read. Four exposures were obtained per filter, providing a mean signal-to-noise ratio of ~500, yielding flat field corrections accurate to ~0.2%.

Figure 7.7 shows the science and error array of the F125W flat field acquired in TV3. A faint, extended cross-pattern in the flats is an artifact of the optical stimulus support structure and would therefore need to be corrected using inflight data. Additionally, the position of blobs were expected to shift once an on-orbit optical alignment was performed. While blobs are not visually apparent in the flat field science arrays, they are easily identifiable in the error arrays due to a realignment which was performed midway through the IR ground flat calibration. As a result, a single blob appears in two slightly offset positions with √2 larger errors than the surrounding regions of the P-flat. Similarly, the large cross-pattern appears in the flat field error arrays at two unique positions.

Figure 7.7: (Left) Science array of the F125W ground flat reference file 'sca20262i_pfl.fits'. (Right) Error array of the F125W ground flat. Due to an optical realignment that was performed midway through the flat calibration program, blobs on the CSM appear as pairs of white circles with √2 larger errors. The broad cross-shaped residual caused by the optical stimulus support structure also appears in two distinct positions.



To test the large-scale uniformity of the detector response as provided by the ground flat calibration, dithered observations of the globular cluster Omega Centauri were acquired during Servicing Mission Orbital Verification  just after WFC3 was installed in HST (2009, program 11453). By placing the same group of stars on different regions of the detector and measuring relative changes in brightness, low-frequency spatial variations in the response of the detector were measured, with average photometric errors of ±1.5% attributed to differences between the CASTLE OS and the inflight illumination (WFC3 ISR 2009-39).

Omega Centauri was revisited in Cycles 17 and 18 (2009-2011, programs 11928 and 12340) at additional dither positions and orientation angles. Local variations in the detector response were computed using same software used to derive the ACS inflight correction (ACS ISR 2003-10). For application to WFC3, the IR detector was divided into 16 × 16 grid and a unique solution was computed for each grid point, representing the deviations from unity. L-flat corrections were derived for five filters (F098M, F110W, F125W, F139M, and F160W) and showed rms variations of ~1.1% and peak-to-peak residuals of ±2.5%. The inflight sensitivity residual for the F160W filter is shown in the lower-right panel of Figure 7.8 and highlights the cross-pattern seen in the ground flats. Due to the relatively small number of stars in the calibration field, these low-order corrections were not sufficient to correct for the complex spatial residuals. Instead, deep images of sparse astronomical targets were used to produce sky flats in order to correct for differences in the inflight sensitivity.

7.8.2 On-orbit Corrections

Combining IR external imaging data acquired between September 2009 and December 2010, sky flats were used to compute the required correction to the ground flats. Details of this procedure are given in WFC3 ISR 2011-11. In short, all science observations taken with the F098M, F105W, F110W, F125W, F140W, and F160W filters with exposure times exceeding 300s were corrected using the ground flats and then combined in each filter, after masking out objects. This resulted in a high quality sky image for the F160W filter, and somewhat noisier sky images for F098M and F125W. For the remaining three filters, an insufficient number of input science frames were available to derive sky images with adequate signal-to-noise. Comparing the resulting sky image between filters, no clear indication of any color dependence of the low-frequency structure was found. Therefore a 'gray' sky image was constructed using all available data. Top left panel of Figure 7.8 shows the gray correction, which similar in structure to the L-flat derived from stellar observations (bottom right).

Differences between the CASTLE optical stimulus and inflight illumination patterns were also apparent from calibration observations of the moonlit Earth limb (program 11917). An image in the F105W filter, flat fielded with the ground flat reference file, is shown in the top right panel of Figure 7.8. Both the shape and the amplitude of the low-frequency structures are very similar to the image derived from sky observations. To compare the sky image with the photometric residuals from Omega Centauri, the sky image was binned to the same 16 × 16 grid. This is shown in bottom left panel of Figure 7.8 for comparison with the bottom right panel which shows the F160W stellar L-flat. The same low frequency structures are present in both images, i.e. the results are consistent, albeit with lower signal-to-noise in the stellar L-flat.

In December 2010, the ground flat reference files ('s*pfl.fits') were replaced with an updated set of P-flats ('u*pfl.fits'). These were constructed by multiplying the ground flats with the gray sky image, rather than generating separate L-flat reference files. The gray correction was smoothed to reduce noise, causing the blobs to be slightly larger and reduced in strength. As done for the ground flats, each new P-flat was normalized to 1.0 over the image section [101:900,101:900], which excludes areas of the detector known to contain anomalies such as the "Death Star" and the "Wagon Wheel” (see Section 7.9.2). After recalibrating the Omega Centauri observations with the new P-flats, the photometric accuracy was estimated to be ~0.5% (with peak to peak variations of -1.5 to +1.6%) when avoiding the outermost 128 pixels of the edge of the detector. Within the “Wagon-Wheel” region and the edge of the detector, the photometric uncertainties increased to ~0.8% (with peak to peak variations of -2.0 to +1.9%).

Figure 7.8: (Top left) Filter-independent 'gray' correction derived from on-orbit sky flats and applied to the ground-based P-flats in 2010. (Top right) Earth flat residual in the F105W filter after application of the ground flat. (Bottom left) 16 x 16 binned image of the 'gray' sky correction for comparison with the stellar L-flat. (Bottom right) L-flat correction for the F160W filter based on aperture photometry of Omega Centauri acquired at multiple dithered positions. Figure from WFC3 ISR 2011-11.


7.8.3 Filter-Dependent Sky Flats

New sky flats were computed from a much larger set of in-flight science observations acquired over more than 10 years on-orbit. These new P-flat reference files ('4*pfl.fits') were delivered to the Calibration Database Reference System (CRDS) in October 2020 which have wavelength-dependent residuals of ±0.5% in the central 800x800 pixel region of the detector and up to 2% near the detector edges (WFC3 ISR 2021-01). For the six most commonly used filters (F098M, F105W, F110W, F125W, F140W, and F160W), the combined sky image is now deep enough to fully replace the ground flat reference files, with errors less than or equal to 0.2%. The new P-flats improve the 'pixel-to-pixel' sensitivity calibration and correct for differences in the IR gain across the four amplifiers. Unlike the 2010 solutions, the P-flats no longer include the blobs, which are corrected by a separate set of D-flat reference files (see next Section).

For the remaining nine IR imaging filters, wavelength-dependent sensitivity residuals from the six most frequently used filters were used to correct the P-flats acquired on the ground. An L-flat correction image for each filter was derived by interpolating the pixel values of the flat field residual images (sky flat divided by ground flat) from the two filters closest in wavelength. These residuals were smoothed to avoid degrading the filter-dependent pixel-to-pixel sensitivity and were then multiplied by the original ground flat. 

To check the stability of the IR detector sensitivity, spatial-scanning photometric observations of a sparse region of M35 were acquired over a ~6 year baseline (WFC3 ISR 2021-05). To avoid the effects of image persistence, the target was dithered by large offsets to place the stars at multiple, 'clean'  (no prior illumination) positions across the central 512x512 subarray. The photometry of each star shows an intrinsic scatter of order 0.5%, suggesting either residual errors in the flat field, subtle effects due to the scanning mode, and/or systematic effects related to the detector illumination history. For more details on IR photometry errors, see Section 7.11.   

7.8.4 Blob Flats

A new set of delta-flats, delivered together with the new P-flats in October 2020, now correct for ‘blobs’ in the six most frequently used filters (WFC3 ISR 2021-10). The blob delta-flats were computed by stacking the same archival sample of sky flat images after the appearance of each blob. Conversely, P-flats in blob-affected regions are computed by stacking images prior to each blob's appearance. D-flats with statistical errors < 1% are available for 148 (of 152 total) blobs, and flats for the most recent and newer blobs will be delivered as and when more inflight data are available. For a current status of blob monitoring and catalog, see WFC3 ISR 2018-06

The new D-flat reference files ('4*dfl.fits') are intended to be used in combination with the most recent P-flats described in Section 7.8.3. While there is only one set of P-flats (one for each of the 15 imaging filters), D-flats are available only for six filters at 49 unique blob appearance dates. The appropriate delta-flat is selected according to the USEAFTER keyword in the flat field header corresponding to the observation date (DATE-OBS) keyword in the header of the raw image. During pipeline processing, calwf3 multiplies the P-flat and the D-flat reference files together to form a combined flat field image. D-flat values are set to 1.0 everywhere except in the blob regions which contain a high-frequency correction to the P-flat. Since blobs do not change position (aside from the occasional <1 pixel shifts discussed at the end of Section 7.5), the delta-flat for an individual blob does not change over time, and new blobs are simply added to the previous delta-flat and assigned an updated USEAFTER date. Previously, only the strongest set of blobs were assigned a DQ flag (value=512, 'bad in flat') via the IR bad pixel tables. Now, the delta-flats provide DQ flags for all cataloged blobs, regardless of their strength. This increases the total number of flagged flat field pixels from 1.1% to 2.3% in the DQ array of calibrated WFC3/IR (*flt.fits) images.

For blobs appearing in ground test data or in early inflight science images, sky flats will have little to no signal in the affected pixels. We therefore replaced their pixel values in the P-flats with the median P-flat value in a 20-pixel wide circular annulus surrounding each blob. For the early set of blobs (those present by September 2009), there are insufficient number of external images from which to compute a pixel-to-pixel flat, so the delta-flat includes a combination of the blob and the P-flat. While these blobs affect all inflight data, they were not included in the P-flats in order to make those reference files more useful for grism calibration. A model of the dispersed IR sky background in G102 and G141 is described in WFC3 ISR 2020-04, where blobs appear in the Zodiacal light component as elongated shapes, similar to those of normal dispersed spectra but with lower signal due to their reduced sensitivity. Blobs also appear in the Helium I airglow component but are offset from their nominal positions in imaging data due to the grism's dispersion.

The left panel of Figure 7.9 shows the product of the F125W P-flat and D-flat for 148 blobs appearing through July 2018. The right panel shows the F125W filter-dependent residual with respect to the 2010 'gray' inflight correction, which was heavily weighted toward the F160W filter which had the most inflight images from which to form a sky flat. The residuals are similar in both shape and amplitude to those in Figure 2 of WFC3 ISR 2011-11 which shows the ratio of the F125W and F160W sky flat computed from early inflight data.

Figure 7.9: (Left) Combined F125W flat field, computed as the product of the P-flat '4ac1921ii_pfl.fits' and the delta-flat (D-flat) '4ac1825si_dfl.fits' which corrects for blobs appearing through July 2018. The large cross-pattern visible in the left panel of Figure 7.7 is now removed.

(Right) Ratio of the combined F125W flat field (P-flat times D-flat) and the 2010 P-flat 'uc72113qi_pfl.fits', highlighting filter-dependent residuals of ~0.5% in the center of the detector and ~1% in the "Wagon wheel" feature in the lower right corner. Blobs appearing inflight after 2010 appear as dark residuals, while blobs included in the 2010 P-flat appear as dark residuals with a surrounding white ring which are a result of smoothing in the early in-flight correction.



A sample drizzled product from MAST is shown in Figure 7.10, comprised of four FLT images in the F140W filter. The drizzled image has a combined exposure time of ~5200 seconds and a total background of ~10,000 electrons.  The top panel shows the drizzle-combined image 'ibkdf2010_drz.fits' from FLT images calibrated with the 2010 flats. Residuals in the sky background are similar to the wavelength-dependent structure seen in the right panel of Figure 7.9. The drizzle-combined image from FLT images calibrated with the new (2020) P-flat and D-flat reference files is shown in the bottom panel in Figure 7.10. The large-scale uniformity of the background is significantly improved, and regions of the detector impacted by blobs appear visually clean.

For precise photometry in regions affected by blobs, observers planning WFC3 IR programs should consider utilizing a 'blob' dither in the Phase II proposal implementation (e.g. PATTERN= ‘WFC3-IR-DITHER-BLOB’) in order to permit the cleaning of blobs from drizzle-combined images. This may be achieved by reprocessing the calibrated FLT images with AstroDrizzle, rejecting any pixels flagged with a value of 512 in the DQ array, and 'filling in' with clean regions of the sky from the associated dithered exposures. For more detail on blob correction strategies, see Section 7.5.3.

Figure 7.10:  (Top) MAST dataset ‘ibkdf2010_drz.fits’ in the F140W filter with a total background of 10,400 electrons calibrated with the 2010 flats and (bottom) with the 2020 P-flats which correct for filter-dependent residuals and D-flats which correct for IR blobs.