Using New CALACS

Running CALACS

Where to Find CALACS

Warning

You should not be running CALACS from within PyRAF!

The version of CALACS described in this document is HSTCAL CALACS. It contains destriping and CTE correction. The version of CALACS in STSDAS does not contain these updates.

CALACS can now be found at /usr/stsci/hstcaldev/bin/calacs.e. Simply call it from the command line:

/usr/stsci/hstcaldev/bin/calacs.e jb1f89eaq_raw.fits

Mac users may need to install the latest irafdev from http://stsdas.stsci.edu/configuration.html in order to have the latest CALACS.

Note

HSTCAL CALACS is now also available in irafx at /usr/stsci/hstcalx/bin/calacs.e.

Command Line Options

CALACS supports several command line options:

  • -t
    • Print verbose time stamps.
  • -s
    • Save temporary files.
  • -v
    • Turn on verbose output.
  • -d
    • Turn on debug output.
  • -q
    • Turn on quiet output.
  • -1
    • Turn off parallel CTE processing. Try this option if you encounter problems running CALACS with CTE corrections turned on.

Parallel Processing with OpenMP

By default CALACS will try to perform the CTE correction using all available CPUs on your computer. You can set the maximum number of CPUs available for CALACS by setting the OMP_NUM_THREADS environmental variable.

In tcsh:

setenv OMP_NUM_THREADS 2

In bash:

export OMP_NUM_THREADS=2

Batch CALACS

The recommended method for running CALACS in batch mode is to use Python and the subprocess module: http://docs.python.org/library/subprocess.html

For example:

import glob
import subprocess as sp

calacs = '/usr/stsci/hstcaldev/bin/calacs.e'

fitslist = glob.glob('*.fits')

for fits in fitslist:
    sp.call([calacs,fits])

There are a number of ways to use the subprocess module. Some examples can be found in the Python documentation: http://docs.python.org/library/subprocess.html#replacing-older-functions-with-the-subprocess-module

IMPHTTABs

The PHOTCORR step is now performed using IMPHTTAB files. You must add the IMPHTTAB keyword to image headers pointing to a matching IMPHTTAB table.

The latest IMPHTTAB tables can be found on CDBS at /grp/hst/cdbs/jref/. The tables have the suffix _imp.fits. Be sure to grab the table for your instrument by checking the DETECTOR header keyword.

Alternatively you may set the PHOTCORR keyword to OMIT. The photometry keywords are simply not added to the image header by CALACS.

CTE Correction

Required Keywords

Running CALACS with CTE correction requires adding some header keywords to images:

  • PCTECORR
    • Set to PERFORM to turn on CTE correction.
  • PCTETAB
    • The filename of the PCTETAB file containing CTE correction parameters. This may be found at /user/mrdavis/pctetab/pctetab_pcte.fits.
  • DRKCFILE
    • The filename of a CTE corrected dark.

Optional Keywords

You may adjust some CTE correction algorithm parameters by adding and of the following keywords to image headers:

  • PCTERNCL
    • Read noise level of image. Set to 4.25 in the PCTETAB.
  • PCTENSMD
    • Read noise mitigation mode:
      • 0 - no smoothing
      • 1 - normal smoothing
      • 2 - strong smoothing
    • Set to 1 in the PCTETAB.
  • PCTETRSH
    • Pixels taken below this threshold by CTE correction are re-corrected with a smaller correction. Set to -30 in the PCTETAB.
  • PCTESMIT
    • Number of iterations of readout simulation per column. Set to 7 in the PCTETAB.
  • PCTESHFT
    • The number of shifts each readout simulation is broken up into. Set to 7 in the PCTETAB.