def image_psf(image, stars, size=15, normalize=False, return_cutouts=False):
    '\n    Get global psf from image using photutils routines\n\n    Parameters\n    ----------\n    image: np.ndarray or path\n    stars: np.ndarray\n        stars positions with shape (n,2)\n    size: int\n        size of the cuts around stars (in pixels)\n    normalize: bool, optional\n        weather to normalize the cutout, default is False\n\n    Returns\n    -------\n    np.ndarray of shape (size, size)\n\n    '
    (_, cuts) = cutouts(image, stars, size=size)
    cuts = cuts.data
    if normalize:
        cuts = [(c / np.sum(c)) for c in cuts]
    if return_cutouts:
        return (np.median(cuts, axis=0), cuts)
    else:
        return np.median(cuts, axis=0)
Get global psf from image using photutils routines

Parameters
----------
image: np.ndarray or path
stars: np.ndarray
    stars positions with shape (n,2)
size: int
    size of the cuts around stars (in pixels)
normalize: bool, optional
    weather to normalize the cutout, default is False

Returns
-------
np.ndarray of shape (size, size)
def image_psf(image, stars, size=15, normalize=False, return_cutouts=False):
    '\n    Get global psf from image using photutils routines\n\n    Parameters\n    ----------\n    image: np.ndarray or path\n    stars: np.ndarray\n        stars positions with shape (n,2)\n    size: int\n        size of the cuts around stars (in pixels)\n    normalize: bool, optional\n        weather to normalize the cutout, default is False\n\n    Returns\n    -------\n    np.ndarray of shape (size, size)\n\n    '
    (_, cuts) = cutouts(image, stars, size=size)
    cuts = cuts.data
    if normalize:
        cuts = [(c / np.sum(c)) for c in cuts]
    if return_cutouts:
        return (np.median(cuts, axis=0), cuts)
    else:
        return np.median(cuts, axis=0)