New! This page describes an IDL/java implementation of an algorithm to correct images from the Hubble Space Telescope's ACS/WFC camera (Massey et al. 2010a, 2010b, Rhodes et al. 2010). It works fine, but takes about 25 minutes per ACS exposure on one CPU. As described in Massey et al. (2014), a faster implementation in C is now available, thanks to Oliver Cordes and Ole Marggraf.

Charge transfer inefficiency due to radiation damage

All electronics gradually degrade in space, as they are bombarded with high energy radiation. This manifests itself in CCD detectors used in cameras via the generation of "charge trap" defects within the silicon lattice. During detector readout, electrons (the photoelectrons created when light falls on the detector) are temporarily captured and held in place. When these electrons are subsequently released, the rest of the image has moved closer to the readout register, so they form trails behind objects. The net effect is known as "Charge Transfer Inefficiency" (CTI). Fortunately, by modelling the process of readout and trapping, it is possible to reverse the effect, and move the electrons back to where they belong. Because the readout is the final process preformed in space, this correction should be the first analysis step performed on the ground.

Install the correction code

  1. Download the core java CTI correction code, uncompress it (tar xvzf CTI_correct_java_v1.0.tar.gz), and place it somewhere convenient - let's say ~/bin/snapSim-current-20090328.230001/.
  2. Download the front-end IDL CTI correction code, uncompress it, and make sure IDL can find it (print,!path in IDL, and check with doc_library,"acs_clock_charge").
  3. The code is trivially parallelisable (to e.g. correct images from a large survey). If you plan to run it on a large cluster farm, make sure both paths can be accessed from all nodes. If you have root access to the master node, it may help* to run
  4. Optionally, to save entering the same details many times in the future, you can hardwire

Additional instructions are also available in the headers of the IDL *.pro files.

Prepare the data

  1. Place all the *_raw.fits files you want to correct (maybe first try two or three files) into one directory - let's say /data/acs/.
  2. Here is some sample data that I know works fine.
  3. Place the relevant superbias *_bia.fits files into the same directory.

Process the data

Assess the level of improvement

  1. Blink _raw and _cte versions of the same image in DS9.
  2. Run acs_measure_cte,pixelsR,trailsR,DATA_DIR="/data/acs/",SUFFIX="_raw",/FIND,/PLOTS.
  3. Run acs_measure_cte,pixelsC,trailsC,DATA_DIR="/data/acs/",SUFFIX="_cte",/FIND,/PLOTS.


* The correction software manages multiple slave machines from one master node, keeping (several) processes active on the master node while each image is being corrected. Any unix-like machine has a maximum number of processes that it can run. By default, the number allocated to each user is set rather low, because it is expected that multiple users may log in. The CTE code will detect this limit, and stay under it by pausing occasionally if the limit is neared. However, if you know that you will be the only user, you can safely increase your own process quota.

It is also possible to completely detach child processes to the slave machines (or a queueing system) so that the master node could forget about them. However, this requires the slave machines to be able to log back into the master node to return the results. The current method worked best for my cluster, because it is behind a firewall, but I have alternative versions if they would be better for yours.


Last updated by Richard Massey on 30th May 2018.

Valid HTML 4.01!

Valid CSS!