@(#)README 1.15 01/29/99 13:23:15 Nicmos Reduction Software v1.8 B. McLeod and J. Lehar ------ --------- -------- Harvard-Smithsonian Center for Astrophysics This describes a set of tools to aid in the reduction of HST/NICMOS multiaccum data. They are available from http://cfa-www.harvard.edu/castles/Nicred The software is packaged as an IRAF package called nicred. IRAF v2.11 is required. This software was developed as part of CASTLeS -- the CfA-Arizona Space Telescope Lens Survey, http://cfa-www.harvard.edu/castles If you make use of these programs in a published paper, please cite the following papers: McLeod, B. 1997, in 1997 HST Calibration Workshop, ed. S. Casertano et al., p. 281 Lehar, J., Falco, E. E., Impey, C. D., Kochanek, C. S., McLeod, B. A., Rix, H.-W., Keeton, C. R., Munoz, J., and Peng, C. Y. 1999, ApJ, in prep. Updated versions of the citation will appear in future releases of this README. If you have problems or suggestions, send email to bmcleod@cfa.harvard.edu If you make improvements to the software, I'd appreciate a copy. See doc/nicred.ps in this distribution for a copy of McLeod (1997). Changes between v1.7 and v1.8: -- Linearity correction: We discovered a problem with the non-linearity correction in bright sources. Our brute-force approach has been to reduce signifacantly the saturation level, down to the level where previously the linearity correction kicked in. I.e. any readout which previously required a linearity correction is now marked as saturated. We have found this approach to be successful, but it is probably overkill. To use the old files, copy them from $nicred/Marciaold to $nicred/Marcia. -- Various changes to nicreduce, including elimination of the magnified mask, more flexibility regarding the weighting of the images in the final combination, user specified magnification factor, and others described below. Changes to nicreduce: -- the parameters "maskplfile" and "mask2file" have been combined into a single "maskfile" parameter. This should be the unmagnified mask. nicreduce now handles magnifying the mask file if necessary. -- new parameter "dolinfit". This optional step allows for a more drastic attempt than "domedian" to correct for residual flatfielding/skysubtraction errors. After rejecting low and high pixels from the image, a linear fit is done to each row and then to each column of each quadrant of the image. Default is "no" -- new parameter "doskydark". This optional step allows for the subtraction of the median of all the images from each image. Useful for improving background subtraction when a good dark frame is not available. Default is "no" -- new parameter "setcomb". This mandatory step allows you to delete images from the list to be combined. Default is "yes". -- new parameter "doweight". In the final combination, if doweight is "yes" the images will be weighted by the RMS value in the cursor specified region. If "no", then weighting will be done by exposure time. Default is "yes". Our experience is that for looking for faint objects, we use "yes", for good psf subtraction of bright pointsources, use "no". -- new parameter "magfactor". Formerly all images were magnified by a factor of 2, now the magification factor is specified here. For no magnification, you must set this parameter to 1, and still use domagnif=yes. Default=2. -- new parameter "nskyrej". Number of high pixels to reject in "doskydark". UPGRADE INSTRUCTIONS (from v1.7) ------- ------------ The changes involve a new set of saturation files, a new version of nicreduce.cl, and updated documentation. cd $nicred cp -r Marcia Marciaold (if desired) tar xf nicredupgrade1.7-1.8.tar Thats it! INSTALLATION INSTRUCTIONS ------------------------- * Unpack the tar file: tar xf nicred.tar This will create a subdirectory called Nicred * Compile cd Nicred/fitsy make cd .. make For a personal IRAF installation: * Add the following to your IRAF login file: # nicmos reduction package reset nicred = /data/kk3/NICMOS/Nicred/ # put your path here task $nicred.pkg = nicred$nicred.cl printf ("reset helpdb=%s,nicred$lib/helpdb.mip\nkeep\n", envget("helpdb")) | cl flpr OR, for a site-wide IRAF installation: * Add the following to hlib$extern.pkg: reset nicred = /data/kk3/NICMOS/Nicred/ # put your path here task $nicred.pkg = nicred$nicred.cl * Add the following to the end of the helpdb section of extern.pkg, before the final quote: ,nicred$lib/helpdb.mip\ * Optionally add/modify the following to your login.cl or loginuser.cl reset niccal = /path/to/your/darks/and/flats * Add the following to your .cshrc file (with the correct path substituted for /data/kk3/NICMOS/Nicred ) set nicred = /data/kk3/NICMOS/Nicred set path = ($path $nicred) setenv NICMOSCALIB ${nicred}/Marcia To access the scripts, restart IRAF and type "nicred" at the cl prompt. You'll also need to load the STSDAS "tables" package. 1) Top level scripts There are two top-level scripts which "do it all", much in the vein of ccdproc or apall. Like those tasks, if you get everything right you can reduce a data set with just one call to the script. In practice we find that we often go back and repeat steps. nicreduce.cl -- Top level script for all out reduction. The steps are: dark subtraction initial multiaccum fitting optional correction of pedestal effect optional second multiaccum fitting flat fielding magnification shifting and combining Type "help nicreduce" from IRAF for a more detailed description. nicskydark.cl -- Do the Archive darks just not work well enough? Make your own sky+dark frames! This median-combines a list of dithered multiaccum sequences to make a "skydark" frame, which you would then use in nicfast, or nicreduce. 2) Secondary Iraf scripts multiplot3.cl -- This script makes a plot of all the multiaccum samples for a given pixel vs either time or image number. The pixel is selected by positioning image cursor and hitting a key. It plots the cr rejection fit to the data in addition to the data points. Unlike in fullfitbam, saturation is not dealt with properly here. Example: display coolimage.fits[SCI,1] 1; multiplot3 coolimage.fits darksub.cl -- Subtract the first (in time, last in the file) mutiaccum frame from all the rest and then subtracts the specified dark file, frame by frame. multicomb.cl -- Script to run imcombine on each frame of a multiaccum sequence, producing a combined multiaccum file. I've used this script to generate a median sky frame, which I've used instead of the library dark frame (see nicskydark). All the imcombine parameters must be set directly in the imcombine parameter file before running multicomb. imsub.cl -- Subtract one multiaccum sequence from another, producing another multiaccum file. Similar to darksub, but it skips the step of subtracting the t=0 frame. zeroreadsub.cl -- Subtract the zeroth read from a multiaccum sequence. nicbias.cl -- Correct the bias levels in a multiaccum sequence. nicred.cl -- Package script. see installation instructions below 3) Multiaccum reduction program. fullfitbam.c -- This is a version of Marcia Rieke's fullfit.c which fits the multiaccum frames to get a single cosmic-ray rejected image. 4) Flat fielding program to correct for bias error. Nicmos multiaccum exposures taken before August 21 1997 suffer from a wandering bias level. The result is that the final image that comes out of fullfitbam is the sum of the true image and a constant. If you were to multiply by the flat, you would see the flat in reverse in the final image due to the constant offset. The program "nicflatten" does a least squares fit to the sky region of an image to minimize image - c1 * flat - c2. The output of this program is the residuals of the fit multiplied by the flat, i.e. a bias-corrected, sky-subtracted, flattened image. The results are considerably better than using the flat alone.