Space Telescope Science Institute
ACS Data Handbook V7.1
help@stsci.edu
Table of Contents Previous Next Index Print


ACS Data Handbook > Chapter 3: ACS Calibration Pipeline > 3.5 Manual Recalibration of ACS Data

3.5
3.5.1 Requirements for Manual Recalibration
Software Requirements
An overview of HST image data analysis software is available in the Introduction to the HST Data Handbooks. STSDAS can still be used for image analysis of HST data; please refer to the STSDAS Web page and PyRAF Web page for downloading the latest software versions, release notes, and on-line help. Additional data analysis tools can also be found in stsci_python at
http://www.stsci.edu/institute/software_hardware/pyraf/stsci_python
with full documentation of image alignment and drizzling code as part of the DrizzlePac Python package being found at
http://drizzlepac.stsci.edu
Please note that manual recalibration of post-SM4 WFC data requires a version of calacs subsequent to SM4 (May 2009). Older versions of calacs cannot process post-SM4 WFC images. The Latest software is always available at
http://www.stsci.edu/resources/software_hardware/stsdas
The latest versions of calacs are now part of HSTCAL, available from:
http://www.stsci.edu/institute/software_hardware/pyraf/stsci_python
The following examples use PyRAF, a Python-based command language for IRAF, to run STSDAS software packages.
Data Retrieval
The Introduction to the HST Data Handbooks contains an overview of data retrieval from the Archive.
Setting up “jref”
Before any recalibration can be done, the directory location for calibration reference files must be defined. For ACS, this directory is referred to as “jref”, and is used as a prefix in the reference file names in the image header (i.e., jref$qb12257gj_pfl.fits). In UNIX C-shell, the set environment variable, setenv, is used to set “jref” to a directory location. This must be done before starting PyRAF in the same window. For example:
Using Non-default Reference files and Calibration Switches
By default, OTFR provides calibrated images processed with the latest available reference files. In order to use non-default reference files and calibration switch settings, manual recalibration is required. These non-default settings have to be manually updated in the uncalibrated data (raw.fits) before running calacs. The example below shows an excerpt of a WFC full frame raw image header containing the calibration reference file keywords and switches:
 
Table 3.7: Calibration Switch Selection Criteria
The first column shows calibration switch header keywords. The second column is a description of the keyword, and the third column shows the default values.
DEFAULT = PERFORM
If OBSMODE = ACQ then OMIT (HRC only)
DEFAULT = OMIT
DEFAULT = PERFORM” (“OMIT” for SBC)
DEFAULT = PERFORM (“OMIT” for SBC)
DEFAULT = OMIT” (“PERFORM” if image was post-flashed)
DEFAULT = PERFORM
DEFAULT = OMIT
DEFAULT = OMIT (PERFORM for full frame WFC only)
DEFAULT = PERFORM(“OMIT” for SBC)
DEFAULT = PERFORM
DEFAULT = PERFORM
DEFAULT = OMIT
Dither processing1
DEFAULT =PERFORM
DEFAULT = PERFORM(SBC only)
DEFAULT = PERFORM (SBC only)
1
Not a part of calacs.

