Flatfielding

I compared means and midpoints for images; most were very similar, but some were different, so the images should be scaled.

I used flatcombine first for flats without a filter, then for those with the cuso4 filter.

noao.imred.ccdred.flatcombine
                                 I R A F  
                             Image Reduction and Analysis Facility
PACKAGE = ccdred
TASK = flatcombine

input   =          @filterflats  List of flat field images to combine
(output =                 Flat) Output flat field root name

(combine= average) Type of combine operation (reject = ccdclip) Type of rejection (ccdtype= flat) CCD image type to combine (process= yes) Process images before combining? (subsets= yes) Combine images by subset parameter? (delete = no) Delete input images after combining? (clobber= no) Clobber existing output image? (scale = mode) Image scaling (statsec= ) Image section for computing statistics (nlow = 1) minmax: Number of low pixels to reject (nhigh = 1) minmax: Number of high pixels to reject (nkeep = 1) Minimum to keep (pos) or maximum to reject (neg) (mclip = yes) Use median in sigma clipping algorithms? (lsigma = 3.) 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 (mode = ql)

I divided flats using imarith, imarith Flat / Flat2 Div (without filter / with filter)

Div does not have the dark spots found in all the flats. These are found at:

x y
962.75 54.25
1447.25 203.75
1662.25 59.25
1655.25 76.25
1643.25 113.25
1827.75 122.25
1973.75 117.25
2102.75 112.25
2200.25 145.25
2200.25 145.25
2338.75 197.25
2565.75 68.25
2493.25 169.25
2606.25 139.25

The flatfields without a filter (Flat) has a weird bump (see below), so the flatfield with the filter (Flat2) will probably be used.

I use response to normalize each flatfield

noao.twodspec.longslit.response
                                    I R A F  
Image Reduction and Analysis Facility PACKAGE = longslit TASK = response calibrat= Flat2 Longslit calibration images normaliz= Flat2 Normalization spectrum images response= nFlat2 Response function images (interac= yes) Fit normalization spectrum interactively? (thresho= INDEF) Response threshold (sample = *) Sample of points to use in fit (naverag= 1) Number of points in sample averaging (functio= spline3) Fitting function (order = 13) Order of fitting function (low_rej= 3.) Low rejection in sigma of fit (high_re= 3.) High rejection in sigma of fit (niterat= 1) Number of rejection iterations (grow = 0.) Rejection growing radius (graphic= stdgraph) Graphics output device (cursor = ) Graphics cursor input (mode = ql)

The spots are back! I think this is a good thing? (yes, it is)

noao.twodspec.longslit.response
                                   I R A F    
                    Image Reduction and Analysis Facility  
PACKAGE = longslit     
TASK = response    
calibrat=                 Flat  Longslit calibration images  
normaliz=                 Flat  Normalization spectrum images  
response=                nFlat  Response function images  
(interac=                  yes) Fit normalization spectrum interactively?  
(thresho=                INDEF) Response threshold  
(sample =                    *) Sample of points to use in fit  
(naverag=                    1) Number of points in sample averaging  
(functio=              spline3) Fitting function  
(order  =                   13) Order of fitting function  
(low_rej=                   3.) Low rejection in sigma of fit  
(high_re=                   3.) High rejection in sigma of fit  
(niterat=                    1) Number of rejection iterations  
(grow   =                   0.) Rejection growing radius  
(graphic=             stdgraph) Graphics output device  
(cursor =                     ) Graphics cursor input  
(mode   =                   ql)  

There are spots on this one also.

I used imarith to divide images, nFlat / nFlat2 nDiv

I then divided an individual flat by the combined flat, which made the spots disappear, so this means that they are not bad pixels; they just have a lower response.

I will use the normalized flat with filter, now renamed Flat.fits

I ran ccdproc again, changing the following parameters from when run for zero correction.
(flatcor= yes) Apply flat field correction?
(flat = Flat) Flat field images
(interac= no) Fit overscan interactively?
(order = 4) Number of polynomial terms or spline pieces
(grow = 0.) Rejection growing radius