Difference between revisions of "Using QL outputs"
(→Advanced notes for users wishing to code up their own routines using these output files) |
(→For IRAF users) |
||
(7 intermediate revisions by the same user not shown) | |||
Line 6: | Line 6: | ||
In going from the raw 2D images to the 1D extractions produce by the QL Tool: | In going from the raw 2D images to the 1D extractions produce by the QL Tool: | ||
* The x axis is flipped so that increasing wavelength runs in the same direction as increasing x | * The x axis is flipped so that increasing wavelength runs in the same direction as increasing x | ||
− | * The spectra are then trimmed to remove overscan, etc. | + | * The spectra are then trimmed to remove overscan, etc. |
+ | |||
+ | Remember: the WLC is only good to a couple of A. No rectification or spectral tracing has been performed. The arc extraction is the single, ''central'' row, and may not correpsond to the same spatial location as your science target. | ||
== For IRAF users == | == For IRAF users == | ||
− | Since most observers seem to have their own scripts from the old version of the spectrograph, the easiest way to reduce the data is to use the QL wavelength calibrated outputs as a reference for an IRAF reduction of the raw data. | + | Since most observers seem to have their own scripts from the old version of the spectrograph, the easiest way to reduce the data is to use the QL wavelength-calibrated outputs as a reference for an IRAF reduction of the raw data. |
+ | |||
+ | This assumes familiarity with reducing longslit data in IRAF. Phil Massey's guide is an excellent reference: http://iraf.noao.edu/iraf/ftp/iraf/docs/spect.ps.Z | ||
i.e. | i.e. | ||
Line 24: | Line 28: | ||
identifyAll.png|After matching ~5 lines, fitting, and pressing 'l' to auto-identify the rest | identifyAll.png|After matching ~5 lines, fitting, and pressing 'l' to auto-identify the rest | ||
</gallery> | </gallery> | ||
− | * Once you have identified the lines in one aperture, repeat for every nth pixel (probably every 5th pixel is fine, the tilt is about 0. | + | * Once you have identified the lines in one aperture, repeat for every nth pixel (probably every 5th pixel is fine, the tilt is about 0.06 pixels per pixel) using '''reidentify'''. |
* Run '''fitcoords''' on the database produced by reidentify | * Run '''fitcoords''' on the database produced by reidentify | ||
* Run '''transform''' on the image using the fitcoords database to produce a wavelength-calibrated, rectified 2D arc. | * Run '''transform''' on the image using the fitcoords database to produce a wavelength-calibrated, rectified 2D arc. | ||
* This solution may now be copied to other images and science data extracted in the standard way! | * This solution may now be copied to other images and science data extracted in the standard way! | ||
+ | <gallery> | ||
+ | transformArc.png|images pre(top)- and post(bottom)- rectification and WLC | ||
+ | </gallery> | ||
− | + | You may download the linelists used for the automatic wavelength calibration, or use your own: [[media:CuAr.lis|CuAr]], [[media:CuNe.lis|CuNe]] | |
=== Advanced notes for users wishing to code up their own routines using these output files === | === Advanced notes for users wishing to code up their own routines using these output files === | ||
Line 54: | Line 61: | ||
imcopy test.fits[99:2146,*] out65.fits<br /> | imcopy test.fits[99:2146,*] out65.fits<br /> | ||
[Note the 1-based indexing] | [Note the 1-based indexing] | ||
+ | |||
+ | MORE DETAILS TO FOLLOW |
Latest revision as of 14:15, 22 December 2016
Contents
Overview
The QL Tool produces quick-look products, but there are some straightforward steps allowing users to use these as a starting point for their science quality reductions
Important Notes
In going from the raw 2D images to the 1D extractions produce by the QL Tool:
- The x axis is flipped so that increasing wavelength runs in the same direction as increasing x
- The spectra are then trimmed to remove overscan, etc.
Remember: the WLC is only good to a couple of A. No rectification or spectral tracing has been performed. The arc extraction is the single, central row, and may not correpsond to the same spatial location as your science target.
For IRAF users
Since most observers seem to have their own scripts from the old version of the spectrograph, the easiest way to reduce the data is to use the QL wavelength-calibrated outputs as a reference for an IRAF reduction of the raw data.
This assumes familiarity with reducing longslit data in IRAF. Phil Massey's guide is an excellent reference: http://iraf.noao.edu/iraf/ftp/iraf/docs/spect.ps.Z
i.e.
- Perform all the pre-processing steps as you would normally on the raw 2D data.
- When you are ready to wavelength calibrate an arc, do so as follows:
- Use the QL output as a reference. For example, a useful way is to plot the ascii wavelength solution in some interactive plotting window, like python.
- Then simply, select a few bright, well-spaced lines, hover the cursor over them, and read off the wavelength coordinate.
- Now, run IRAF - twodspec - identify on the corresponding raw 2D image. Select the same line and input its wavelength as just read off the plot. The solution is good to within a couple of Angstroms, and there are sufficient lines in the arcs that this should work well. Hint: remember that the raw and 1D Extracted spectra are flipped. A good trick is to reverse the plot window in IRAF with 'w' 'e' 'e' by selecting from bottom right to top left
- Repeat for several lines.
- When happy, automatically add all the lines (press "l").
- Once you have identified the lines in one aperture, repeat for every nth pixel (probably every 5th pixel is fine, the tilt is about 0.06 pixels per pixel) using reidentify.
- Run fitcoords on the database produced by reidentify
- Run transform on the image using the fitcoords database to produce a wavelength-calibrated, rectified 2D arc.
- This solution may now be copied to other images and science data extracted in the standard way!
You may download the linelists used for the automatic wavelength calibration, or use your own: CuAr, CuNe
Advanced notes for users wishing to code up their own routines using these output files
After flipping, the spectra are then trimmed to remove overscan, etc.
The exact values for these are stored in:
/usr/local/etc/qlgui/pars.json
"badMax0": 98,
"badMin1": 2145,
in python 0-based numbering.
i.e. in python, to reproduce the same transformation, one would do:
from astropy.io import fits
import numpy as np
im2D = fits.getdata('image.fits')
im2D = np.fliplr(im2D[:,::-1])[:,98:2145]
fits.writeto('outimage.fits',im2D)
This image could then be used for a fresh extraction using IRAF or the user's preffered package, and will be one-to-one pixel aligned with the [approximate] WLC from the 1D extracted arc.
In IRAF, the equivalent would be:
imcopy a0361665[-*,*] test.fits
imcopy test.fits[99:2146,*] out65.fits
[Note the 1-based indexing]
MORE DETAILS TO FOLLOW