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

36.3 Recalibrating GHRS Data

The pipeline used the calibration reference files available at the time the observation was received. However, a number of factors about the instrument came to light as more experience was gained. For example, monitoring of the GHRS showed that it was stable over the lifetime of the instrument. However, some instrumental properties have changed slightly over time. Archive users should be aware that some GHRS observations were obtained before on-orbit calibration reference files were released to OPUS (formerly PODPS). Some calibration reference files are time-tagged, indicating that they should be used on data taken within specific range of dates.

Updated or more timely reference files sometimes become available after the data were processed. If there are unusual features in the data, or if your analysis requires a high level of accuracy, or if wavecal observations were obtained with the science observation, then you may want to determine whether or not a better calibration is possible and then recalibrate the data.

All users should perform a StarView search and check the list of reference files used during pipeline processing against the recommended calibration reference files. The decision to recalibrate depends upon which calibration image or table changed, and whether that kind of correction is likely to affect the analysis. Before deciding to recalibrate, retrieve the recommended and used calibration files and compare them to see if the differences are important.

All information needed to calibrate your GHRS observations is contained in the science data header keywords. calhrs opens the header file and determines which set of calibration steps to PERFORM or OMIT, and which calibration reference files and tables to use during the calibration process.

You can use the current set of calibration switches and specified reference files in the header file, or you can change certain keyword values. The STSDAS task chcalpar can be used to edit calibration parameters simply and reliably.

The IRAF task imheader can be used to examine the data header file.

to> imheader rootname.d0h l+ | page

Here is an excerpt from a GHRS science data header file showing the calibration reference files and switches:

Figure 36.2: GHRS Science Data Header


DIOHFILE= `zref$cce1504az.r0h' / diode response header file

PHCHFILE= `zref$bcc11275z.r1h' / photocathode response header file

VIGHFILE= `zref$e751116dz.r2h' / vignetting response header file

ABSHFILE= `zref$e5v0936rz.r3h' / absolute flux header file

NETHFILE= `zref$e5v0936az.r4h' / absolute flux wavelength net header file

DQIHFILE= `zref$cce1505kz.r5h' / data quality initialization header file

CCR1    = `ztab$aau13518z.cz1' / photocathode line mapping parameters table

CCR2    = `ztab$ba412190z.cz2' / photocathode sample parameters table

CCR3    = `ztab$c7f1130oz.cz3' / detector parameters table

CCR4 = `ztab$a3d1045dz.cz4' / wavelength ranges table
CCR5    = `ztab$e3u1417oz.cz5' / spectral order constants table

CCR6    = `ztab$e3t1251bz.cz6' / dispersion constants table

CCR7    = `ztab$e3t1250tz.cz7' / thermal constants table

CCR8    = `ztab$e3t1250lz.cz8' / incidence angle coefficients table

CCR9    = `ztab$e751042hz.cz9' / echelle interpolation constants table

CCRA    = `ztab$e751041qz.cza' / echelle non-interpolation constants table

CCRB    = `ztab$d8b1457az.czb' / scattered light correction factors

CCRC    = `ztab$e3u14301z.czc' / global wavelength coefficients table

CCRD    = `ztab$e3t1028nz.czd' / photocathode blemish table

CCG2    = `mtab$a3d1145ly.cmg' / paired-pulse correction table


DQI_CORR= `PERFORM ` / data quality initialization 

EXP_CORR= `PERFORM ` / division by exposure time

DIO_CORR= `PERFORM ` / diode response correction

PPC_CORR= `PERFORM ` / paired-pulse correction

MAP_CORR= `PERFORM ` / mapping function

DOP_CORR= `OMIT ` / doppler compensation

PHC_CORR= `PERFORM ` / removal of photocathode nonuniformity

VIG_CORR= `PERFORM ` / removal of vignetting nonuniformity

MER_CORR= `PERFORM ` / merging of substep bins

GWC_CORR= `PERFORM ` / use global wavelength coefficients

