3.5 Manual Recalibration of ACS Data
3.5.1 Requirements for Manual Recalibration
Retrieving Software and Input Data Files
If the observer decides to recalibrate their ACS data, the following must be available on their system:
- CALACS software from the STSDAS hst_calib.acs package
- MultiDrizzle and PyDrizzle from the STSDAS dither package
- PyRAF, to run MultiDrizzle and PyDrizzle, obtained from STScI
- Reference files obtained from STScI Archive, or personal versions
- Uncalibrated data (*_raw.fits) from OTFR
- Association table, if applicable.
Uncalibrated data and calibration reference files can be obtained from OTFR via StarView or the web-based archive request form:
http://archive.stsci.edu/cgi-bin/hst.
StarView is available for users to download from:
http://starview.stsci.edu/html.
The pages include instructions on installing and using StarView and on how to become a registered archive user.
The most recent version of STSDAS, which includes the CALACS package required for reprocessing, can be downloaded from:
http://www.stsci.edu/resources/software_hardware/stsdas
The most recent versions of PyRAF, MultiDrizzle, and PyDrizzle can be downloaded from:
http://www.stsci.edu/resources/software_hardware/stsdas/pydrizzle
Setting up 'jref'
Before any recalibration may be done, the user's local directory containing the calibration reference files must be defined. For ACS, this directory is referred to as 'jref'. The image header already contains the appropriate keywords defining the reference files. The user must simply define the location of the 'jref' directory in the Unix environment.
|
setenv jref /mydisk/myjref/
|
Once this path is set, IRAF must be restarted in the same window in which the setup was performed.
Selecting Calibration Switches
OTFR will use the latest available calibration reference files by default. In order to use non-default reference files, manual recalibration is required. The calibration reference file keywords will need to be updated manually in the uncalibrated data with the non-default filenames before running CALACS. The selection criteria in Table 3.7 are used to set the values for the calibration switch header keywords in uncalibrated ACS data.
Table 3.7: Calibration Switch Selection Criteria.
| Switch |
Description |
Criteria |
| DQICORR |
Data Quality Array Initialization |
DEFAULT = "PERFORM" If OBSMODE = ACQ then "OMIT" |
| ATODCORR |
Analog to Digital Conversion |
DEFAULT = "OMIT" |
| BLEVCORR |
Overscan Region Subtraction |
DEFAULT = "PERFORM" |
| BIASCORR |
Bias Subtraction |
DEFAULT = "PERFORM" |
| FLSHCORR |
Post Flash Subtraction |
DEFAULT = "OMIT" |
| CRCORR |
Cosmic Ray Rejection |
If CRSPLIT >= 2 then "PERFORM" If CRSPLIT < 2 then "OMIT" |
| EXPSCORR |
Calibrate individual exposures in an association |
DEFAULT = "PERFORM" |
| SHADCORR |
Shutter Shading Correction |
DEFAULT = "OMIT" |
| DARKCORR |
Dark Subtraction |
DEFAULT = "PERFORM" |
| FLATCORR |
Flat field Division |
DEFAULT = "PERFORM" |
| PHOTCORR |
Photometric Processing |
DEFAULT = "PERFORM" |
| RPTCORR |
Repeat Processing |
DEFAULT = "OMIT" If NRPTEXP > 1 then "PERFORM" |
| DRIZCORR |
Dither Processing |
DEFAULT = "PERFORM" |
| GLINCORR |
Global Non-Linearity Correction |
SBC DEFAULT = "PERFORM" |
| LFLGCORR |
Local and Global Non-Linearity Flagging in DQ Array |
SBC DEFAULT = "PERFORM" |
Bypassing the PHOTCORR Step
Raw ACS images are in units of Data Numbers (DN), calibrated images are in units of electrons, and drizzled images are in units of electrons/second. The pipeline calibration tasks do not alter the units of the pixels in the image. Instead they calculate and write the inverse sensitivity conversion factor (PHOTFLAM) and the ST magnitude scale zero point (PHOTZPT) into header keywords in the calibrated data. Refer to the section "doPhot - Photometry Keyword Calculation" in Section 3.4.3 for more information.
When populating the photometric keywords during the PHOTCORR step, CALACS uses the STSDAS synthetic photometry package, SYNPHOT, which contains the throughput curves of all HST optical components. (For information on retrieving the SYNPHOT dataset, see Appendix A.3.2 of the HST Data Handbook Introduction.) The SYNPHOT dataset contains numerous files which may be updated on a regular basis, making it cumbersome for the user to set up. A simple alternative is to set the PHOTCORR calibration switch to OMIT in the primary header of the uncalibrated image. The user may simply copy the photometric keywords from the calibrated data into the raw image header and then run CALACS with the PHOTCORR switch set to OMIT.
Speed of Pipeline Processing
Reprocessing HRC or SBC data will not put a burden on most computing systems since the image sizes, both science data and reference files, are relatively small. Processing WFC observations, on the other hand, will require more computing power, including both CPU run time and disk space.
Great care has been taken to minimize the memory requirements of the pipeline software to accommodate most computing configurations. Line-by-line I/O is used during pipeline processing and is particularly useful when more than one image is operated on at a time, for example during flat fielding or co-adding images. This, unfortunately, places an extra burden on the I/O capabilities of the computing system. CALACS requires up to 130MB of memory to process a single WFC exposure, while MultiDrizzle requires up to 400MB.
An Ultra-10 class workstation (300 MHz, 512MB RAM) using CALACS to process WFC data will take ~13 minutes for a CR-SPLIT=2 association or ~4.5 minutes for a single WFC exposure. MultiDrizzle requires ~20 minutes to process a single WFC exposure. These times can be scaled by the processor speed of the computing system, and result in much faster run times for newer workstations.
3.5.2 CALACS Examples
We present several examples of CALACS reprocessing. The steps required for MultiDrizzle reprocessing are summarized in Chapter 4.
Example 1: Reprocessing a Single Exposure
The following example uses HRC data from the flat field calibration program 9019 which observed the stellar cluster 47 Tucanae. The observations are from visit 07, exposure 12 and utilize the F814W filter. The exposures are CR-SPLIT into two exposures of 20 sec each. The association table for this exposure is j8bt07020_asn.fits. Typing 'tprint j8bt07020_asn.fits' reveals the rootnames of the individual exposures: j8bt07oyq and j8bt07ozq.
For the purposes of this first example, let us 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.
- In the Unix environment, we must specify the location of the 'jref' directory where the calibration reference files reside and then start IRAF. We assume here that the user has requested calibration files as part of the data archive request and stored these in their directory '/mydisk/myjref/', where '/mydisk/' specifies the directory containing the pipeline data.
(Note: This setup must be done in the same window in which IRAF will be used. Note also that setting 'jref' from within IRAF will not work even though typing 'show jref' would suggest it might.)
|
unix> setenv jref /mydisk/myjref/
unix> cl |
- To see what bias reference file is currently in use, we use the hedit task. Note that the period at the end of the line is required. The lines below beginning with the 'iraf>' symbol indicate commands typed into IRAF. Lines with no symbol indicate output from IRAF.
|
iraf> hedit j8bt07oyq_raw.fits[0] BIASFILE .
j8bt07oyq_raw.fits[0], BIASFILE = jref$m4r1753rj_bia.fits
|
- Next, we edit the global image header of the raw image to reflect the name of the new bias file.
|
iraf> hedit j8bt07oyq_raw.fits[0] BIASFILE jref$mybias.fits verify-
j8bt07oyq_raw.fits[0], BIASFILE: jref$m4r1753rj_bia.fits-> jref$mybias.fits
j8bt07oyq_raw.fits[0] updated
|
- We then set the PHOTCORR processing step to 'OMIT' and copy the photometric keywords from the calibrated to the raw image. (Alternately, the user may keep track of these numbers in any other preferred manner. Most users will only require knowledge of the PHOTFLAM keyword for photmetric calibration.) These steps allow users to bypass this SYNPHOT-based calibration step, due to the cumbersome requirements for setup. (See Bypassing the PHOTCORR Step for more information.)
|
iraf> hedit j8bt07oyq_raw.fits[0] PHOTCORR omit verify-
j8bt07oyq_raw.fits[0], PHOTCORR: PERFORM -> omit
j8bt07oyq_raw.fits[0] updated
iraf> hedit j8bt07oyq_flt.fits[1] phot* .
j8bt07oyq_flt.fits[1], PHOTMODE = "ACS HRC F814W"
j8bt07oyq_flt.fits[1], PHOTFLAM = 1.3260861E-19
j8bt07oyq_flt.fits[1], PHOTZPT = -2.1100000E+01
j8bt07oyq_flt.fits[1], PHOTPLAM = 8.1209805E+03
j8bt07oyq_flt.fits[1], PHOTBW = 7.0114880E+02
iraf> hedit j8bt07oyq_raw.fits[1] PHOTFLAM 1.3260861E-19 verify-
j8bt07oyq_raw.fits[1],PHOTFLAM: 0.000000E+00 -> 1.3260861E-19
j8bt07oyq_raw.fits[1] updated
|
- Within the directory containing the pipeline products ("/mydisk/"), we create the subdirectory "recal", copy the RAW and ASN files to this subdirectory, and 'cd' to this directory.
- Finally, we load the packages stsdas.hst_calib.acs and run CALACS on the single raw exposure.
(Note that invoking this package will result in the message: "Warning: package 'acs' includes Python tasks that require PyRAF". This applies only for calacsdriz which calls the CALACS and MultiDrizzle tasks in succession.)
|
iraf> stsdas.hst_calib.acs
iraf> calacs j8bt07oyq_raw.fits
|
The product will be a single calibrated image with the FLT extension.
Example 2: Reprocessing Multiple Exposures 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. IRAF output comments which are similar to Example 1 have been omitted.
- First, we look at the contents of the image association.
|
iraf> tprint j8bt07020_asn.fits
# MEMNAME MEMTYPE MEMPRSNT
j8bt07oyq EXP-CRJ yes
j8bt07ozq EXP-CRJ yes
j8bt07021 PROD-CRJ yes
|
- To see what bias reference file is currently in use, we use hedit.
|
iraf> hedit j8bt07*raw.fits[0] BIASFILE .
|
- Next, we edit the global image header of all the raw images to reflect the name of the new bias file.
|
iraf> hedit j8bt07*raw.fits[0] BIASFILE jref$mybias.fits verify-
|
- We then set the PHOTCORR processing step to 'OMIT' and copy the photometric keywords from the calibrated to the raw image.
|
iraf> hedit j8bt07*raw.fits[0] PHOTCORR omit verify-
iraf> hedit j8bt07*flt.fits[1] phot* .
iraf> hedit j8bt07*raw.fits[1] PHOTFLAM 1.3260861E-19 verify-
|
- Within the directory containing the pipeline products ("/mydisk/"), we create the subdirectory "recal", copy the RAW and ASN files to this subdirectory, and 'cd' to this directory.
- Finally, we run CALACS on the image association.
|
iraf> stsdas.hst_calib.acs
iraf> calacs j8bt07020_asn.fits
|
(If executing this command in the same directory in which you have run the previous example, then one of the FLT files will already exist and CALACS will not overwrite existing images. To execute in this case, first delete the existing FLT files or move them to a separate directory.)
The product will be two separate calibrated images with the FLT extension (j8bt07oyq_flt.fits, j8bt07oyq_flt.fits) and a single cr-combined image with the CRJ extension (j8bt07021_crj.fits).
Example 3: Removing Cosmic-rays from Repeated (RPT-OBS) Exposures
The following example uses HRC data from the shutter stability calibration program 9662 which observed the stellar cluster 47 Tucanae. The observations are from visit 01, exposure 20 and utilize the CLEAR filter. The two repeated (RPT-OBS) exposures are 1.0 sec each.
In this example, we illustrate the steps required to remove cosmic-rays from repeated observations which use the RPT-OBS syntax. By definition, the standard calibration product of multiple repeated exposures is a summed image. We can fool the software into rejecting cosmic-rays from the images, but this requires modification of the image association table.
- First, we look at the contents of the image association.
|
iraf> tprint j8is01020_asn.fits
# MEMNAME MEMTYPE MEMPRSNT
j8is01j2q EXP-RPT yes
j8is01j3q EXP-RPT yes
j8is01021 PROD-RPT yes
|
- Update calibration switches in the global header using the hedit task.
|
iraf> hedit *raw.fits[0] CRCORR perform add-
iraf> hedit *raw.fits[0] RPTCORR omit add-
|
- Update association table MEMTYPE column, by changing each instance of RPT to CR. This may be done using the text editor functionality of tedit.
|
iraf> tedit j8is01020_asn.fits
# MEMNAME MEMTYPE MEMPRSNT
j8is01j2q EXP-CRJ yes
j8is01j3q EXP-CRJ yes
j8is01021 PROD-CRJ yes
|
- We then set the PHOTCORR processing step to 'OMIT' and copy the photometric keywords from the calibrated to the raw image.
|
iraf> hedit j8is01*raw.fits[0] PHOTCORR omit verify-
iraf> hedit j8is01*flt.fits[1] phot* .
iraf> hedit j8is01*raw.fits[1] PHOTFLAM 4.5803514E-20 verify-
|
- Within the directory containing the pipeline products ("/mydisk/"), we create the subdirectory "recal", copy the RAW and ASN files to this subdirectory, and 'cd' to this directory.
- Finally, we run CALACS on the image association.
|
iraf> stsdas.hst_calib.acs
iraf> calacs j8is01020_asn.fits
|
The product will be two calibrated images with the FLT extension (j8is01j2q_flt.fits, j8is01j3q_flt.fits) and a cr-combined image with the CRJ extension (j8is01021_crj.fits) instead of the usual SFL extension.
Example 4: Combining Exposures from Multiple Associations
This example uses the same data from Example 3 plus an additional exposure from the same program: visit 01, exposure 40. These additional data also use the CLEAR filter and contain two repeated 1.0 sec exposures. The association table for this exposure is j8is01040_asn.fits. In this example, we illustrate the steps required to combine two separate sets of repeated observations.
- First we merge the two association tables and edit them appropriately (using tmerge and tedit, respectively).
|
iraf> tmerge j8is01020_asn.fits,j8is01040_asn.fits \ >>> outtable="merged_asn.fits" option=append
iraf> tprint merged_asn.fits
# MEMNAME MEMTYPE MEMPRSNT
j8is01j2q EXP-RPT yes
j8is01j3q EXP-RPT yes
j8is01021 PROD-RPT yes <---remove this line
j8is01j8q EXP-RPT yes
j8is01j9q EXP-RPT yes
j8is01041 PROD-RPT yes <---edit this line
iraf> tedit merged_asn.fits
# MEMNAME MEMTYPE MEMPRSNT
j8is01j2q EXP-RPT yes
j8is01j3q EXP-RPT yes
j8is01j8q EXP-RPT yes
j8is01j9q EXP-RPT yes
j8is01xx1 PROD-RPT yes <---new product name
|
- We then set the PHOTCORR processing step to 'OMIT' and copy the photometric keywords from the calibrated to the raw image using hedit.
|
iraf> hedit j8is01*raw.fits[0] PHOTCORR omit verify-
iraf> hedit j8is01*flt.fits[1] phot* .
iraf> hedit j8is01*raw.fits[1] PHOTFLAM 4.5803514E-20 verify-
|
- Within the directory containing the pipeline products ("/mydisk/"), we create the subdirectory "recal", copy the RAW and ASN files to this subdirectory, and 'cd' to this directory.
- Finally, we run CALACS on the new image association.
|
iraf> stsdas.hst_calib.acs
iraf> calacs merged_asn.fits
|
The product will be 4 calibrated images with the FLT extension and a single summed image with the SFL extension (j8is01xx1_sfl.fits).
Example 5: 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 and target the CDF-South with the F606W filter. The images are part of a 2-point line dither pattern and are 480 sec each. In this example, we illustrate the steps required to reprocess data which is part of a dither pattern, using a non-default dark reference file. The steps are similar to Example 2, but the format of the association and the data products are unique.
- First, we look at the contents of the image association.
|
iraf> tprint j8e654010_asn.fits
# MEMNAME MEMTYPE MEMPRSNT
j8e654c0q EXP-DTH yes
j8e654c4q EXP-DTH yes
j8e654011 PROD-DTH yes
|
- To see what dark reference file is currently in use, we use hedit.
|
iraf> hedit j8e654*raw.fits[0] DARKFILE .
|
- Next, we edit the global image header of all the raw images to reflect the name of the new dark reference file.
|
iraf> hedit j8e654*raw.fits[0] DARKFILE jref$mydark.fits verify-
|
- We then set the PHOTCORR processing step to 'OMIT' and copy the photometric keywords from the calibrated to the raw image.
|
iraf> hedit j8e654*raw.fits[0] PHOTCORR omit verify-
iraf> hedit j8e654*flt.fits[1] phot* .
iraf> hedit j8e654*raw.fits[1] PHOTFLAM 7.7792272E-20 verify-
|
- Within the directory containing the pipeline products ("/mydisk/"), we create the subdirectory "recal", copy the RAW and ASN files to this subdirectory, and 'cd' to this directory.
- Finally, we run CALACS on the image association.
|
iraf> stsdas.hst_calib.acs
iraf> calacs j8e654010_asn.fits
|
The product of the DITH-PATTERN will be two separate calibrated images with the FLT extension. In subsequent processing (see Chapter 4 for details), MultiDrizzle will combine these FLT files into a single DRZ image (j8e654011_drz.fits).