ACS Destripe

Remove horizontal stripes from ACS WFC post-SM4 data.

For more information, see Removal of Bias Striping Noise from Post-SM4 ACS WFC Images.

Note

  • Does not work on RAW image.
  • Uses the flatfield specified by the image header keyword PFLTFILE. If keyword value is ‘N/A’, as is the case with biases and darks, then unity flatfield is used.
  • Uses post-flash image specified by the image header keyword FLSHFILE. If keyword value is ‘N/A’, then dummy post-flash with zeroes is used.
  • Uses the dark image specified by the image header keyword DARKFILE. If keyword value is ‘N/A’, then dummy dark with zeroes is used.

Examples

In Python without TEAL:

>>> from acstools import acs_destripe
>>> acs_destripe.clean('uncorrected_flt.fits', 'csck',
...                    mask1='mymask_sci1.fits', mask2='mymask_sci2.fits',
...                    clobber=False, maxiter=15, sigrej=2.0)

In Python with TEAL:

>>> from acstools import acs_destripe
>>> from stsci.tools import teal
>>> teal.teal('acs_destripe')

In Pyraf:

--> import acstools
--> teal acs_destripe

From command line:

% acs_destripe [-h] [--stat STAT] [--lower [LOWER]] [--upper [UPPER]]
               [--binwidth BINWIDTH] [--mask1 MASK1] [--mask2 MASK2]
               [--dqbits [DQBITS]] [--rpt_clean RPT_CLEAN]
               [--atol [ATOL]] [-c] [-q] [--version]
               input suffix [maxiter] [sigrej]
acstools.acs_destripe.clean(input, suffix, stat='pmode1', maxiter=15, sigrej=2.0, lower=None, upper=None, binwidth=0.3, mask1=None, mask2=None, dqbits=None, rpt_clean=0, atol=0.01, clobber=False, verbose=True)

Remove horizontal stripes from ACS WFC post-SM4 data.

