Default Data Reduction Steps
The default data reduction steps in 'reduce_red_data.py' and 'reduce_blue_data.py' are outlined below. Most “steps” are numbered by the number of actual operations on data (e.g. step “1” ends when raw data goes through its first processing, and so on). Sub-steps consist of the calibration calculations performed after the conclusion of the previous step, and the final sub-step is always when a new processing of data occurs (e.g., step 3 consists of numerous calibration steps that occur after bias subtraction at the end of step 2, but before creation of multi-extension fits – MEF – files at the end of step 3).
Below is an itemized list of the default data reduction steps, along with the PyWiFeS function that is used to perform the data processing of that step. We also include a brief description of what each step does. For some steps where the PyWiFeS function is similarly named for the red and blue channels e.g. (repair_red_bad_pix and repair_blue_bad_pix), we name the red channel function for simplicity. Steps which do not operate on science data but instead only create or process master calibration files are labeled as CAL.
Step # | Step Name | Primary PyWiFeS Routine | Description |
---|---|---|---|
00 | 'overscan_sub' | subtract_overscan | Subtracts overscan from raw FITS image. |
01 | 'bpm_repair' | repair_red_bad_pix | For the WiFeS 2nd Generation detectors, interpolates over the bad pixels. |
CAL | 'superbias' | imcombine, generate_wifes_bias_fit | Creates super-bias from bias frame co-add, then fits a smooth model of the bias shape across entire detector. |
02 | 'bias_sub' | imarith | Subtracts master bias (or local bias) from science frames. |
CAL | 'superflat' | imcombine | Co-adds all flats (standard: median coadd).A |
CAL | 'slitlet_profile' | derive_slitlet_profiles | Uses flat lamp to measure slitlet locations. |
CAL | 'flat_cleanup' | interslice_cleanup | Corrects contamination of flat lamp and sky flat data for internal light reflections inside the instrument. |
CAL | 'superflat_mef' | wifes_slitlet_mef | Converts cleaned-up superflats into MEF files. |
03 | 'slitlet_mef' | wifes_slitlet_mef | Converts all science frames into MEF files. |
CAL | 'wave_soln' | derive_wifes_wave_solution | Derives wavelength solution from arc lamp data, by default using the WiFeS optical model. |
CAL | 'wire_soln' | derive_wifes_wire_solution | Derives spatial zeropoint in the y-direction (along slitlet) from a wire frame. |
CAL | 'flat_response' | wifes_2dim_response | Uses lamp flat, sky flat, and wavelength solution to derive flatfield response function for all slitlet. |
04 | 'cosmic_rays' | lacos_wifes | Identify and correct cosmic rays using the LA Cosmic procedure developed by Pieter van Dokkum, as adapted to work with WiFeS data. |
05 | 'sky_sub' | imarith | Raw subtraction of sky frame from science frame, or sky pixels from object pixels in nod-and-shuffle (appropriately scaled for exposure time).B |
06 | 'obs_coadd' | imcombine | Co-add multiple observations of the same object or field, as defined by the metadata structure. |
07 | 'flatfield' | imarith | Divide science data by the flatfield response function. |
08 | 'cube_gen' | generate_wifes_cubes | Rectify data onto square (x,y,λ) grid to create final data cube. |
CAL | 'extract_stars' | extract_wifes_stdstar | Automatically extract standard star spectrum from WiFeS data cube (uncalibrated). |
CAL | 'derive_calib' | derive_wifes_calibration | Derive instrument sensitivity function from comparison of observed standard star fluxes to reference spectra.C |
09 | 'flux_calib' | calibrate_wifes_cube | Flux calibrate the data by applying instrument sensitivity function to science frames. |
CAL | 'extract_stars' | extract_wifes_stdstar | Automatically extract standard star spectrum from WiFeS data cube (calibrated, but not telluric-corrected). |
CAL | 'derive_telluric' | derive_wifes_telluric | Derive telluric feature corrections from flux-calibrated spectra of smooth-spectrum standard stars. |
10 | 'telluric_corr' | apply_wifes_telluric | Correct telluric absorption in all science frames. |
11 | 'save_3dcube' | generate_wifes_3dcube | Convert fully calibrated data into standard 3D fits data format, as preferred for ds9. |
A “Superflat” procedures performed for both spectral (quartz lamp) flats and spatial (twilight) flats.
B Currently this step is a strict subtraction of object data and sky data (either “point-and-stare” or “nod-and-shuffle”). This is planned to be moved to after flat-fielding once a sophisticated sky-subtraction model procedure has been devised (part of PyWiFeS “Phase 2”).
C Identification of standard star spectra is done automatically by name matching from the 'OBJECT' header field to the list of stars in 'wifes_calib.py'. Alternatively users can set the name of the standard stars in their calibration list manually. Plans for PyWiFeS “Phase 2” include automatic identification based on target coordinates.