Gauss2D Fit: 'cor' parameter
mailfert
I'm using the Gauss2D function to fit data contained in an image.
In this function, we have the possibility to access to a 'cor' parameter, which corresponds to a cross-correlation parameter.
What does it represent exactly. I can't find this formula on the litterature.
The second question is maybe a lack of knowledge but if in my image I've got something like a PSF that looks like an ellipse. If I want to fit this PSF with a function that could reveal the fact that the ellipse could be rotated compared to the axes, how could I do?
Thanks for your help.
Sébastien
http://en.wikipedia.org/wiki/Multivariate_normal_distribution
But note that Igor fits a function that is not normalized as a probability distribution (that is, the total integral is not equal to 1.0).
I assume that you mean that the projection of the PSF onto the XY plane has an elliptical outline, and the distribution of Z values is Gaussian. The ellipse at an angle is what the cor fit coefficient is for. If you are looking for a fitting function that uses the angle with the X axis as a fit parameter, you will need to find the formula and create a user-defined fitting function.
John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
July 22, 2011 at 09:07 am - Permalink
variable theta // rotation angle - radians
Make/O/N=(100,100) w2D // make a test wave for the input angle
setscale x, -4, 4, "" w2D
setscale y, -4, 4, "" w2D
variable sigmax = 1
variable sigmay = 2
w2D = (1/(2*pi*sigmax*sigmay))
w2d*= exp( - (x*cos(theta) + y*sin(theta))^2/(2*sigmax^2) )
w2d*= exp( - (-x*sin(theta) + y*cos(theta))^2/(2*sigmay^2) )
// create a suitable w2D graph to show the fit results and contour lines
FuncFitMD/NTHR=0/TBOX=768 MyGauss W_coef w2D /D // and fit it
end
Function MyGauss(w,x,y) : FitFunc
Wave w
Variable x
Variable y
//CurveFitDialog/ These comments were created by the Curve Fitting dialog. Altering them will
//CurveFitDialog/ make the function less convenient to work with in the Curve Fitting dialog.
//CurveFitDialog/ Equation:
//CurveFitDialog/ f(x,y) = (A/(sigmax*sigmay))*exp(-(x*cos(theta)+y*sin(theta))^2/(2*sigmax^2) -(-x*sin(theta)+y*cos(theta))^2/(2*sigmay^2))
//CurveFitDialog/ End of Equation
//CurveFitDialog/ Independent Variables 2
//CurveFitDialog/ x
//CurveFitDialog/ y
//CurveFitDialog/ Coefficients 4
//CurveFitDialog/ w[0] = A
//CurveFitDialog/ w[1] = sigmax
//CurveFitDialog/ w[2] = sigmay
//CurveFitDialog/ w[3] = theta
return (w[0]/(w[1]*w[2]))*exp(-(x*cos(w[3])+y*sin(w[3]))^2/(2*w[1]^2) -(-x*sin(w[3])+y*cos(w[3]))^2/(2*w[2]^2))
End
July 28, 2011 at 09:15 am - Permalink
November 18, 2011 at 07:04 am - Permalink