ADC_CORR= `PERFORM ` / application of dispersion constants

MDF_CORR= `OMIT ` / median filter of background spectra

MNF_CORR= `OMIT ` / mean filter of background spectra

PLY_CORR= `PERFORM ` / polynomial smoothing of background spectra

BCK_CORR= `PERFORM ` / background removal

IAC_CORR= `PERFORM ` / incidence angle correction

ECH_CORR= `PERFORM ` / correction for echelle ripple

FLX_CORR= `PERFORM ` / absolute flux calibration

HEL_CORR= `PERFORM ` / conversion to heliocentric wavelengths

VAC_CORR= `OMIT              ` / vacuum to air correction

The HST data headers are intended to be self-documenting. The data processing steps performed are listed within the headers as is the state of the telescope and instrumentation at the time of the observation. The trailer file (.trl) contains the history of the RSDP pipeline processing, including the history of the calibration steps executed.

36.3.1 Selecting the "Best" Reference Images and Tables

Over the past four years, several changes were made to both the reference images and tables and the calibration software that uses them. In general, software changes are backwards-compatible with earlier versions of reference tables. However, this has not always been the case. Consequently, the current version of the software will not always run properly with old data or old reference files. This is most likely to be a problem for data from before November 11, 1991, in its original form. The simplest work-around to any problem of this sort is to obtain officially-processed data and the latest (appropriate) reference images and tables from the HST Data Archive. StarView can retrieve calibration images and tables from the HST Archive: the GHRS calibration form provides a simple interface for identifying the best files.

Finding Appropriate Reference Files

The calibration reference files used and recommended for a particular observation can be determined by performing a StarView search of the HST Archive. The user should select the StarView |Searches| menu and follow the "GHRS" sub-menu to the "Reference Files" option. Type the proposal ID or observation rootname in the "Dataset Name" field and then choose [Begin Search] to list the calibration reference files and tables used during pipeline processing and the recommended reference files for calibration.

These files can be obtained from the HST Archive through a StarView retrieval request. Chapter 1 describes how to use the Archive.

StarView's Reference file screen contains four columns of useful information: Used and Recommended reference file names, Level of Change, and an indication if the correction associated with the files was performed. You will also find, for early science data, that not all the calibration switches currently used by the latest version of calhrs are in your raw science header. The StarView reference file screen will, however, retrieve all the latest recommended files that you need. By using chcalpar on the raw science file, the new switches and reference file keywords will automatically be placed in your header, including CCRE, SAAHFILE, and BMD_CORR keywords, which can be used to apply the model background subtraction instead of the pipeline default (see "Background Removal" on page 36-8) as well as the GWC_CORR and CCRD keywords used in the dispersion solution (see "Determine Wavelengths" on page 36-7). You will need to fill in the values of the switches and reference files within chcalpar (see "Running the STScI Recalibration Software" on page 36-16) before recalibrating, populating the names of the recommended reference files in place of those originally used by the pipeline. We are now providing information on the Level of Change (SEVERE, MODERATE, TRIVIAL) for calibration images and table rows.

Currently, calhrs looks for the incidence angle correction table for all science data taken through the SSA and the LSA. However, a correction does not need to be applied in the case of SSA data and the StarView Reference File screen will not, therefore, return a recommended reference file for data taken through the SAA. You will therefore need to set the IAC_CORR to "OMIT" before recalibrating data taken in the small science aperture.

Reference files consist of images and tables stored in FITS format in the HST Archive. You should probably run strfits on the files retrieved from the Archive before running calhrs. A calibration reference image is an STSDAS image (IRAF imtype = "hhh"). Once strfits is run, an image consists of two files: an ASCII header and a binary data file. A reference table is an STSDAS format table. This table is a single binary file which may contain data of several types. By convention, the suffix of a reference image begins with the letter "r" and that of a reference table begins with the letter "c." More information about FITS and STSDAS formats is provided in Chapter 2.

Running the STScI Recalibration Software

