scale_image_with_dq¶
- stginga.utils.scale_image_with_dq(infile, outfile, zoom_factor, dq_parser, kernel_width=99, sci_ext=('SCI', 1), dq_ext=('DQ', 1), bad_flag=1, ignore_edge_pixels=4, overwrite=False, debug=False)[source]¶
Rescale the image size in the given extension by the given block size, taking data quality (DQ) flags into account, and adjust WCS accordingly.
WCS adjustment is done using
scale_wcs()
.Output image is a single-extension FITS file with only the given extension header and data.
- Parameters:
- infile, outfilestr
Input and output filenames.
- zoom_factorfloat
See
scipy.ndimage.zoom()
.- dq_parser
DQParser
DQ parser for interpreting DQ flag.
- kernel_widthint
- sci_ext, dq_extint, str, or tuple
Science and DQ extensions to extract, respectively.
- bad_flagint
DQ flag value to indicate bad pixels to exclude from calculations. Compound flag is currently not supported.
- ignore_edge_pixelsint
Ignore these number of pixels along the edges. The default value of 4 is for the reference pixels on JWST NIRCam detectors.
- overwritebool
If
True
, overwrite existing output file.- debugbool
If
True
, print extra information to screen.
- Raises:
- ValueError
Invalid data.