import matplotlib.pyplot as plt
from astropy.visualization import simple_norm
from photutils.datasets import (load_simulated_hst_star_image,
                                make_noise_image)
from photutils.detection import DAOStarFinder

hdu = load_simulated_hst_star_image()
data = hdu.data
data += make_noise_image(data.shape, distribution='gaussian', mean=10.0,
                         stddev=5.0, seed=0)

finder = DAOStarFinder(threshold=100.0, fwhm=1.5)
sources = finder(data)

fig, ax = plt.subplots(figsize=(8, 8))
norm = simple_norm(data, 'sqrt', percent=99.0)
ax.imshow(data, norm=norm, origin='lower')
ax.scatter(sources['x_centroid'], sources['y_centroid'],
           s=80, edgecolor='red', facecolor='none', lw=1.5)