Browse to Browse to

Cutomizing the spectrum extraction aperture

The extraction apertures from the 2D HLA slitless spectra are automatically chosen based on the extent of the source in the cross-dispersion direction. We provide here an IDL program for extracting 1-D spectra from 2-D ACS slitless grism spectra in custom-made regions. This can be useful in cases where a source is very extended and the extraction aperture encompasses the complete galaxy, or in cases where there is contamination at the edge of the spectrum. In these cases, and as seen in the Example below, there may be reasons to extract new spectra in different apertures. The IDL program released here,, allows for extraction from 2-D spectra from the Hubble Legacy Archive release. It requires also IDL programs,, and, which are also listed on this page. The code is run with the command:


where filename.fits is the name of the 2-D spectrum fits file, centery is the y pixels to center the extraction on, width is the width of the extraction box in pixels and is the name of the ASCII file in which to write the results. Optional keywords are PYES which plots the extracted spectrum on the screen and OPTEX which allows for an optimal extraction by fitting the light profile before the extraction. Standard is no plotting and extraction by summing the flux in the box. It is important to note that no aperture correction is applied, hence the extracted flux is a lower limit to the total flux of the source. The output ASCII file will have four columns; wavelength in Ångströms, flux, 1 sigma error on flux and contamination in flux. The flux units are [erg/s/cm2/Å].

The IDL routine is available for download here:

The supplementary programs and files ("ACS.WFC.1st.sens.7.dat", "", "", "" and "") are available in this tarball.

Figure 1: Top: preview of HAG_J033206.07-274645.2_UDFNICP2_v01. This is a very extended galaxy and the released spectrum has an extraction length of 0.93 arcsec, including the whole galaxy spectrum. Below, we show an extracted spectrum with this aperture (black), and a spectrum extracted at center = 40 pixels and with extraction width = 2 pixels (red). There is clearly a star forming knot here in this galaxy, as is shown in the strong OII and Hb/OIII lines (6000/8100 Å). In this case, these lines were almost completely washed out by the large extraction aperture over the whole galaxy.

Maintained by Martin Kümmel <>