The illumination correction takes into account low-frequency differences between the true flat and the twilight flat. These variations have an RMS of 2%. If this is accurate enough, then an illumination correction is not needed. To compute these variations, a dedicated calibration template is offered. The procedure images a standard star over a grid of 17 positions (1 central and a 4x4 grid), with the convention that the first frame has the star at the center of the image ("center" means up to 50 pixels from the true image center), and subsequent positions are indicated through keywords in the FITS header. Usually, the procedure is run once every six months and after major instrument interventions.
These images need to be sky subtracted and flat fielded. The easiest way to remove the sky (and the dark) is to subtract one frame from another. For flat fielding, one can either use the flat that will be later used to flat field the science frames or the flat that was taken closest in time to when the standard star was observed. The advantage in using the second flat is that pixel to pixel variations are better normalised, but one has to take into account the large scale differences between the two flats by smoothing the flats over a suitably large scale, say 100 pixels.
The next step is to compute the flux (not magnitude) of the stars through some fixed aperture and to fit a two-dimensional, 2nd or 3rd order polynomial to the flux values as a function of position on the array. The IRAF routine surfit is particularly useful for doing this. The surface which is fit is the illumination correction (after it has been normalized to a mean of unity).
The illumination correction can be applied to either the data or the flat field itself; however, some care is required in determining if one needs to multiply or divide. It depends on how the fit was done.
We are creating an eclipse routine, called isaacp illum, which will do all of this; however, the routine is still under development.