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.
Reduce!

All of the reduction steps are run by the code long_reduce
    Example: IDL> long_reduce, 'plan.par'

    This routine:
  1. Stacks and process the flats
  2. Identifies the edges of the longslit
  3. Calibrates the various arc images
  4. Processes the science frame (flattens)
  5. Finds/traces objcets within the slit
  6. Extracts using a non-parameteric optimal extraction algorithm
The correct sequence for setting up the reductions is as follows:

The pipeline outputs the following calibration files:

Reduction Products
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:

Science Products
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:

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