The simplest sky subtraction is where you have separate sky and object frames taken a short time apart. These can be directly subtracted. However, the reference sky fields are seldom blank, with faint stars appearing at a number of points. It is thus advisable to take several sky frames at different positions. These may be median combined, making sure there is appropriate scaling to the same sky level, to eliminate the contribution of these objects.
More complicated sky subtraction schemes are possible. For a deep, dithered integration examining targets that are much smaller than the array size, a reference sky image may be created by median combining several neighbouring integrations, at different dither positions. The resulting reference frame can then be subtracted from the appropriate object frame. For a long dithered integration, the calculation of reference sky values can be a running process - the sky frame for a given object frame may be produced by medianning together, for example, the 8 integrations nearest to it in time.
The resulting sky subtracted images should be examined to make sure that sky subtraction has been properly achieved. If the sky has significantly varied between the object and sky reference images, you may find large scale gradients or patterns in the resulting sky-subtracted image. This is an indication that you need to look carefully at the reference frames used and at matching the sky values in the relevant frames, which might be achieved by using a multiplicative or additive term. Considerably more complicated sky subtraction schemes are possible and may be required for certain observational projects (see Bunker et al 1995, MNRAS, 273, 513 for an example based on IRAC2b data).
In MIDAS, simple sky subtraction is achieved by using either the COMPUTE/IMAGE command or SSUB/IRAC2. COMBINE/CCD can be used for the median combination of frames. Combinations of these commands, and others, will be necessary for some of the more complicated sky subtraction schemes.