-
Notifications
You must be signed in to change notification settings - Fork 19
Short Long Slit Reductions
This tutorial goes through all the steps to produce flux- and wavelength-calibrated 1-D spectra from longslit SALT observations using the PySALT. The data are available here.
It assumes the data have been passed through the pipeline already and cosmic ray cleaned. These examples are run in the pyraf environment, but they can also be run as a script.
All spectroscopic reductions are done using the saltspec package. These include wavelength calibration, sky subtraction, aperture calibration, and flux calibration. The package can be loaded by doing the following:
> pyraf
--> pysalt
--> saltspec
After loading the saltspec
package, the first step is to determine the wavelength calibration for your data. The wavelength calibration is done by identifying lines of a known spectra in an Arc lamp.
Download the appropriate (check the 'LAMPID' header in the ARC fits file) line atlas from http://pysalt.salt.ac.za/lineatlas/lineatlas.html.
'''SPECIDENTIFY:''' The first step is to identify the wavelength solution from the arc images. This is done using SPECIDENTIFY. This can be run either in interactive or automatic mode, but as of now, it is suggested to run this in interactive mode. The inputs for this are an arc image and a line list. The line list may be either in ASCII format or FITS format with correct WCS header information. For best results, it is suggested to use a line list with flux information especially in automatic mode. For the data included in the tutorial, the following command will run SPECIDENTIFY:
SPECIDENTIFY images=mbxgpP201404190030.fits linelist=Ar.salt outfile=wav.db guesstype=rss
guessfile= automethod=Matchlines function=polynomial order=3 rstep=1
rstart=middlerow mdiff=20 thresh=3 niter=5 smooth=3 subback=0 inter=yes
startext=0 clobber=no textcolor=black preprocess=no logfile=salt.log
verbose=yes
This will run SPECIDENTIFY in interactive mode.
From here, the user can automatically match lines or interactively identify lines. To bring up the list of options, the user can type '?'. Here is the current list of available commands:
? - Print this file q - Quit the program
c - centroid on line x - print the current position
a - Display spectrum l - display features
b - identify features f - fit solution
p - print features P - print solution
z - zeropoint fit Z - find zeropoint and dispersion
r - redraw spectrum R - reset values
e - add closest line L - show detected peaks
d - delete feature u - undelete feature
After starting up, the task will load the arc spectrum from the central line into the Arc page. Navigate to this page by clicking on the tab, and you can display spectrum of the given line lamp by typing 'a'. The initial wavelength solution is provided by a model of the spectrograph when the guesstype is set to 'rss' and by typing 'z' in the Arc tab, a shift in the zeropoint of that solution will be calculated. The next step is to identify lines by the image. This can either be done manually by clicking on a line and typing 'x' to update the current position of the line or by typing 'c' to centroid on the line. The user can then update the wavelength value in the text box labeled 'w1' and then click 'add' to identify that line. By typing 'b', this can also be done automatically. Finally, with lines identified, the wavelength solution can be determined by fitting those lines by typing 'f'. An updated fit and solution can be viewed in the Error tab. If this process of identifying lines and fitting them is repeated, the user can determine the wavelength solution for this row in the arc image. Once the central row is determined, this solution can be used to fit all of the other lines by pressing the 'auto-identify' button on the Image tab.
'''SPECRECTIFY:''': The next step is rectify the images. We are going to apply the same wavelength calibration to the target observation. This can be done using specrectify
:
SPECRECTIFY images=m*fits outimages= outpref=x solfile=wav.db caltype=line
function=polynomial order=3 inttype=interp w1=None w2=None dw=None nw=None
blank=0.0 conserve=no nearest=no clobber=no logfile=salt.log verbose=yes
'''SPECSKY:''' Once the data have been wavelength calibrated, we can subtract the sky values from them. SPECSKY measures the sky in one region of the image and then subtracts it from the rest of the image. The user specifies the region for sky to be subtracted from. At this time, the sky measurements are not rescaled prior to removal.
SPECSKY images=xm*57.fits outimages= outpref=s method=normal section=[1100:1200]
function=polynomial order=3 clobber=no logfile=salt.log verbose=yes
'''SPECEXTRACT:''' Finally, to extract a 1-D wavelength correct spectra ASCII file, run SPECEXTRACT with the region to extract.
SPECEXTRACT images=sxmfxgbpP201205010025.fits outfile=spec.txt method=normal
section=[1006:1047] thresh=3.0 minsize=3.0 outformat=ascii ext=1 convert=yes
clobber=yes logfile=salt.log verbose=yes
'''Flux Calibration:''' If you wish to flux calibrate your data, you can run the following steps on the observations. First you have to sky subtract and extract the spectrophotometric standard in the same way as your target observations:
SPECSKY images=xmfxgbpP201205010057.fits outimages= outpref=s method=normal section=[1100:1200]
function=polynomial order=3 clobber=no logfile=salt.log verbose=yes
SPECEXTRACT images=sxmfxgbpP201205010057.fits outfile=star.txt method=normal
section=[1047:1072] thresh=3.0 minsize=3.0 outformat=ascii ext=1 convert=yes
clobber=no logfile=salt.log verbose=yes
Then create the calibration curve by applying the standard star measurement. These along with the site extinction are distributed with the pysalt package. They are included with the files for this tutorial. The airmass and exposure time are available in the header for the image.
SPECSENS specfile=star.txt outfile=star.cal stdfile= mltt4364.dat
extfile=suth_extinct.dat airmass=1.1889 exptime=60.2 stdzp=3.68e-20
function=polynomial order=15 thresh=3.0 niter=5 fitter=iterfit clobber=yes
logfile=salt.log verbose=yes
Finally, to return a relative flux calibrated spectra (the overall normalization may not be correct due to changes in the SALT pupil and vignetting), the calibration file has to be applied to the observations:
SPECCAL spec.txt outfile=spec_cal.txt calfile= mltt4364.dat
extfile=suth_extinct.dat airmass=1.1889 exptime=60.2 clobber=yes
logfile=salt.log verbose=yes