flat takes in input a list of files taken at twilight. It deduces the flat-field of the detector by observing this rapidly increasing or decreasing signal. Since it computes a characteristic curve per pixel, it can also easily detect bad pixels. This is actually a much better method to use for bad pixel detection, than the ones offered by deadpix, but it requires a specific data acquisition at twilight, which is not always easy or simply possible.
flat man page