//Get Line Profile y = getProfile(); // Create x axis x = Array.getSequence(y.length); // Get some stats to initialize the fit Array.getStatistics(y, ymin, ymax, ymean, ystdDev); guesses = newArray(ymin, ymax, y.length/2, sqrt(ystdDev), 2.0); Array.print(guesses); // The formula for a supergaussian //superGaussian = "y = a + b * exp(-1/2 * (pow ((x-c)*(x-c), e ) / pow( d*d , e ) ) )" superGaussian = "y = a + (b-a) * exp(-log(2)*(pow(4*(x-c)*(x-c)/ (d*d), e ) ) )" // Do fitting Fit.doFit(superGaussian, x,y, guesses); Fit.plot(); // Compute and display FWHM in the log window par_d = Fit.p(3); FWHM = par_d; print("FWHM: "+FWHM);