Read parameters. Create appropriate filenames. Open all the files: Input image, e.g. mos1S001-fovimsky-350-1100.fits Input PN OOT image if applicable Input Exposure Map Input Mask if applicable Input QPB, SP, SWCX Maps if applicable Determine counts for each input image bin the data (withbinning=T) adaptively smooth the data (withsmoothing=T) Plot radial profile and size in QDP Open two new output files If withsmoothing=T then Write adapted and size arrays to output files else Write rate and sigma arrays to output files endif Add coord keywords Close output files.