Parameters:
  • input (str or list of str) –

    Input filenames in one of these formats:

    • a Python list of filenames
    • a partial filename with wildcards (‘*flt.fits’)
    • filename of an ASN table (‘j12345670_asn.fits’)
    • an at-file (@input)
  • suffix (str) – The string to use to add to each input file name to indicate an output product. This string will be appended to the suffix in each input filename to create the new output filename. For example, setting suffix='csck' will create ‘*_csck.fits’ images.
  • stat ({ 'pmode1', 'pmode2', 'mean', 'mode', 'median', 'midpt' } (Default = 'pmode1')) –

    Specifies the statistics to be used for computation of the background in image rows:

    • ‘pmode1’ - SEXTRACTOR-like mode estimate based on a modified Pearson’s rule: 2.5*median-1.5*mean;
    • ‘pmode2’ - mode estimate based on Pearson’s rule: 3*median-2*mean;
    • ‘mean’ - the mean of the distribution of the “good” pixels (after clipping, masking, etc.);
    • ‘mode’ - the mode of the distribution of the “good” pixels;
    • ‘median’ - the median of the distribution of the “good” pixels;
    • ‘midpt’ - estimate of the median of the distribution of the “good” pixels based on an algorithm similar to IRAF’s imagestats task (CDF(midpt)=1/2).

    Note

    The midpoint and mode are computed in two passes through the image. In the first pass the standard deviation of the pixels is calculated and used with the binwidth parameter to compute the resolution of the data histogram. The midpoint is estimated by integrating the histogram and computing by interpolation the data value at which exactly half the pixels are below that data value and half are above it. The mode is computed by locating the maximum of the data histogram and fitting the peak by parabolic interpolation.

  • maxiter (int) – This parameter controls the maximum number of iterations to perform when computing the statistics used to compute the row-by-row corrections.
  • sigrej (float) – This parameters sets the sigma level for the rejection applied during each iteration of statistics computations for the row-by-row corrections.
  • lower (float, None (Default = None)) – Lower limit of usable pixel values for computing the background. This value should be specified in the units of the input image(s).
  • upper (float, None (Default = None)) – Upper limit of usable pixel values for computing the background. This value should be specified in the units of the input image(s).
  • binwidth (float (Default = 0.1)) – Histogram’s bin width, in sigma units, used to sample the distribution of pixel brightness values in order to compute the background statistics. This parameter is aplicable only to stat parameter values of 'mode' or 'midpt'.
  • clobber (bool) – Specify whether or not to ‘clobber’ (delete then replace) previously generated products with the same names.
  • mask1 (str, numpy.ndarray, None, or list of these types) – Mask images for SCI,1, one for each input file. Pixels with zero values will be masked out, in addition to clipping.
  • mask2 (str, numpy.ndarray, None, or list of these types) – Mask images for SCI,2, one for each input file. Pixels with zero values will be masked out, in addition to clipping. This is not used for subarrays.
  • dqbits (int, str, None (Default = None)) –

    Integer sum of all the DQ bit values from the input image’s DQ array that should be considered “good” when building masks for de-striping computations. For example, if pixels in the DQ array can be combinations of 1, 2, 4, and 8 flags and one wants to consider DQ “defects” having flags 2 and 4 as being acceptable for de-striping computations, then dqbits should be set to 2+4=6. Then a DQ pixel having values 2,4, or 6 will be considered a good pixel, while a DQ pixel with a value, e.g., 1+2=3, 4+8=12, etc. will be flagged as a “bad” pixel.

    Alternatively, one can enter a comma- or ‘+’-separated list of integer bit flags that should be added to obtain the final “good” bits. For example, both 4,8 and 4+8 are equivalent to setting dqbits to 12.

    Set dqbits to 0 to make all non-zero pixels in the DQ mask to be considered “bad” pixels, and the corresponding image pixels not to be used for de-striping computations.
    Default value (None) will turn off the use of image’s DQ array for de-striping computations.
    In order to reverse the meaning of the dqbits parameter from indicating values of the “good” DQ flags to indicating the “bad” DQ flags, prepend ‘~’ to the string value. For example, in order not to use pixels with DQ flags 4 and 8 for sky computations and to consider as “good” all other pixels (regardless of their DQ flag), set dqbits to ~4+8, or ~4,8. To obtain the same effect with an int input value (except for 0), enter -(4+8+1)=-9. Following this convention, a dqbits string value of '~0' would be equivalent to setting dqbits=None.

    Note

    DQ masks (if used), will be combined with user masks specified in the mask1 and mask2 parameters (if any).

  • rpt_clean (int) – An integer indicating how many additional times stripe cleaning should be performed on the input image. Default = 0.
  • atol (float, None) – The threshold for maximum absolute value of bias stripe correction below which repeated cleanings can stop. When atol is None cleaning will be repeated rpt_clean number of times. Default = 0.01 [e].
  • verbose (bool) – Print informational messages. Default = True.

Global Variables

acstools.acs_destripe.MJD_SM4 = 54967

int(x=0) -> int or long int(x, base=10) -> int or long

Convert a number or string to an integer, or return 0 if no arguments are given. If x is floating point, the conversion truncates towards zero. If x is outside the integer range, the function returns a long instead.

If x is not a number or if base is given, then x must be a string or Unicode object representing an integer literal in the given base. The literal can be preceded by ‘+’ or ‘-‘ and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal. >>> int(‘0b100’, base=0) 4

Version

acstools.acs_destripe.__version__ = '0.8.2'

str(object=’‘) -> string

Return a nice string representation of the object. If the argument is a string, the return value is the same object.

acstools.acs_destripe.__vdate__ = '22-Sep-2016'

str(object=’‘) -> string

Return a nice string representation of the object. If the argument is a string, the return value is the same object.

Author

acstools.acs_destripe.__author__ = 'Norman Grogin, STScI, March 2012.'

str(object=’‘) -> string

Return a nice string representation of the object. If the argument is a string, the return value is the same object.