def optimize(self):
    p0 = [np.max(self.epsf), 4, np.min(self.epsf)]
    min_sigma = 0.5
    bounds = [(0, np.infty), (min_sigma, np.infty), (0, np.mean(self.epsf))]
    with warnings.catch_warnings():
        warnings.simplefilter('ignore')
        params = minimize(self.nll, p0, bounds=bounds).x
        self.optimized_params = params
        return ((params[1] * self.sigma_to_fwhm()), (params[1] * self.sigma_to_fwhm()), 0)
def optimize(self):
    p0 = [np.max(self.epsf), 4, np.min(self.epsf)]
    min_sigma = 0.5
    bounds = [(0, np.infty), (min_sigma, np.infty), (0, np.mean(self.epsf))]
    with warnings.catch_warnings():
        warnings.simplefilter('ignore')
        params = minimize(self.nll, p0, bounds=bounds).x
        self.optimized_params = params
        return ((params[1] * self.sigma_to_fwhm()), (params[1] * self.sigma_to_fwhm()), 0)