Cookbook for Keck/LRIS Reductions
BACK
This page describes the types of calibrations recommended
(or required) to use the Low-Redux pipeline to reduce data
acquired with the longslit Kast spectrometer.
Calibrations:
AFTERNOON+TWILIGHT: The following table summarizes the recommended calibration
exposures for the grisms+gratings supported within the Low-Redux pipeline.
Binning: For the blue-side observations, we
present values assuming binning 2x2 (spatialxspectral). We recommend
this level of binning when using the 1200 grism to reduce the readnoise
by a factor of sqrt(4)=2. For a 1" slit, binning by 2 in the spectral
dimension implies a sample of 4 pixels.
The spatial plate-scale on the blue-side is 0.135" per native pixel.
Therefore, 2x binning will lead to Nyquist sampled seeing only for
FWHM ~ 0.6".
Flat fielding: Our approach for flat fielding these
spectroscopic observations is to divide up the flat fielding
into a pixel-flat which represents the intrinsic pixel-to-pixel
response variations of the CCD (i.e. the
response to a smooth source), and an illumination flat,
which represents the larger scale illumination variations due
to non-uniformities in the width of the slit, vignetting, etc.
This separation is clearly not perfect, but our experience is
that the illumination flats significantly improve sky subtraction.
The pixel-flat for the blue-side is constructed in a novel manner
for the high resolution grisms.
One observes the twilight sky
with the grism in place but without a slitmask (i.e. "direct").
This smears the solar spectral features sufficiently that the
flat can be properly normalized before applying a
pixel-to-pixel correction. We use the twilight sky because
the internal and dome lamps both emit too little UV light.
Although one might record a few thousand counts with these lamps,
we have confirmed that this is dominated by scattered red
light (e.g. one observes fringing!).
For the red side, dome flats are better than internal flats for
correcting the pixel-to-pixel variations because they reduce the
level of scattered light. However, one may desire to take internal
flats on the sky during the night (or twilight) to remove fringing.
The same dome flats can be used for the illumination correction
although observations at twilight may be preferable.
| Blue Side Calibrations (2x2 Binning) |
| Type |
Grism |
Lamp(s) |
Slit |
Exp |
NExp |
Notes |
| Arc |
Any |
All |
1" |
10 |
2 |
IMPORTANT: One should wait ~5min for the Zn+Cd lamps to warm up.
|
| Illum+PixelFlat |
300/5000 |
Twilight |
1" |
10 |
5 |
Keep peak under 40,000 DN. This set of exposures is
used for both pixel-to-pixel and illumination calibration.
WARNING: This procedure is not well tested. |
| IllumFlat |
600/4000 |
Twilight |
1" |
XX |
3 |
Take very near sunset (or sunrise).
Aim for peak counts of ~30,000 DN |
| IllumFlat |
1200/3400 |
Twilight |
1" |
XX |
3 |
Take very near sunset (or sunrise).
Aim for peak counts of ~30,000 DN |
| PixelFlat |
600/4000 |
Twilight |
None! |
XX |
3 |
Slitless. Take very near sunset (or sunrise).
Aim for peak counts of ~30,000 DN |
| PixelFlat |
1200/3400 |
Twilight |
None! |
XX |
3 |
Slitless. Take very near sunset (or sunrise).
Aim for peak counts of ~30,000 DN |
| Red Side Calibrations (1x1 Binning) |
| Type |
Grating |
Lamp(s) |
Slit |
Exp |
NExp |
Notes |
| Arc |
Any |
All |
1" |
1s |
2 |
|
| Illum+PixelFlat |
300/7500 |
Dome/Spec |
1" |
8 |
7 |
Keep peak under 40,000 DN. This set of exposures is also
fine for pixel-to-pixel calibration. |
| Illum+PixelFlat |
600/7500 |
Dome/Spec |
1" |
30 |
7 |
Keep peak under 40,000 DN. This set of exposures is also
fine for pixel-to-pixel calibration. |
| Illum+PixelFlat |
600/10000 |
Dome/Spec |
1" |
240 |
7 |
Keep peak under 40,000 DN. This set of exposures is also
fine for pixel-to-pixel calibration. |
| Illum+PixelFlat |
1200/7500 |
Dome/Spec |
1" |
50 |
7 |
Keep peak under 40,000 DN. This set of exposures is also
fine for pixel-to-pixel calibration. |
TWILIGHT+NIGHTTIME: In addition to these calibrations, if one wishes to flux the
spectra it is necessary to observe a spectrophotometric standard
with the same instrument configuration. Furthremore, it is
best if one chooses from the CALSPEC list of standards which can
be found here: $XIDL_DIR/Spec/Longslit/calib/standards/calspec
Organizing the Data
The first steps are to organize your data, create a plan file,
and edit it as necessary.
- Organize the data
- Create a 'Raw' directory -- mkdir Raw
- Place all of the Raw frames in the Raw directory
- gzip the files (optional)
- Create the plan file
- Launch IDL from above the Raw directory
- Run long_plan :: This
code parses the headers of each raw file and creates an ASCII file
which summarizes the data. The attempts a guess at the 'type' of
each frame (e.g. arc, domeflat, science).
Example: IDL> long_plan, '*.ccd*', 'Raw/'
- Edit the plan file (default: plan.par)
- Consider copying plan.par to a new file
- Edit slitthresh to be 0.10
- Remove unwanted images from the .par file
- Insure that there are both arc and domeflat files for each
grating/grism/slit combination.
- Inspect+Edit the image types for the various exposures.
For the LRIS spectrometer there are 4 types of interest:
| Type |
Description |
| arc |
Exposure of the arc lamps taken with the instrument
configured for spectroscopy (slit + dispersing elements).
|
| domeflat |
Flats used to calibrate the pixel-to-pixel variations
in the CCD. Blue side: At high dispersion (600 or 1200 grism), one
should observe the twilight sky without a slit. This is the only means
of getting enough blue counts in a spectrum that does not have sharp
features. At lower dispersion (300 grism), one can acquire a dome flat.
Red Side: One obtains 'standard' dome flats.
|
| twiflat |
Spectrum of the twilight sky (blue side) or of
the dome (red side) through the longslit or slitmask.
|
| iflat |
Internal flat used for pixel-to-pixel corrections
(not illumination). Dome flats are always preferred to minimize
scattered light.
|
| science |
Spectrum of an astronomical object.
This includes 'standard stars'.
|
Reduce!
All of the reduction steps are run by the code
long_reduce :: This
routine
Example: IDL> long_reduce, 'plan.par'
- Stacks and process the flats
- Identifies the edges of the longslit
- Calibrates the various arc images
- Processes the science frame (flattens)
- Finds/traces objcets within the slit
- Extracts using a non-parameteric optimal extraction algorithm
The pipeline outputs the following calibration files:
| Name |
Description |
| pixflat-xxx |
FITS file generated from the domeflats which corrects for
pixel-to-pixel variations in the CCD.
|
| illumflat-xxx |
Flat frame used to correct for imperfections in the slit
width along the slit-length.
|
| profile-xxx |
Binary FITS table containing the object profile used
for optimal extraction. In particular, the tag .profile contains an
image of the profile.
|
| slits-xxx |
Binary FITS table containing the parameters which
describe the slit edges.
|
| wave-xxx.fits |
FITS image of the wavelength array created by the code.
|
| wave-xxx.ps |
Postscript file showing the results from the 1D arc
solution.
|
Primary Science Product
The primary science products are written a multi-extension
FITS file in the Science/ directory. One file is written
per exposure. This table describes the various extensions:
| Extension |
Description |
| 0 |
Processed 2D image of the data.
|
| 1 |
Inverse variance |
| 2 |
Sky model |
| 3 |
Model of the object flux |
| 4 |
Mask of good/bad pixels |
| 5 |
Structure array (one per object identified in the
slit). The key tags are: wave_opt, flux_opt, ivar_opt, wave_box,
flux_box, ivar_box.
|
One can examine the 1 and 2D spectra extracted from each
data frame using the following steps:
- cd Science
- UNIX> idl
- IDL> .run long_look
This will launch a GUI list of all the sci-*.fits.gz files in the
current directory.
- Choose the sci-* file that you want from the GUI list
This will launch a view of the 2D image (using the IDL task atv).
After completing the step described below, you can use this Image display
GUI to examine the 2D spectrum.
A postscript file summarizing the S/N of the various extracted spectra is shown
and also a GUI list of the objects in the frame indexed slit-object
(e.g. 1-2 for slit 1 and object #2 in the slit).
- Choose an object from the GUI list
This will launch an x_specplot GUI that the user can use
to examine the 1D spectrum. At this point the xatv window will now
be active. The wavelength of the cursor position is printed in the
xatv window next to the pixel number.
- Play with the two GUI's.
Coadd
As you will note, the multi-extension FITS file that contains
the spectra are not especially easy to handle. Furthermore, it
is common that a user will wish to coadd multiple exposures of
a given object. This is accomplished with the task
long_coadd :: This
routine takes as input a list of sci- files, chooses a
wavelength array for registration, and coadds weighting by the
square of the median S/N ratio (or exposure time).
Call: IDL> long_coadd, files, objid, OUTFIL=name
Example: IDL> long_coadd, ['sci-b263.ccd.gz', 'sci-b265.ccd.gz'], 1, OUTFIL='FSpec/J0905+1014_b.fits'
In the above example, we have set objid=1 to indicate that we
wish to coadd the first object identified in the slit.
The output file (e.g. FSpec/J0905+1014_b.fits) is a multi-extension
FITS array containing three extension:
0=flux array; 1=sigma array; 2=wavelength array.
One can inspect the data using the XIDL routine x_specplot.
Example: IDL> x_specplot, filename, inflg=2
Flux
Fluxing is relatively straightforward. One includes a calibration
standard in the plan.par file and the code will reduce the data
in a similar fashion as the science exposures. One does NOT apply
the COADD algorithm, but skips to this task
long_sensfunc :: This
algorithm requires that one use one of the standards included
in the Longslit package (contact JH or JXP to add a new file).
These files are found here: $XIDL_DIR/Spec/Longslit/calib/standards/calspec.
WARNING: Most of these standards are only calibrated to 9200A and the
code will truncate the data at larger wavelength.
Call: IDL> sens = long_sensfunc( sci_file, calib_name, sens_file)
Example: IDL> bsens = long_sensfunc('Science/sci-b257.ccd.fits', 'feige34_005', 'Flux/feige34_bsens.fits')
With a sensitivity function in hand, the final step is to apply
it to the science spectra. This is accomplished with
long_fluxcal :: This
code simply notes the exposure time and applies the sensitivity
function. It also corrects for differences in the airmass of the
two exposures assuming an extinction function appropriate for KPNO.
Call: IDL> long_fluxcal,
data_file, sens_file, OUTFIL=fluxed_data
Example: IDL> long_fluxcal, 'FSpec/J0905+1014_xb.fits', 'Flux/feige34_bsens.fits', OUTFIL='FSpec/J0905+1014b_XF.fits'
One can inspect the data using the XIDL routine x_specplot.
Example: IDL> x_specplot, filename, inflg=2
Last modified 2007-5-11