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" |
3 |
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. It attempts to guess the 'type' of
each frame (e.g. arc, domeflat, science).
Example: IDL> long_plan, '*.fits*', 'Raw/'
- Edit the plan file (default: plan.par)
- Consider copying plan.par to a new file
- For longslit observations, slitthresh is automatically set in the code to be 0.10. For multislit observations you may specify your own value of slitthresh by including this parameter in the plan file. The default for multislit observations is currently 0.02. For short slits, lower slitthresh as necessary.
- Remove unwanted images from the .par file.
- Inspect and edit the image types for the various exposures. (Listed in column 3 in the plan file)
For the LRIS spectrometer there are 5 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.
Note: The code currently attempts to distinguish between domeflats and twilight flats by considering the time the exposures were taken and the position of the dome slit relative to the pointing. There is no header keyword that specifies the dome lamps being on or off. Therefore, pay extra attention to these files to make sure they are labelled correctly.
|
twiflat |
Flats used to calibrate the larger scale variations
(i.e. greater than 5 pixels) in the illumination pattern of the CCD.
Spectrum of the twilight sky through the longslit or slitmask.
|
iflat |
Flats used to calibrate the pixel-to-pixel variations in the CCD. Domeflats are always preferred to minimize scattered light, but internal flats can be used if necessary.
|
bothflat |
If the user specifies this designation,
the flat image will used for both pixel and illumionation corrections
(i.e. it will be treated as a domeflat and a twiflat simultaneously).
This is useful in cases where twiflats were not taken and the user
wishes to make an illumination correction.
|
science |
Spectrum of an astronomical object.
This includes 'standard stars'.
|
std |
If the user specifies this designation,
this frame will be used as a crutch for tracing other objects.
It will be reduced as if it were a science frame.
|
- Insure that the necessary calibration files exist. Files of 'arc' type are always needed. In addition, it is ideal to have both domeflat (or iflat) and twiflat files for each grating/grism/slit combination; this gives the best calibration of pixel-to-pixel variations in the CCD and illumination function. However, if only domeflats are available, these may be used for both the pixel-to-pixel calibs and the illumination calibs by changing the 'domeflat' type to 'bothflat' in the plan file.
Reduce!
All of the reduction steps are run by the code
long_reduce
Example: IDL> long_reduce, 'plan.par'
This routine:
- 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 correct sequence for setting up the reductions is as follows:
- The blue-side calibration takes a bit more work than the red side.
- First you need to make a separate .par file that includes all images of the sky without a slit mask (name this file slitless.par).
- Edit the image types of these observations to all be "domeflat"
- Run long_reduce with your slitless.par file
- In your plan.par file insure that you include one of the files that you used in your slitless.par file, again insuring that its image type is changed to "domeflat".
- Run long_reduce with your plan.par file. Be sure to include your twilight flats that were taken with the slit in labelled as "twiflat".
- The Redside is much simpler, you only need to use the dome flats. Be sure to change the file types in your plan.par file to "bothflat"
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.
|
Tip: If you have longslit science frames with no bright objects in the slit AND if you have standard star data, it is a good idea to re-run long_reduce after deleting the science frames and keeping the reduced standard frames. Re-run like this:
Example: IDL> long_reduce, 'plan.par', filestd='Science/sci-lred0044.fits.gz'
This will use the standard star frames as a first guess at the trace when extracting faint objects from your science data.
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 and a corresponding list of object ID numbers, 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. But we could have set
objid to [3,4] if we wanted to coadd the 3rd object from the first
science frame and the 4th object from the second science frame. 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, sens_file, std_name=std_name)
Example: IDL> bsens = long_sensfunc('Science/sci-b257.ccd.fits', 'Flux/feige34_bsens.fits', std_name='feige34_005',/MSK_BALM)
Note that you are recommended to mask the balmer lines. 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,
coadded_data_file, SENSFUNCFILE=sens_file, OUTFIL=fluxed_data
Example: IDL> long_fluxcal, 'FSpec/J0905+1014_b.fits', SENSFUNCFILE='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
Note that the fluxed spectrum is in units of F_lambda, and needs to be multiplied by a scaling factor of 10^17.
Last modified 2009-10-21