def optimize(self):
    p0 = list(moments(self.epsf))
    p0.append(1)
    (x0, y0) = (p0[1], p0[2])
    min_sigma = 0.5
    bounds = [(0, np.infty), ((x0 - 3), (x0 + 3)), ((y0 - 3), (y0 + 3)), (min_sigma, np.infty), (min_sigma, np.infty), (0, 4), (0, np.mean(self.epsf)), (1, 8)]
    with warnings.catch_warnings():
        warnings.simplefilter('ignore')
        params = minimize(self.nll, p0, bounds=bounds).x
        self.optimized_params = params
        sm = self.sigma_to_fwhm()
        return ((params[3] * sm), (params[4] * sm), params[(- 2)])
def optimize(self):
    p0 = list(moments(self.epsf))
    p0.append(1)
    (x0, y0) = (p0[1], p0[2])
    min_sigma = 0.5
    bounds = [(0, np.infty), ((x0 - 3), (x0 + 3)), ((y0 - 3), (y0 + 3)), (min_sigma, np.infty), (min_sigma, np.infty), (0, 4), (0, np.mean(self.epsf)), (1, 8)]
    with warnings.catch_warnings():
        warnings.simplefilter('ignore')
        params = minimize(self.nll, p0, bounds=bounds).x
        self.optimized_params = params
        sm = self.sigma_to_fwhm()
        return ((params[3] * sm), (params[4] * sm), params[(- 2)])