Post-SM4 WFC Image Artifact Correction for WFC Sub-Array Images
Certain artifacts present in post-SM4 WFC sub-array images, including bias striping, bias shift, and CTE trailing, are not currently (as of October 2013) handled by calacs. The amplitude of the bias shift and the CTE trailing are different from those in full frame readouts, and are not yet well characterized. However, the bias striping in sub-array images may be removed by fitting across the entire image region, as discussed in Section 3.4.1, using the stand-alone task acs_destripe in the STSDAS acstools suite.
Bypassing the PHOTCORR Step
During the doPhot step, pixel values and units are not changed. This step only calculates the values of the calibrated image’s photometric header keywords, such as the inverse sensitivity conversion factor (PHOTFLAM). Please refer to Section 3.4.4, the section about Section for more information.
When populating the photometric keywords during the doPhot step, calacs uses the STSDAS reference file IMPHTTAB. Some users find it cumbersome to keep up with the updates, and prefer to simply copy the photometric keyword values from the original OTFR calibrated data into the raw image’s primary header, then run calacs with the PHOTCORR switch set to OMIT.
3.5.2 calacs Examples
In these examples, PyRAF is used to run commands such as tprint and hedit. However, calacs is no longer part of the hst_calib package in STSDAS, and cannot be run in PyRAF. It has become part of the HSTCAL package, which does not require PyRAF to build and run it. calacs is now run from the UNIX C-shell command line. As of Summer 2013, HSTCAL only contains ACS calibration software. Future releases will include calibration software for other instruments. Instructions on how to download HSTCAL can be found in the STSDAS Download Web page.
Example 1: Reprocessing a Single Exposure Using a Different Bias File
The following example uses HRC data from the flat-field calibration program 9019 which observed the stellar cluster 47 Tucanae using the F814W filter. Specifically, the exposures are from visit 07, exposure log sheet line 12. The observation from line 12 was sub-divided into two 20 second exposures (by specifying the CR-SPLIT optional parameter in the Phase II program).
The association table for this observation, which is part of the standard delivery from the Archive, is j8bt07020_asn.fits. Typing “tprint j8bt07020_asn.fits” in PyRAF reveals the rootnames of the two individual exposures (ending in “Q”) and the name of the cosmic ray-rejected combined image created by OTFR.
For the purposes of this first example, assume that the observations are not part of an association. This example will illustrate the steps required to reprocess a single exposure after changing the bias reference file from the default value to a file specified by the user.
1.
In the Unix shell window, before starting PyRAF, specify the location of the “jref” directory using the UNIX C-shell setenv command as described earlier in this section. This directory is where the calibration reference files are stored; in this example, it is /mydisk/myjref/. To verify if it worked, type “printenv jref”. (Note: This must be done in the same window in which PyRAF will be used. Setting “jref” from within STSDAS will not work even though typing “show jref” in STSDAS would suggest otherwise.)
# To launch PyRAF, simply type “pyraf” at the UNIX prompt. From then on, the PyRAF prompt will appear as “-->”
% pyraf
2.
To determine which bias reference file name was specified in the image header by OTFR, use the task hselect. (The field value $I simply echoes the image name.).
3.
Edit the global image header (group 0) of the raw image to enter the name of the new bias file1, for instance, mybias.fits, stored in the “jref” directory. (For the sake of organization, before proceeding, create a subdirectory for the recalibration of that image.)
4.
Set the PHOTCORR processing step to ‘OMIT’ and copy the values of two useful photometric group keywords from the calibrated image (processed by OTFR, retrieved from the Archive) to the raw image. (See Section for more information.) The PHOTFLAM keyword will be useful for photometric calibration during image analysis, and PHOTMODE is useful as a concise description of the observation mode. (Note: For WFC images, the keywords need to be edited for both groups.)
5.
calacs should be run in the working directory (in this example, recal), and executed from the C-shell command line. If calacs.e is in the UNIX command PATH2, it can be executed from a different C-shell window, as shown below,
or in the PyRAF window like this:
The result is a calibrated image with the flt.fits extension, in this case, j8bt07oyq_flt.fits.
Example 2: Reprocessing Multiple Exposures Taken with “CR-SPLIT” Within an Association
This example uses the same data from Example 1 and illustrates the steps required to reprocess an ACS association after changing the bias reference file from the default value to a file specified by the user. The steps required are similar to the previous example, with a few modifications. (Note: PyRAF output comments which are similar to Example 1 have been omitted.)
1.
The association table shows the images (rootnames ending in “Q”) from two exposures. The MEMTYPE value “EXP-CRJ” indicate that those two images were created from a “CR-SPLIT” exposure. The cosmic ray-combined product created in OTFR by calacs (with MEMTYPE = “PROD-CRJ”) has the rootname J8BT07021.
2.
3.
4.
As in Example 1, the PHOTCORR step is set to ‘OMIT’ and the photometric keywords are copied from the calibrated image to the raw image.
--> # In this example, the calibrated data from the archive was kept in the subdirectory "calib." The PHOTFLAM value from one image is used for both since they have the same observing mode.
5.
Run calacs on the image association (here, it’s done from the PyRAF window, escaping to the C-shell environment using “!”).
The product is two calibrated images with the flt.fits suffix (j8bt07oyq_flt.fits, j8bt07ozq_flt.fits) and a single cosmic ray-combined image with the crj.fits suffix (j8bt07021_crj.fits).
Example 3: Combining Exposures From Multiple Associations
This example illustrates the steps required to combine two sets of repeated observations to create a cosmic ray-rejected combined image (crj.fits). The data for this exercise comes from the ACS calibration program, 9662, that observed NGC104 using the HRC with a clear filter. The exposures are from visit 1, exposure log lines 20 and 40, which correspond to associations j8is01020 and j8is01040, respectively. Each association comprises of two 1 sec exposures, and share the same target pointing.
association j8is01020 represents j8is01j2q_raw.fits and j8is01j3q_raw.fits;
association j8is01040 represents j8is01j3q_raw.fits, and j8is01j9q_raw.fits.
1.
2.
Merge the two association tables using tmerge, then edit the merged table as shown below with tedit.
3 J8IS01021 PROD-RPT yes # Remove this line
6 J8IS01041 PROD-RPT yes # Rename the resulting summed image.
# Run tedit on "merged_asn.fits" to remove line 3, and rename the
# summed image that calacs will create, from j8is01041 to j8is01xx1
    5 J8IS01xx1 PROD-CRJ yes
