This function may be performed alone by calling the script with entrystage and finalstage=`merge'. The task counts the number of files in subdirectory simgensubdir whose names match the detected-sources name template; all these FITS files are then merged into one. The number of files found is written to a keyword N_FIELDS in the first extension of the merged dataset.
This merged file alone allows some interesting comparisons to be made. For example, one could make a scatter plot of FLUX against SIM_FLUX (see eg figure 1), to see how accurately the detection procedure can measure source flux, and to check to see if any of the weaker, non-XMM-PSF sources have been detected; or a scatter plot of MATCH_PNULL against SIM_FLUX (see eg figure 2).