Current as of 3/19/02 [Buell--there is very little "why" or "text" in this outline. It's just a cookbook style step by step (which I actually prefer in a manual, but many people prefer lots of theory and explanations and options); but the parameters are all current and correct. Frank has seen this and has added his corrections comments so it's ready to go. I just re-tested it with the latest 2.12 so all should be well. This completes our official testing of the new automated software and Iraf 2.12. So we can now "safely" write the manual. I'm free to work on that whenever you like. Jenna] [This replaces the "Towards a More Perfect Flatfield" section of the manual]: In V2.11.3 the default mask type is pl files in a subdirectory and masks in multi-extension fits files are not available. In V2.12 the default masks in multi-extension fits files. To use pl files in subdirectories do "set masktype = pl". (to "unset" this you can "set masktype = fits" which is the default for 2.12) ***Load nproto before proceeding!!!! [Buell- Frank mentioned that he would incorporate this into the start up of mscred, but I left it in here just to be safe.] ... proceeding... epar objmask images = "@obj.list" List of images or MEF files objmasks = "@om.list" List of output object masks (omtype = "numbers") Object mask type (skys = "@sky.list") List of input/output sky maps (sigmas = "") List of input/output sigma maps (masks = "!BPM") List of input bad pixel masks (extnames = "") Extension names (logfiles = "STDOUT") List of log files\n (blkstep = 1) Line step for sky sampling (blksize = -10) Sky block size (+=pixels, -=blocks) (convolve = "block 3 3") Convolution kernel (hsigma = 3.) Sigma threshold above sky (lsigma = 10.) Sigma threshold below sky (hdetect = yes) Detect objects above sky? (ldetect = no) Detect objects below sky? (neighbors = "8") Neighbor type" (minpix = 6) Minimum number of pixels in detected objects (ngrow = 2) Number of grow rings (agrow = 2.) Area grow factor (mode = "ql") Where om.list: and sky.list: om092 sky092 om093 sky093 om094 sky094 om095 sky095 om096 sky096 om097 sky097 om098 sky098 etc. etc. objmask combines the existing BPM masks with the new objects it finds while making object masks. This causes the bad columns and rows to show up in your images which may alarm you, but they will be accounted for with fixpix later on. There's no data there and they should have a pixel value of 1 so there should be no division by zero issues. Make your first skyflat using sflatcombine: epar sflatcombine input = "@obj.list" List of images to combine output = "SflatV1" Output sky flat field root name (combine = "average") Type of combine operation (reject = "ccdclip") Type of rejection (ccdtype = "object") CCD image type to combine (optional) (subsets = yes) Combine images by subset? (masktype = "!objmask") Mask type (maskvalue = 0.) Mask value (scale = "mode") Image scaling (statsec = "") Image section for computing statistics\n (nkeep = 1) Minimum to keep (pos) or maximum to reject(neg (nlow = 1) minmax: Number of low pixels to reject (nhigh = 1) minmax: Number of high pixels to reject (mclip = yes) Use median in sigma clipping algorithms? (lsigma = 6.) Lower sigma clipping factor (hsigma = 3.) Upper sigma clipping factor (rdnoise = "rdnoise") ccdclip: CCD readout noise (electrons) (gain = "gain") ccdclip: CCD gain (electrons/DN) (snoise = "0.") ccdclip: Sensitivity noise (fraction) (pclip = -0.5) pclip: Percentile clipping parameter (blank = 1.) Value if there are no pixels\n (grow = 3.) Radius (pixels) for neighbor rejection (mode = "ql") Make sure the objmask keyword in your headers is correct. Running objmasks should update it properly. [Buell, I forgot to time how long it takes sflatcombine to combine 25-30 images but it takes a couple hours at least]. Now you need to make the pupil template from this combined sky image, SflatV1I.fits. Use mscpupil: mscpupil input = "SflatV1I.fits" List of input images output = "PupilI.fits" List of output images (masks = "") List of masks (type = "data") Output type (lmedian = no) Subtract line-by-line median? (xc = 27.) Pattern center offset (pixels) (yc = 9.) Pattern center offset (pixels) (rin = 300.) Radius of inner background ring (pixels) (drin = 20.) Width of inner background ring (pixels) (rout = 1500.) Radius of outer background ring (pixels) (drout = 20.) Width of outer background ring (pixels) (funcin = "chebyshev") Inner azimuthal background fitting function (orderin = 2) Inner azimuthal background fitting order (funcout = "spline3") Outer azimuthal background fitting function (orderout = 2) Outer azimuthal background fitting order (rfunction = "spline3") Radial profile fitting function (rorder = 40) Radial profile fitting order (abin = 0.) Azimuthal bin (deg) (astep = 0.) Azimuthal step (deg) (niterate = 3) Number of rejection iterations (lreject = 3.) Low rejection rms factor (hreject = 3.) High rejection rms factor (datamin = INDEF) Minimum good data value (datamax = INDEF) Maximum good data value (verbose = yes) Print information? (fd = "") (mode = "ql") Now you need to create a mask for this pupil image so that only the relevant parts of it are used later on.This only needs to be done once for all runs and filters. It is fast to generate and takes little space. Use mscpupil again: mscpupil input = "PupilI.fits" List of input images output = "Pupil_mask" List of output images (masks = "") List of masks (type = "mask") Output type (lmedian = no) Subtract line-by-line median? (xc = 27.) Pattern center offset (pixels) (yc = 9.) Pattern center offset (pixels) (rin = 405.) Radius of inner background ring (pixels) (drin = 20.) Width of inner background ring (pixels) (rout = 1350.) Radius of outer background ring (pixels) (drout = 20.) Width of outer background ring (pixels) (funcin = "chebyshev") Inner azimuthal background fitting function (orderin = 2) Inner azimuthal background fitting order (funcout = "spline3") Outer azimuthal background fitting function (orderout = 2) Outer azimuthal background fitting order (rfunction = "spline3") Radial profile fitting function (rorder = 40) Radial profile fitting order (abin = 0.) Azimuthal bin (deg) (astep = 0.) Azimuthal step (deg) (niterate = 3) Number of rejection iterations (lreject = 3.) Low rejection rms factor (hreject = 3.) High rejection rms factor (datamin = INDEF) Minimum good data value (datamax = INDEF) Maximum good data value (verbose = yes) Print information? (fd = "") (mode = "ql") Now you may rmpupil. rmpupil input = "@obj.list" List of input images output = "@objp.list" List of output corrected images pupil = "PupilI.fits" Pupil or list of pupil patterns masks = "@om.list" List of object/bad data masks (pupilmasks = "Pupil_mask") Pupil masks (outtype = "sdiff") Output type (ncblk = 3) Column smoothing for weights (nlblk = 3) Line smoothing for weights (extfit = "im[2367]") Extensions to use in scaling fit (logfile = "") Logfile (verbose = yes) Verbose? (mode = "ql") Now we can do fringes. First you need to make a fringe template. First combine all your pupil subtracted images into a skyflat with sflatcombine. sflatcombine input = "@objp.list" List of images to combine output = "SflatV2" Output sky flat field root name (combine = "average") Type of combine operation (reject = "ccdclip") Type of rejection (ccdtype = "object") CCD image type to combine (optional) (subsets = yes) Combine images by subset? (masktype = "!objmask") Mask type (maskvalue = 0.) Mask value (scale = "mode") Image scaling (statsec = "") Image section for computing statistics\n (nkeep = 1) Minimum to keep (pos) or maximum to reject(neg) (nlow = 1) minmax: Number of low pixels to reject (nhigh = 1) minmax: Number of high pixels to reject (mclip = yes) Use median in sigma clipping algorithms? (lsigma = 6.) Lower sigma clipping factor (hsigma = 3.) Upper sigma clipping factor (rdnoise = "rdnoise") ccdclip: CCD readout noise (electrons) (gain = "gain") ccdclip: CCD gain (electrons/DN) (snoise = "0.") ccdclip: Sensitivity noise (fraction) (pclip = -0.5) pclip: Percentile clipping parameter (grow = 3.) Radius (pixels) for neighbor rejection (blank = 1.) Value if there are no pixels\n (mode = "ql") Now remove the background sky gradient from your above flatfield by running a median filter on it and subtracting that from the skyflat to get a fringe template. lpar mscmedian input = "SflatV2I" Input mosaic images output = "MedianTempI" Output mosaic images xwindow = 129 X window size of median filter ywindow = 129 Y window size of median filter (outtype = "median") Output type (median|difference) (zloreject = -20000.) Lowside pixel value cutoff (zhireject = 30000.) High side pixel value cutoff (verbose = yes) Print messages about actions taken by the task (fmedian = yes) Use fast median algorithm? (hmin = -20000) Minimum histogram bin (hmax = 30000) Maximum histogram bin (zmin = -20000.) Pixel value corresponding to hmin (zmax = 30000.) Pixel value corresponding to hmax (fd = "") (mode = "ql") This takes a significant amount of time; around 90-120 minutes. Now subtract your median filtered image from the original. lpar mscarith operand1= SflatV2I.fits Operand image or numerical constant op = - Operator operand2= MedianTempI.fits Operand image or numerical constant result = FringeI.fits Resultant image (extname= ) Extension names to select (title = ) Title for resultant image (divzero= 0.) Replacement value for division by zero (hparams= ) List of header parameters (pixtype= ) Pixel type for resultant image (calctyp= ) Calculation data type (verbose= no) Print operations? (noact = no) Print operations without performing them? (fd1 = ) (fd2 = ) (fd3 = ) (mode = ql) Now make a mask for your fringe template so that only the relevant parts of it get used.This only needs to be done once for all runs and filters. epar mscpupil input = FringeI.fits List of input images output = Fringe_mask List of output images (masks = ) List of masks (type = mask) Output type (lmedian= no) Subtract line-by-line median? (xc = 27.) Pattern center offset (pixels) (yc = 9.) Pattern center offset (pixels) (rin = 1500.) Radius of inner background ring (pixels) (drin = 20.) Width of inner background ring (pixels) (rout = 8000.) Radius of outer background ring (pixels) (drout = 20.) Width of outer background ring (pixels) (funcin = chebyshev) Inner azimuthal background fitting function (orderin= 2) Inner azimuthal background fitting order (funcout= spline3) Outer azimuthal background fitting function (orderou= 2) Outer azimuthal background fitting order (rfuncti= spline3) Radial profile fitting function (rorder = 40) Radial profile fitting order (abin = 0.) Azimuthal bin (deg) (astep = 0.) Azimuthal step (deg) (niterat= 3) Number of rejection iterations (lreject= 3.) Low rejection rms factor (hreject= 3.) High rejection rms factor (datamin= INDEF) Minimum good data value (datamax= INDEF) Maximum good data value (verbose= yes) Print information? (fd = ) (mode = ql) Now you can remove the fringes: lpar rmfringe input = @objp.list List of input images output = @objpf.list List of output corrected images fringe = FringeI.fits Fringe or list of fringe patterns masks = @om.list List of object/bad data masks (fringem= Fringe_mask) Fringe masks (backgro= @sky.list) Lisk of input image backgrounds (extfit = ) Extensions to use in scaling fit (logfile= ) Logfile (verbose= yes) Verbose? (mode = ql) And finally, combine your output into the final skyflat! lpar sflatcombine input = "@objpf.list" List of images to combine output = "SflatV3" Output sky flat field root name (combine = "average") Type of combine operation (reject = "ccdclip") Type of rejection (ccdtype = "object") CCD image type to combine (optional) (subsets = yes) Combine images by subset? (masktype = "!objmask") Mask type (maskvalue = 0.) Mask value (scale = "mode") Image scaling (statsec = "") Image section for computing statistics\n (nkeep = 1) Minimum to keep (pos) or maximum to reject(neg (nlow = 1) minmax: Number of low pixels to reject (nhigh = 1) minmax: Number of high pixels to reject (mclip = yes) Use median in sigma clipping algorithms? (lsigma = 6.) Lower sigma clipping factor (hsigma = 3.) Upper sigma clipping factor (rdnoise = "rdnoise") ccdclip: CCD readout noise (electrons) (gain = "gain") ccdclip: CCD gain (electrons/DN) (snoise = "0.") ccdclip: Sensitivity noise (fraction) (pclip = -0.5) pclip: Percentile clipping parameter (blank = 1.) Value if there are no pixels\n (grow = 3.) Radius (pixels) for neighbor rejection (mode = "ql") And then apply this to your images with ccdproc. lpar ccdproc images = "@objpf.list" List of Mosaic CCD images to process (output = "@objpfs.list") List of output processed images (bpmasks = "") List of output bad pixel masks (ccdtype = "object") CCD image type to process (noproc = no) List processing steps only?\n (xtalkcor = no) Apply crosstalk correction? (fixpix = no) Apply bad pixel mask correction? (overscan = no) Apply overscan strip correction? (trim = no) Trim the image? (zerocor = no) Apply zero level correction? (darkcor = no) Apply dark count correction? (flatcor = no) Apply flat field correction? (sflatcor = yes) Apply sky flat field correction? (split = no) Use split images during processing? (merge = no) Merge amplifiers from same CCD?\n (xtalkfile = "!xtalkfil") Crosstalk file (fixfile = "BPM") List of bad pixel masks (saturation = "!saturate") Saturated pixel threshold (sgrow = 1) Saturated pixel grow radius (bleed = "20000.") Bleed pixel threshold (btrail = 15) Bleed trail minimum length (bgrow = 1) Bleed pixel grow radius (biassec = "!biassec") Overscan strip image section (trimsec = "!trimsec") Trim data section (zero = "Zero") List of zero level calibration images (dark = "Dark") List of dark count calibration images (flat = "Flat*") List of flat field images (sflat = "SflatV3I.fits") List of secondary flat field images (minreplace = 1.) Minimum flat field value\n (interactive = no) Fit overscan interactively? (function = "minmax") Fitting function (order = 1) Number of polynomial terms or spline pieces (sample = "*") Sample points to fit (naverage = 1) Number of sample points to combine (niterate = 1) Number of rejection iterations (low_reject = 3.) Low sigma rejection factor (high_reject = 3.) High sigma rejection factor (grow = 0.) Rejection growing radius (fd = "") (fd2 = "") (mode = "ql") You're done. You can move on to the WCS correction part of the manual.