1.A. The New Bad-pixel Maps.

Since we have entered in the new saturation headers, we want to create new bad pixel masks with included saturation limits. We can also include the parameter "bleed".


files obj* > all 
[only get rid of the ".fits...]

ccdproc @all bpmasks=@all saturat=!saturate bleed=mean+5000


A note about the bleed parameter from Frank Valdez...

"Specify a threshold for the bleed pixels relative to the frame mean. This in combination the minimum length bleed trail allows using a fairly low threshold. i.e. It may be common to find pixels 5000ADU above the sky but only bleed trails would have 20 consecutive pixels above this limit along a column. So "bleed = mean+5000" would be something that should work on all CCDs regardless of the relative differences in saturation.

There is the option of "fixpix"ing the bleed trails as well as having them added to the same new mask as produced when you do the saturation..."
[Frank V.]



bleed = "INDEF"
        Threshold  for  identifying  bleed  trail  pixels.   This may be
        specified in the same way as the saturation value including  use
        of  "ADUs"  and  "electrons"  and reference to a header keyword.
        In addition the value may be set in relation to  the  saturation
        value  or  the  mean  of  the  data  with  one  of the following
        specifications
        
            saturation-X, saturation/X, mean+X, mean*X
     
        where X is a number and the values are in ADU.  For example  the
        value  "mean+5000"  would define candidate bleed trail pixels as
        those which are 5000 counts above the mean.   Note  that  for  a
        pixel  to  actually be identified as a bleed pixel there must be
        a consecutive  number  of  pixels  (parameter  btrail)  along  a
        column which are above this threshold.

btrail = 20 Number of consecutive pixels with values above the bleed pixel threshold along a column to qualify as a bleed trail. The threshold is specified by the bleed parameter.
Now that we have new bad pixel masks, we need to actually apply them to the images.(We're going to rename all doubly fixpixed images 'fobj*p.fits'.)

msccmd "fixpix $input BPM" input=@all