calhrs is a task in STSDAS. The STSDAS software runs under IRAF and is free to the astronomical community; it can be retrieved through the STSDAS web page. See Chapter 3 for information about setting up and using IRAF and -STSDAS.

In order to recalibrate your data, you need to have all the reference images and tables that are specified by the calibration switches in the science data header (.d0h). If you want to change any of the files used by the RSDP pipeline calibration software to calibrate the dataset originally, the files can be retrieved from the HST Archive.

If you want to add or change the calibration switches or update the reference files, we recommend that you use the chcalpar task (in the ctools package under hst_calib). This task provides a simple and consistent method to change calibration parameters in any of the HST instrument headers.

The calibration software takes as input the raw data images (.d0h, .q0h, .shh, .ulh, .x0h, .xqh) and the calibration reference images and tables. The calibration software determines which calibration steps to perform and which reference files to use from the calibration keyword values (switches and reference files) in the header of the raw data (.d0h) file. The values of the calibration switches and reference file keywords depend on the instrumental configuration used, the date when the observations were taken, and any special pre-specified constraints. The header keyword values were populated in the raw data file in the RSDP pipeline.

All users should determine the values of the calibration switches and reference file keywords in the raw data and calibrated headers. Each observation mode will have calibration switches set to default values. Prior to calibration (.d0h), the calibration switches will have the value OMIT or PERFORM. Because some steps require that other calibration steps be completed first, there can be cases where a switch is set to PERFORM yet the step is not executed in the pipeline (these are noted in the descriptions of each step, "Calibration Steps Explained" on page 36-2). In this case, the calibration switch value will remain set to PERFORM in the output product (.c*h). After calibration (.c1h), the switches for completed steps will have been assigned the value COMPLETE in the header keywords of the calibrated dataset, unless the software knows the reference file is a DUMMY file, in which case the value of the switch keyword will be SKIPPED.

The calibration task calhrs has only two user-selectable parameters: the input and output file names. If only the input name is specified, the output filenames will have the same rootname.

calhrs will write informational messages to the screen as it runs. These messages are saved in the trailer file (.trl) when RSDP calibrates the data. You can save them by redirecting the output into a file.

hr> calhrs oldrootname newrootname > output

The calibration process can logically be thought of in terms of two distinct steps: flux calibration and wavelength calibration. The file that contains the wavelength coefficients has the suffix .c0h, while the flux-calibrated image has .c1h.

Each calibration step is described in the section "Calibration Steps Explained" on page 36-2, along with the corresponding calibration switch and various reference files required by that step.

36.3.2 SPYBALs and Wavecals

GHRS wavelength calibrations come in two varieties: SPYBAL and wavecal.

36.3.3 Using Wavelength Calibration Exposures

The standard wavelength calibration can be improved by using a wavecal or SPYBAL observation taken close to the time of the science data to correct for zero-point offset: calhrs does not do this automatically. In addition, if a wavecal observation was deliberately obtained with the same carrousel position as the science data as part of the observations, and if the science observations were not obtained as an FP-SPLIT, you may choose to re-derive the wavelength dispersion constants and use them to create a new calibrated wavelength file (.c0h file) for the science observation. When re-deriving the dispersion, you should double check that the science data and the wavecal observation were obtained at the same carrousel setting by examining the value of the keyword parameter CARPOS in both files.

Correcting the Zero Point Offset

You can use the STSDAS waveoff task to derive a new zero point offset for the wavelength scale from either a wavecal or a SPYBAL.

hrs.waveoff prints the pixel, wavelength, and sample space offsets to the screen. You can then apply the wavelength offset to the science observations by using the imcalc task to add the calculated offset to each pixel (for all the groups) in the wavelength file. See the help file for waveoff for examples on how to do this.

Rederiving the Dispersion Coefficients