3.
Set the PHOTCORR processing step to ‘OMIT’, then copy the PHOTFLAM and PHOTMODE keyword values from one of the calibrated images (retrieved from the Archive) to the raw images.
4.
Run calacs on the new image association. Here it is done from inside the PyRAF window, so a “!” is used to run it from the C-shell.
The product is four calibrated images with the flt.fits suffix and a single cosmic ray-combined image with the crj.fits suffix (j8is01xx1_crj.fits).
Example 4: Reprocessing Images taken as part of a Dither Pattern
The following example uses WFC data from the GOODS program 9425. These observations are from visit 54, exposure 219; the target name was “CDF-South,” observed with the F606W filter. The images were part of a 2-point line dither pattern with an exposure time of 480 seconds each, with rootnames j8e654c0q and j8e654c4q.
This example illustrates the steps needed to reprocess data which is part of a dither pattern, using a non-default dark reference file.
1.
2.
3.
4.
As in the earlier examples, set the PHOTCORR processing step to OMIT and copy the photometric keywords from calibrated images (retrieved from the Archive) to the raw images. The commands below pulls values of PHOTMODE and PHOTFLAM for groups 1 and 2 of the WFC chip—note that the same PHOTFLAM and PHOTMODE values are used for both ACS chips.
 
5.
Since mydark.fits does not have a counterpart CTE-corrected dark reference file, set PCTECORR to OMIT so that CTE-corrected images are not generated.
6.
Run calacs on the image association; here, it’s done in the PyRAF window but is being executed in the C-shell by adding “!” before the command. .
The result will be calibrated images, with the flt.fits extension, that were processed using the alternate dark file, mydark.fits. In subsequent processing (see DrizzlePac Handbook for details), AstroDrizzle can combine these flt.fits files into a single drz.fits.
1
For the purposes of this example, the default bias reference file, m4r1753rj_bia.fits, was retrieved and renamed to mybias.fits
2
For UNIX systems, this command can be placed in the login initialization file such as .tcsh. Here’s an example of the syntax format:
setenv PATH /usr/stsci/hstcal/bin:{$PATH}
3
For the purposes of this example, the default dark reference file, mbn1046bj_drk.fits, was retrieved and renamed to mydark.fits.


ACS Data Handbook > Chapter 3: ACS Calibration Pipeline > 3.5 Manual Recalibration of ACS Data

Table of Contents Previous Next Index Print