[Top] [Prev] [Next] [Bottom]

26.3 Recalibration

In this section we discuss the recalibration of WFPC2 data, namely running the raw data again through the same pipeline calibration described thus far. We will first indicate when recalibration can be advisable, usually due to the availability of improved reference files and tables, and then go through the mechanics of how recalibration is performed. The next section will discuss some relevant post-pipeline calibration issues.

26.3.1 Why and When to Recalibrate

The main reason to recalibrate WFPC2 images is the availability of better or more up-to-date reference files and tables, especially darks, flatfields, and synphot component tables, and changes in the pipeline calibration task calwp2. The most recent reference files and tables appropriate to a given observation can be determined and retrieved via StarView. Note that, when recalibrating, calwp2 must be run again in its entirety even if only one reference component has changed, and thus all reference elements need to be retrieved (see below).

In the following we give a brief summary of some relevant changes of reference elements and the pipeline task as of today. More details and up-to-date information can be found in the WFPC2 History Memo, and especially its section 5 for calibration details. We also give a quantitative account of the differences between various generations of reference files in Chapter 27. The WFPC2 History Memo is available at the following URL:



The calibrated data originally delivered to the PI and to the Archive run through the pipeline calibration within a few days of the observation. At that time, the available dark reference file does not contain the most up-to-date information about warm pixels, which change on a weekly timescale (see "Warm Pixels" on page 26-16). Thus, dark files used in standard processing are always out of date, and the correction of warm pixels can be improved by recalibrating with a more appropriate dark file. However, another method to correct for warm pixels, the STSDAS task warmpix (described in "Warm Pixels" on page 26-16) can be used instead of recalibrating. Using warmpix is generally recommended because it gives the user more flexibility and control over the treatment of warm pixels.

Very deep observations taken before August 1996 can also benefit from recalibration with a different dark reference file. Until that date, dark reference files were produced by combining ten dark exposures taken during a two week interval surrounding the observation. For observations longer than about 20,000 s (10,000 s in the UV and in narrow-band filters), the noise in this dark frame is a significant contributor to the total noise in the final calibrated image. For this reason, if the science results are limited by the noise, it is advisable to recalibrate the image using a ``superdark'' reference file. Superdarks are generated from 120 individual dark exposures, compared to the ten exposures that go into a normal dark, and thus reduce significantly the noise associated with dark subtraction. If a superdark is used, the accompanying superbias must also be used, and warm pixels must be corrected independently by post-pipeline processing tasks such as warmpix (see "Warm Pixels" on page 26-16).

Starting August 1, 1996, the dark reference files have been generated using the appropriate superdark and adding the information on warm pixels from that week's darks; thus, observations taken after that date do not require recalibration in order to use a superdark. (Recalibration may still be appropriate in order to use the dark reference file with up-to-date information on warm pixels.)

A description of available superdarks and how to retrieve them via the Archive can be found in sections 2 and 5 of the WFPC2 History Memo on the WFPC2 Web page.


Very early observations, before March 9, 1994, used interim flat fields based on pre-launch data. These flat fields did not have good large-scale properties, with peak errors of about 10%, and thus WFPC2 observations before that date most likely need to be recalibrated. After that date, in-flight flatfields have been used. Their quality has steadily improved, and the flatfields currently in the pipeline are believed to be good to about 0.3% on small scales, and 1% or less on large scales. See Chapter 27 for a detailed discussion of the differences between various generations of flatfields.

If you are in doubt about the quality of the flatfielding in your observations, check the PEDIGREE and DESCRIP keywords of the flatfield file, also reported (after December 1994) in the HISTORY comments at the end of the header of the calibrated image. If PEDIGREE is GROUND, the data will need to be recalibrated. If the PEDIGREE is INFLIGHT, the flatfield was obtained from on-orbit data, and the DESCRIP keyword gives some information on its quality. INFLIGHT flatfields are of sufficient quality for most scientific goals, but for especially demanding applications and data with very high signal-to-noise ratio, it may be advisable to recalibrate with the most recent flatfields.

