WfcWrapper

class acstools.findsat_mrt.WfcWrapper(image_file, extension=None, binsize=None, ignore_flags=[4096, 8192, 16384], preprocess=True, execute=False, **kwargs)

Bases: TrailFinder

Wrapper for TrailFinder designed specifically for ACS/WFC data.

This class enables quick reading and preprocessing of standard full-frame ACS/WFC images.

Note

This class is not designed for use with subarray images.

Parameters:
  • image_file (str) – ACS/WFC data file to read. Should be a FITS file.

  • extension (int, optional) – Extension of input file to read. This keyword is required if the input image is an FLC/FLT file. The default is None.

  • binsize (int or None, optional) – See binsize. The default is None (no binning).

  • ignore_flags (list of int) – See ignore_flags. Default is [4096, 8192, 16384].

  • preprocess (bool, optional) – Flag to run all the preprocessing steps (bad pixel flagging, background subtraction, rebinning). The default is True.

  • execute (bool, optional) – Flag to run the entire TrailFinder pipeline. The default is False.

  • **kwargs (dict, optional) – Additional keyword arguments for TrailFinder.

Raises:

ValueError – Image is subarray, or unrecognized image extension or type.

Attributes Summary

binsize

Amount the input data should be binned by.

ignore_flags

DQ flags that are ignored when flagging bad pixels.

Methods Summary

mask_bad_pixels()

Mask bad pixels.

rebin()

Rebin the image array by modifying self.image in-place.

run_preprocess()

Runs all the image preprocessing steps in the following order:

subtract_background()

Subtract a median background from the image, ignoring NaNs, where self.image is modified in-place.

update_dq([dqval, verbose])

Update DQ array with the satellite trail mask (self.mask) using acstools.utils_findsat_mrt.update_dq().

Attributes Documentation

binsize

Amount the input data should be binned by.

ignore_flags

DQ flags that are ignored when flagging bad pixels. Only relevant for FLT/FLC files.

Methods Documentation

mask_bad_pixels()

Mask bad pixels. This uses ignore_flags (for FLC/FLT), so update it first, if needed.

Bad pixels are replaced with NaN by modifying self.image in-place. This uses the bitmask arrays for FLC/FLT images, and weight arrays for DRC/DRZ images.

rebin()

Rebin the image array by modifying self.image in-place. The binning in the x and y direction are identical. This uses binsize, so update it first, if needed.

run_preprocess()

Runs all the image preprocessing steps in the following order:

  1. mask_bad_pixels()

  2. subtract_background()

  3. rebin()

See the documentation for methods above for more details.

subtract_background()

Subtract a median background from the image, ignoring NaNs, where self.image is modified in-place. Bad pixels should first be handled via mask_bad_pixels() before running this.

update_dq(dqval=16384, verbose=True)

Update DQ array with the satellite trail mask (self.mask) using acstools.utils_findsat_mrt.update_dq(). The file in self.image_file is updated for this operation, particularly the DQ extension associated with self.extension.

Note

This routine only works on FLC/FLT images.

Parameters:
  • dqval (int, optional) – DQ value to use for the trail. Default value of 16384 is tailored for ACS/WFC.

  • verbose (bool, optional) – Print extra information to the terminal.