If the mean option is specified, the mean of each image is calculated and all images are scaled to have the same mean as the first one specified.
The output median image is placed in the file is specified with the outfile keyword. This option is required.
The header of the first file is copied into the output file.
median skyflat1 skyflat2 skyflat3 mean outfile=myflat
Goes through each of the three files and calculates the mean. Then, scales each file so that the means are the same. Goes through the images pixel-by-pixel, sorting the three values and placing the middle value into the output file, which will be called myflat.fits.
Note: in generating sky flats you should first remove the dark and bias before using the median.