def run(self, image):
    if self.save_cutouts:
        (self.epsf, image.cutouts) = self.build_epsf(image.data, image.stars_coords)
    else:
        self.epsf = self.build_epsf(image.data, image.stars_coords)
    (image.fwhmx, image.fwhmy, image.theta) = self.optimize()
    image.fwhm = np.mean([image.fwhmx, image.fwhmy])
    image.psf_sigma_x = (image.fwhmx / self.sigma_to_fwhm())
    image.psf_sigma_y = (image.fwhmy / self.sigma_to_fwhm())
    image.header['FWHM'] = image.fwhm
    image.header['FWHMX'] = image.fwhmx
    image.header['FWHMY'] = image.fwhmy
    image.header['PSFANGLE'] = image.theta
    image.header['FWHMALG'] = self.__class__.__name__
def run(self, image):
    if self.save_cutouts:
        (self.epsf, image.cutouts) = self.build_epsf(image.data, image.stars_coords)
    else:
        self.epsf = self.build_epsf(image.data, image.stars_coords)
    (image.fwhmx, image.fwhmy, image.theta) = self.optimize()
    image.fwhm = np.mean([image.fwhmx, image.fwhmy])
    image.psf_sigma_x = (image.fwhmx / self.sigma_to_fwhm())
    image.psf_sigma_y = (image.fwhmy / self.sigma_to_fwhm())
    image.header['FWHM'] = image.fwhm
    image.header['FWHMX'] = image.fwhmx
    image.header['FWHMY'] = image.fwhmy
    image.header['PSFANGLE'] = image.theta
    image.header['FWHMALG'] = self.__class__.__name__