The flat is the normalised difference of two images, one with the lamp on and another with the lamp off. In general, three pairs of images are taken.
The LW recipe name is isaacp lw_spflat, and it expects a list of frames, which are first classified by setting. For each setting, there should be an even number of frames, consisting of frames with the lamp alternatively on and off. The frames with the lamp off are subtracted from frames with the lamp on. If there is more than one pair, the resulting frames are averaged. For each setting, a fit to the vertical gradient is fitted and removed.
The recipe is very similar to that used to produce SW flats. See figure .