wf3rej
- wfc3tools.wf3rej.wf3rej(input, output, crrejtab='', scalense=0.0, initgues='', skysub='', crsigmas='', crradius=0.0, crthresh=0.0, badinpdq=0, crmask=False, shadcorr=False, verbose=False, log_func=<built-in function print>)[source]
Combines CR-SPLIT or REPEAT-OBS exposures into a single image, first detecting and then replacing flagged pixels.
In summary, the cosmic ray rejection task sums all non-rejected pixel values, computes the true exposure time for that pixel, and scales the sum to correspond to the total exposure time. The final scaled, cleaned pixel is written to the comparison image to be used for the next iteration. This process is then repeated with increasingly stringent detection thresholds, as specified by CRSIGMAS.
- Parameters:
- inputstr or list
Name of input files, such as:
comma-separated (no spaces) filenames (
iaao01k8q_flc.fits,iaao01k9q_flc.fits)a Python list of filenames
a partial filename with wildcards (
*flt.fits)an at-file (
@input)
- outputstr
Name of the output FITS file.
- crrejtabstr, optional
Reference file name. Default is empty string.
- scalensefloat, optional
Scale factor applied to noise. Default is 0.
- initguesstr, optional
Initial value estimate scheme (min|med). Default is empty string.
- skysubstr, optional
How to compute the sky (none|mode|mean). Default is empty string.
- crsigmasstr, optional
Rejection levels (float) in each iteration. Default is empty string.
- crradiusfloat, optional
Cosmic ray expansion radius in pixels. Default is 0.
- crthreshfloat, optional
Rejection propagation threshold. Default is 0.
- badinpdqint, optional
Data quality flag bits to reject. Default is 0.
- crmaskbool, optional
If True, flag CR in DQ extension of the input images. If False, the value of crmask is read from the CRREJTAB file and used as the specification. Default is False.
- shadcorrbool, optional
If True, perform shading shutter correction. Default is False (read from SHADCORR keyword value in primary header of first image to process).
- verbosebool, optional
If True, print verbose time stamps. Default is False.
- log_funcfunc
By default, the print function is used for logging to facilitate use in the Jupyter notebook.
Examples
>>> from wfc3tools import wf3rej >>> from glob import glob >>> infiles = glob("*flt.fits") >>> wf3rej(infiles, "output.fits", verbose=True) >>> wf3rej([filename1, filename2], "output.fits", verbose=True) >>> wf3rej("*flt.fits", "output.fits", verbose=True) >>> wf3rej("@input.lst", "output.fits", verbose=True)