You can use the task zwavecal to re-derive the wavelength dispersion coefficients from a wavecal observation and create a new calibration table with these values. You can then recalibrate your data with calhrs, using the newly derived dispersion coefficients to create the calibrated wavelength file (.c0h file) for your science observations. Note that you can only use this method if you have a wavecal observation at the same carrousel position as your science data, taken close in time to your science data, and your science data were not obtained as an FP-SPLIT. You can assure that the science data and the wavecal observation were obtained at the same carrousel setting by examining the value of the keyword parameter CARPOS in both files. Likewise, the value of the keyword FP_SPLIT should be set to "NO".

cl> hselect z29h0107t.c1h,z29h0108t.c1h $I,carpos,fp_split\
>>> yes
z29h0107t.c1h 50680 NO
z29h0108t.c1h 50680 NO
After running zwavecal, you can use chcalpar to change the value of the header keyword CCR6 (the dispersion constants reference table) in the science raw data header (.d0h) file to point to the newly created dispersion table. At the same time, change GWC_CORR to `OMIT' and make sure that ADC_CORR is set to "PERFORM". Then re-run calhrs on the science observation. The calhrs task will produce a new set of calibrated files, including the new wavelength (.c0h) file reflecting the new dispersion solution. For example, if you had two observations, the first of which was a calibration lamp observation called z29h0107t that was requested at the same carrousel position as science observation z29h0108t, you could use the commands shown in Figure 36.3 to improve the wavelength solution.

Figure 36.3: Improving the Wavelength Solution

cl> zwavecal z29h0107t.c1h newdisp_0107
zwavecal: aperture SC2 carrousel position = 50680
wavefit: Iteration 1: 56 lines fit, chisq = 1.146993853700548

Removing 1 lines and fitting again...
wavefit: Iteration 2: 55 lines fit, chisq = 0.8818314073898266
Removing 1 lines and fitting again...
wavefit: Iteration 3: 54 lines fit, chisq = 0.7580552119929887
wavefit: maximum iterations reached.
cl> chcalpar z29h0108t.d0h
(ccr6 = newdisp_0107.tab) dispersion coefficients table
(gwc_cor= omit) Use global wavelength coefficients
cl> calhrs z29h0108t new_z29h0108t

36.3.4 Putting FP-SPLITs Together

If your data were taken in FP-SPLIT mode, then your calibrated data will have multiple groups that contain independent subintegrations taken at slightly offset carrousel positions. To obtain your final spectrum, with the full integration time, you need to combine the group spectra into a single spectrum. Recall that when taking data in FP-SPLIT mode, the grating carrousel is shifted slightly between subintegrations to assure that different portions of the photocathode are illuminated each time. Thus, each FP-SPLIT group in your calibrated spectrum is shifted in wavelength space with respect to the others. When the individual FP-SPLIT spectra are combined into a single spectrum, the effects of the granularity of the photocathode response are reduced, since the flux measured in a single pixel in the final spectrum will have been collected over several (FP-SPLIT) different photocathode locations.

To combine the groups of an FP-SPLIT observation, you can use two stsdas tasks: hrs.poffsets and hrs.specalign. The poffsets task determines the shifts needed to align the spectra either by cross-correlating features in the individual spectra, or by using the information in the .c0h file which gives the wavelength at each pixel. The specalign task combines the spectra after first shifting them to align in wavelength space. These tasks are not specific to GHRS data, but can be used on any spectra which you wish to co-align and co-add. They are, however, of particular use in combining the FP-SPLIT groups in an ACCUM mode GHRS observation since for high-signal-to-noise FP-SPLIT data, the tasks can also be used to derive the photocathode response function (i.e., the photocathode flatfield) for your observations. You can then use the photocathode response function to assess the reliability of the features in your final spectrum.

A detailed description of how to use poffsets and specalign to combine the groups of an FP-SPLIT observation can be found in the help files for the tasks. This topic was also discussed in "Putting FP-SPLITs Back Together" on page 35-32.

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

Copyright © 1997, Association of Universities for Research in Astronomy. All rights reserved. Last updated: 01/14/98 15:51:00