ACS Destripe Plus

Fully calibrate post-SM4 ACS/WFC exposures using the standalone ACS Destripe tool to remove stripes between ACSCCD and ACSCTE steps in CALACS.

This script runs CALACS (8.3.1 or higher only) and acs_destripe on ACS/WFC images. Input files must be RAW full-frame or subarray ACS/WFC exposures taken after SM4. Resultant outputs are science-ready FLT and FLC (if applicable) files.

This script is useful for when built-in CALACS destriping algorithm using overscans is insufficient or unavailable.

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


In Python without TEAL:

>>> from acstools import acs_destripe_plus
>>> acs_destripe_plus.destripe_plus(
...     'j12345678_raw.fits', suffix='strp', maxiter=15, sigrej=2.0,
...     scimask1='mymask_sci1.fits', scimask2='mymask_sci2.fits',
...     clobber=False, cte_correct=True)

In Python with TEAL:

>>> from acstools import acs_destripe_plus
>>> from import teal
>>> teal.teal('acs_destripe_plus')

In Pyraf:

--> import acstools
--> teal acs_destripe_plus

From command line:

% acs_destripe_plus [-h] [--suffix SUFFIX] [--stat STAT]
                    [--maxiter MAXITER] [--sigrej SIGREJ]
                    [--lower [LOWER]] [--upper [UPPER]]
                    [--binwidth BINWIDTH] [--sci1_mask SCI1_MASK]
                    [--sci2_mask SCI2_MASK] [--dqbits [DQBITS]]
                    [--rpt_clean RPT_CLEAN] [--atol [ATOL]] [--nocte]
                    [--clobber] [-q] [--version]
acstools.acs_destripe_plus.destripe_plus(inputfile, suffix='strp', stat='pmode1', maxiter=15, sigrej=2.0, lower=None, upper=None, binwidth=0.3, scimask1=None, scimask2=None, dqbits=None, rpt_clean=0, atol=0.01, cte_correct=True, clobber=False, verbose=True)

Calibrate post-SM4 ACS/WFC exposure(s) and use standalone ACS Destripe.

This takes a RAW image and generates a FLT file containing its calibrated and destriped counterpart. If CTE correction is performed, FLC will also be present.

  • inputfile (str or list of str) –

    Input filenames in one of these formats:

    • a Python list of filenames
    • a partial filename with wildcards (‘*raw.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 of acs_destripe. This only affects the intermediate output file that will be automatically renamed to *blv_tmp.fits during the processing.
  • 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).


    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.
  • scimask1 (str or list of str) – Mask images for calibrated SCI,1, one for each input file. Pixels with zero values will be masked out, in addition to clipping.
  • scimask2 (str or list of str) – Mask images for calibrated 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.


    DQ masks (if used), will be combined with user masks specified in the scimask1 and scimask2 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].
  • cte_correct (bool) – Perform CTE correction.
  • verbose (bool) – Print informational messages. Default = True.
  • not found.
  • IOError – Input file does not exist.
  • ValueError – Invalid header values or CALACS version.

Global Variables

acstools.acs_destripe_plus.SM4_DATE = <Time object: scale='utc' format='iso' value=2008-01-01 00:00:00.000>

Represent and manipulate times and dates for astronomy.

A Time object is initialized with one or more times in the val argument. The input times in val must conform to the specified format and must correspond to the specified time scale. The optional val2 time input should be supplied only for numeric input formats (e.g. JD) where very high precision (better than 64-bit precision) is required.

The allowed values for format can be listed with:

>>> list(Time.FORMATS)
['jd', 'mjd', 'decimalyear', 'unix', 'cxcsec', 'gps', 'plot_date',
 'datetime', 'iso', 'isot', 'yday', 'fits', 'byear', 'jyear', 'byear_str',
  • val (sequence, str, number, or Time object) – Value(s) to initialize the time or times.
  • val2 (sequence, str, or number; optional) – Value(s) to initialize the time or times.
  • format (str, optional) – Format of input value(s)
  • scale (str, optional) – Time scale of input value(s), must be one of the following: (‘tai’, ‘tcb’, ‘tcg’, ‘tdb’, ‘tt’, ‘ut1’, ‘utc’)
  • precision (int, optional) – Digits of precision in string representation of time
  • in_subfmt (str, optional) – Subformat for inputting string times
  • out_subfmt (str, optional) – Subformat for outputting string times
  • location (EarthLocation or tuple, optional) – If given as an tuple, it should be able to initialize an an EarthLocation instance, i.e., either contain 3 items with units of length for geocentric coordinates, or contain a longitude, latitude, and an optional height for geodetic coordinates. Can be a single location, or one for each input time.
  • copy (bool, optional) – Make a copy of the input values
acstools.acs_destripe_plus.SUBARRAY_LIST = ['WFC1-2K', 'WFC1-POL0UV', 'WFC1-POL0V', 'WFC1-POL60V', 'WFC1-POL60UV', 'WFC1-POL120V', 'WFC1-POL120UV', 'WFC1-SMFL', 'WFC1-IRAMPQ', 'WFC1-MRAMPQ', 'WFC2-2K', 'WFC2-ORAMPQ', 'WFC2-SMFL', 'WFC2-POL0UV', 'WFC2-POL0V', 'WFC2-MRAMPQ', 'WFC1A-512', 'WFC1A-1K', 'WFC1A-2K', 'WFC1B-512', 'WFC1B-1K', 'WFC1B-2K', 'WFC2C-512', 'WFC2C-1K', 'WFC2C-2K', 'WFC2D-512', 'WFC2D-1K', 'WFC2D-2K']

list() -> new empty list list(iterable) -> new list initialized from iterable’s items


acstools.acs_destripe_plus.__version__ = '0.4.1'

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_plus.__vdate__ = '12-Jan-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.


acstools.acs_destripe_plus.__author__ = 'Leonardo Ubeda, Sara Ogaz (ACS Team), STScI'

str(object=’‘) -> string

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