Mosaic data has a default set of bad pixel masks, which include the gaps between chips, and not much else. The location of these bad pixel masks can be inferred from the raw data headers; likely they are somewhere in mscdb$noao/CCDMosaThina/CALXXXX (KPNO) or mscdb$noao/Mosaic2/CALXXXX/bpm. What we do is copy these into local files "bphil1.pl", "bphil2.pl", and then modify them painfully by hand.
We begin by dividing a short exposure by a long exposure dome flats, and
displaying the results with the default bad pixel map overlayed.
We then identify bad columns and rows and update the bad pixel maps
accordingly, using "imreplace", i.e.,
imreplace bphil1.pl[431:431,3631:3631] 1. (to indicate a bad pixel) and
imreplace bphil1.pl[1354:1354,1:4096] 1. (to indicate a bad column)
Now, we need to make sure that we actually will USE these bad pixel masks:
hedit *.fits[1] BPM bphil1.pl veri- show+ hedit *.fits[2] BPM bphil2.pl veri- show+ etc.