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) – Seebinsize
. The default isNone
(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 isFalse
.**kwargs (dict, optional) – Additional keyword arguments for
TrailFinder
.
- Raises:
ValueError – Image is subarray, or unrecognized image extension or type.
Attributes Summary
Amount the input data should be binned by.
DQ flags that are ignored when flagging bad pixels.
Methods Summary
Mask bad pixels.
rebin
()Rebin the image array by modifying
self.image
in-place.Runs all the image preprocessing steps in the following order:
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
) usingacstools.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 usesbinsize
, so update it first, if needed.
- run_preprocess()
Runs all the image preprocessing steps in the following order:
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 viamask_bad_pixels()
before running this.
- update_dq(dqval=16384, verbose=True)
Update DQ array with the satellite trail mask (
self.mask
) usingacstools.utils_findsat_mrt.update_dq()
. The file inself.image_file
is updated for this operation, particularly the DQ extension associated withself.extension
.Note
This routine only works on FLC/FLT images.