tmpscr(2/9): mask.fits


display range: 1,0
  • Make a mask for the highest 300
    random badpixels with a "cross" kernel
  • Merge the mask with the typical
    mask image
median tmp0 tmp1 3 3
imarith tmp0 - tmp1 tmp1
imarith tmp1 * ../badpixr tmp1
imfunc tmp1 tmp1 abs
imrepl tmp1 65000. lower=65000.
!rm tmp.tbl tmp1.tbl
imhist tmp1 z1=-50 z2=65050 binwidt=100 nbins=651 hist_type=cumulative listout+ > tmp.tbl
###Number of rejected bad pixels with high count.
###(If you want to apply this script to a raw image, use upper line.)
#!../thresh tmp.tbl 1300 tmp1 > tmp1.tbl
!../thresh tmp.tbl 300 tmp1 > tmp1.tbl
cl < tmp1.tbl
imstati tmp1 upper=0.5
imarith ../badpixr * tmp1 mask.fits
convolve mask.fits mask.fits "0. 0.2 0.; 0.2 0.2 0.2; 0. 0.2 0."
imrepl mask 0. upper=0.9
displ mask 2 zs- zr- z1=1 z2=0