Skip to content

One dimensional spectra extraction

Jae-Joon Lee edited this page Jun 12, 2019 · 4 revisions

For point-like source ("stellar-ab/onoff"), we utilize a slightly modified version of the optimal extraction of Horne (1986). The spatial profile along the slit is derived from the A-B image, and the profile has both plus and minus part. The 1-d spectra is basically weighted mean of (A-B) divided by the normalized profile, thus it all becomes plus in the end. The variance map is derived using the A+B with additional variance term added. We assume ideal case where there is no sky remained in the A-B image (this may not true and need to be improved), and sky is assumed to be zero in the extraction.

When extraction is performed, each pixel is shifted in dispersion direction to match the reference position according to the distortion map. The weighted mean is calculated according to their reference pixel. The shifting is simply done with linear interpolation, which need to be improved in the future.

The extracted spectra is stored as a 2-d image where the x-axis is pixel position and y-axis is order. The wavelength solution for each order is stored in the header as a Chebyshev polynomial. The file is meant to be compatible with IRAF products and should work with IRAF splot and other tools. For convenience, a map of wavelength is also stored as an image in the second HDU.

Optionally, you can use simple extraction that just sums up all the pixel values along the slit. Missing values are replaced using the estimated slit profile.

For extended source, the 1d extraction is simply done by summing all the pixels along the slit direction. For now, missing values (bad pixels, cosmic rays) are left blank (zero).

In addition, a 2d rectified spectra is also stored as a 3d cube (x-dispersion, y-slit, z-order).

Here are options for extraction

LA-Cosmic threshold ('--lacosmic-thresh')

The optimal extraction is supposed to remove the cosmic rays. However, due to various reason, we are currently using rather high threshold for CR rejection within the optimal extraction. And it may be better to run a separate CR rejection process. The pipeline supports of removing CRs using the LA-Cosmic algorithm (van Dokkum 2001). A value between 1 to 3 seems to work okay. Note that low value may also remove some of the OH sky lines.

python igr_pipe.py a0v-ab 20141023 -b K -s 59 --lacosmic-thresh=2.

extraction mode ('--extraction-mode')

While the optimal extraction is default, you may try simple extraction that just sums up pixel values along the slit direction.

python igr_pipe.py a0v-ab 20141023 -b K -s 59 --extraction-mode=simple

slit profile mode ('--slit-profile-mode')

By default, spatial profile along the slit is interpolated using cubic-spline(--slit-profile-mode=simple). Another option is to fit it with multiple Gaussian components (--slit-profile-mode=gauss).

python igr_pipe.py a0v-ab 20141023 -b K -s 59 --slit-profile-mode=gauss
python igr_pipe.py a0v-ab 20141023 -b K -s 59 --slit-profile-mode="gauss(n_comp=2)"
python igr_pipe.py a0v-ab 20141023 -b K -s 59 --slit-profile-mode="gauss(n_comp=2, stddev_list=[0.1, 0.2])"

(Support for optional arguments in the parentheses is not included in the v2.2-alpha.1. It will be included in the next release)

If stddev_list is a list of initial values for stddev of gaussian components, and they are automatically selected if not given. But if n_comp > 3, you must provide stddev_list. The default is to n_comp = 3.

saving the output spectra with different name ('--basename-postfix')

By default, "extraction" will over-write any existing file. If you want, you can save the output spec with different names.

python igr_pipe.py a0v-ab 20140525 -b K -c recipe.config.igrins128 -s 16 --extraction-mode="simple" --basename-postfix="_simple"

Instead of "SDCK_20140525_0016.spec.fits", a file named "SDCK_20140525_0016_simple.spec.fits" will be created (other files follow the same naming convention).