Photometric Tables

The photometric component tables are used by synphot to determine the photometric calibration, namely the photometric header parameters PHOTFLAM and PHOTPLAM (see Chapter 28). These component tables have been updated several times, most recently on May 16, 1997, in order to contain the most up-to-date information on the throughput of WFPC2. If the photometric tables have changed, users can either recalibrate their observations or, more simply, run synphot directly to determine the header parameters. Users can also use the alternate methods given in "Photometric Zero Point" on page 28-1 to calibrate their observations, thus avoiding recalibration altogether.

Pipeline Calibration Task calwp2

Another possible reason for recalibration is to use a more recent version of the calibration pipeline task calwp2. This task has seen several minor revisions, mostly to add information to processed data; the current version, as of this writing, is Only three of the calwp2 revisions since WFPC2 operations began actually affect the calibrated data. The first two were changes in how the bias level is computed: starting in March 8, 1994 (version, columns 3 through 8 of the overscan data were no longer used, because they could be affected by the image background; and starting in May 4, 1994 (version, separate bias levels were computed for even and odd columns, resulting in a slightly better image flatness for about 1% of all WFPC2 images (see WFPC2 ISR 97-04).

The third update (version, January 3, 1997) corrects a bug introduced in December 1994 ( in the calibration of WFPC2 single-chip, two-chip, or three-chip observations that do not include the PC (about 1% of all archived observations). We recommend that such observations archived between December 1994 and January 1997 be recalibrated with the most recent version of calwp2.

26.3.2 Assembling the Calibration Files

In order to recalibrate a WFPC2 dataset, you need to retrieve all of the reference files and tables used by the calibration steps set to PERFORM. See "Identifying Calibration Reference Files" on page 1-19 for a description of how to obtain the appropriate reference files from the STScI Archive using StarView. Standard pipeline processing uses those files listed by StarView as the best reference files. We suggest copying the raw data files and the required reference files and tables to a subdirectory used for recalibration. This precaution will preserve all original files.

26.3.3 Setting Calibration Switches

The next step in recalibrating HST data is to set the calibration switches and reference keywords in the header of your raw data file (.d0h). These switches determine which calibration steps are performed and which reference files are used at each step in the process.

To change the calibration header keywords in a dataset, we recommend using at first use the chcalpar task in the STSDAS hst_calib.ctools package. The hedit task provides more detailed control over individual keywords and is preferred by some users experienced with calibration of WFPC2.

The chcalpar task takes a single input parameter-the name(s) of the image files to be edited. When chcalpar starts, it automatically determines the instrument used to produce that image and opens one of several parameter sets (pset) that loads it with the current values of the header keywords. The WFPC2 pset is named ckwwfp2. Typing ckwwfp2, as a task name, at the cl> prompt will also edit this pset.

A detailed description of the steps involved in changing header keywords follows:

  1. Start the chcalpar task, specifying the image(s) in which you want to change keyword values. If you specify more than one image, for example using wildcards, the task will take initial keyword values from the first image, but it will substitute only the keywords that are actually typed in. For example, you could change keywords for all WFPC2 raw science images in the current directory (with initial values from the first image), using the following command:
        wf> chcalpar u*.d0h

  1. When chcalpar starts, you will be placed in epar-the IRAF parameter editor, and will be able to edit the parameter set of calibration keywords. Change the values of any calibration switches, reference files or tables to the values you wish to use for recalibrating your data. Remember that no processing has been done on the raw datasets. Therefore, even if you wish to correct, for instance, only the flatfielding, you will need to redo the bias and dark current subtraction as well. Therefore the switches for all these steps must be set to PERFORM.
  2. Exit the editor by typing :q two times (the first :q to exit the pset editor; the second to exit the task). The task will ask if you wish to accept the current settings. If you type "y", the settings are saved and you will return to the IRAF prompt. If you type "n", you will be placed back in the editor to re-define the settings. If you type "a", you will return to the IRAF prompt and any changes will be discarded. For additional examples of updating the calibration keywords, check the on-line help by typing help chcalpar. The calibration reference file names in the header of the raw data (i.e., the .d0h file) are typically preceded by five characters (e.g., uref$ for calibration images and utab$ for calibration tables) which are pointers to the location on disk where the files are to be found by the calibration software. Before running the calibration routines, you will need to set these variables to the path where your reference files (and .x0h/.q1h raw data files) are located. For WFPC2 data, you would use something like the following:

to> set uref = "/nemesis/hstdata/caldir/"

to> set mtab = "/nemesis/hstdata/caldir/"

to> set ucal = "/nemesis/hstdata/rawdir/"

where caldir is the subdirectory for the reference files and rawdir is the subdirectory for the uncalibrated images.

While in VMS, to set the uref, for instance, one would type instead

to> set uref = "DISK$SHARE:[HSTDATA.CALDIR]"

where HSTDATA.CALDIR is the directory where you have stored the calibration reference files and tables.

Once you have correctly changed the values of the calibration keywords in the header of the raw data file, you are ready to recalibrate your data. The WFPC2 calibration software, calwp2, is run by typing the name of the task followed by the rootname of the observation dataset. For example, to recalibrate the dataset u0w10e02t and write the log of the results to the file calwp2.log (rather than to the screen), you would type:

wf> calwp2 u0w10e02t > calwp2.log

Note that the calibration routine will not overwrite an existing calibrated file. If you run the calibration tasks in the directory where your calibrated data already exist, you will need to specify a different output file name, for example:
wf> calwp2 u00ug201t
wfpc_out > wfpc.log

For more information about how these routines work, use the on-line help by typing help calwp2.

Calculating Absolute Sensitivity for WFPC2

If you set DOPHOTOM=OMIT before running calwp2, then the values of inverse sensitivity (PHOTFLAM), pivot wavelength (PHOTPLAM), RMS bandwidth (PHOTBW), zeropoint (PHOTZPT), and observation mode (PHOTMODE) will not be written to the header of the recalibrated data file. Remember that the DOPHOTOM calibration step does not alter the values of the data (which are always counts or data numbers in the calibrated file), but only writes the information necessary to convert counts to flux in the header of the file. Therefore, unless you wish to recalculate the absolute sensitivity for your observation (e.g., because a more recent estimate of the throughput exists for your observing mode), there is no need to recompute these values and you can simply use the keyword values from your original calibrated file and apply them to your recalibrated data. However, new estimates of WFPC2 transmission and absolute sensitivity were obtained in September 1995, May 1996, and May 1997. If your data were processed in the pipeline before May 1997, you may wish to re-create the absolute sensitivity parameters using the latest version of synphot, which contains tables based on the most recent photometric calibration of WFPC2.

If you wish to recalculate the absolute sensitivity, set DOPHOTOM=YES in the .d0h file before running calwp2, or alternately, use the tasks in the synphot package of STSDAS.

The section titled "synphot" on page 3-16 has more information about how to use synphot.

To calculate the absolute sensitivity, calwp2 and the synphot tasks use a series of component lookup and throughput tables. These tables are not part of STSDAS itself, but are part of the synphot dataset, which can be easily installed at your home site (see "Getting the Synphot Database" on page A-15 for information about how to do this). A more detailed discussion of photometric calibration can be found in "Photometric Corrections" on page 28-6.

You must have retrieved the synphot tables in order to recalculate absolute sensitivity for WFPC2 data using calwp2 or synphot.

[Top] [Prev] [Next] [Bottom]

Copyright © 1997, Association of Universities for Research in Astronomy. All rights reserved. Last updated: 11/13/97 17:52:14