APOGEE DATA REDUCTION STEPS ------------------------------------------------------------------------------- Each step is performed by creating and executing a batch file. Each batch file requires one or more string vectors of filenames, as well as various function calls and keywords. ------------------------------------------------------------------------------- 0. TO START PIPELINE: a. Download, untar, and unzip program files from http://irtfweb.ifa.hawaii.edu/research/dr_resources/ b. Download Astro Users Library from http://idlastro.gsfc.nasa.gov/homepage.html c. Add library paths to those searched by IDL d. Execute astrolib.pro in IDL (or put in startup file) e. Create subdirectories for each step - Originals - Overscan subtraction (step 1) - Bias and Dark subtraction (step 2) - Flat-fielding (step 3-optional) - Cosmic ray removal (step 4) - Results (steps 5-7) 1. PERFORM OVERSCAN SUBTRACTION/REMOVAL a. Create batch file with the form: fin = ['file1.fits', 'file2.fits', ..., 'fileN.fits'] fout = ['file1.trm', 'file2.trm', ..., 'fileN.trm'] path = ['/input path/', '/output path/'] r1 = # of overscan columns to remove nix = n_elements(fin) FOR ii = 0, (nix-1) DO $ oversub, fin[ii], fout[ii], path=path, r1=r1 b. If the overscan region is not the last r1 columns, then it can be defined (up to 4 subregions r1-r4) by setting r1 = [min_column, max_column, min_row, max_row]. The elements of r1 define the region to remove. c. Set bsub keyword equal to: 0 to take the median pixel value in the overscan (default) 1 to take a 2nd order polynomial fit to median of each row d. Set nosub keyword if overscan value is not to be subtracted from the image. This is the case with Apogee Camera. e. Run overscan batch file 2. PERFORM BIAS AND DARK SUBTRACTIONS a. Create batch file with the form: darks = ['dark1.trm', 'dark2.trm', ...] bias = ['bias1.trm', 'bias2.trm', ...] others = ['file1.trm', 'file2.trm', ...] outfn = ['outputfn1.dbs', outputfn2.dbs', ...] path = ['/dark path/', '/bias path/', '/other path/', $ '/output path/'] debias, darks, bias, others, outfn, path=path b. If you wish to only debias, set darks = '' c. If bias set equal to '', then the bias level will be determined from the darks d. Run debias batch file 3. PERFORM FLAT-FIELDING (often not effective for Apogee Cam) a. Create superflat with im_flat.pro IDL> superflat, flats, fout, path b. Look at superflat with photcheck. If cosmic ray strikes still present, then perform step 4 on superflat. c. Create a batch file with the form: images = ['fname1.dbs', 'fname2.dbs', ...] superflat = 'sflat.ff' outfn = ['outfn1.ff', 'outfn2.ff', ...] path = ['/images path/', '/flat path/', '/output path/'] n = n_elements(images) for i = 0, (n-1) do $ image_math, images[i], superflat, outfn[i], 3, path d. Run flat-fielding batch file e. Use photcheck to see the effect of flat-fielding on the noise standard deviation. If it isn't improved (reduced) then don't use flat-fielded images. IDL> photcheck, filename, path, /stat 4. REMOVE COSMIC RAY STRIKES a. Determine standard deviation threshold and box size needed to remove cosmic ray strikes. This is done by running strike_out.pro at several theshold and box size values. IDL> strike_out, in_fn, out_fn, thresh, box, $ path=path, blink=1 Then look at results by setting blink keyword to 1. It can also be helpful to use photcheck to look at cleaned image. Brightest objects are likely to be most problematic. b. Once good threshold and box size numbers are found, create a batch file with the following form: in_fn = ['infile1', 'infile2', ...] out_fn = ['outfile1', 'outfile2, ...] thresh = threshold value (3 works well on Apogee) box = box size (3 works well on Apogee) path = ['/input path/', '/output path/'] n = n_elements(in_fn) FOR i = 0, (n-1) DO strike_out, in_fn[i], out_fn[i], $ thresh, box, path=path c. Run cosmic ray removal batch file. 5. PERFORM APERTURE PHOTOMETRY a. Create batch file with following form: img = ['reg_image1', 'reg_image2', ...] outfile = ['data_i1', 'data_i2', ...] path = [/img_path/', '/outfile_path/'] aper = [minimum, maximum, # of divisions] skyrad = [inner sky annulus, outer sky annulus] n = n_elements(img) for i = 0, (n-1) do $ flux, img[i], outfile[i], path, aper, skyrad b. If multiple objects are in the field then specify coordinates of desired object with peak keyword c. Execute batch file 6. ADD AIRMASS VALUES TO OUTPUT FILES Apogee software does not currently add telescope airmass to the FITS header. a. Create batch file with following form: fn =['fname1', 'fname2', ...] air = [air1, air2, ...] p = '/path/' n = n_elements(fn) for i = 0, (n-1) DO add_air, fn[i], air[i], p b. Run airmass batch file 7. SELECT APERTURE VALUE AND CREATE RESULTS FILE a. Create batch file with following form: infl = ['file1', 'file2', ...] outf = 'output_fn' p = '/path/' phot_results, infl, outf, aperture_size, path=p, /amc b. Run results batch file