A two‐dimensional Kolmogorov–Smirnov test for crowded field source detection: ROSAT sources in NGC 6397

We present a two-dimensional version of the classical one-dimensional Kolmogorov‐Smirnov (KS) test, extending an earlier idea due to Peacock and an implementation proposed by Fasano and Franceschini. The two-dimensional KS test is used to optimize the goodness of fit in an iterative source-detection scheme for astronomical images. The method is applied to a ROSAT/HRI X-ray image of the post-core-collapse globular cluster NGC 6397 to determine the most probable source distribution in the cluster core. Comparisons to other widely used source-detection methods, and to a Chandra image of the same field, show that our iteration scheme is superior in measuring statistics-limited sources in severely crowded fields.