integration - integrate 2D gaussian in python -
i've defined 2d gaussian this:
def gauss2d((x, y), a, x0, y0, sx, sy, offset): g = offset + a*np.exp(-((x - x0) ** 2. / (2. * sx ** 2) + (y - y0) ** 2 / (2. * sy ** 2))) return g.ravel()
and integrate between +/-sx , +/-sy. know parameters previous fit of data : popt, pcov = opt.curve_fit(gauss2d, (x, y), src_region.ravel(), p0=initial_guess)
can use dbquad
? or need use gauss-hermite quadratures ?
i've tried dbquad
returns :
flux_fit = dblquad(gauss2d, -popt[3], popt[3], lambda x: -popt[4], lambda x: popt[4], args=(popt[0], popt[1], popt[2], popt[3], popt[4], popt[5])) return _quadpack._qagse(func,a,b,args,full_output,epsabs,epsrel,limit) typeerror: gauss2d() takes 7 arguments (8 given)
thanks
Comments
Post a Comment