Skip to content Skip to sidebar Skip to footer

Fitting Data To A Gaussian Profile

I have been trying to fit a gaussian into my spectrum. (intensity v/s velocity spectrum) spectrum New fitted spectrum I used the following code to fit the data to a gaussian profil

Solution 1:

The first step is always to plot the data, which you already did. The next is to guess initial values. Those for amp and cen look reasonably, if compared to the plot. But what about wid? It is 2 times the width of the distribution SQUARED. From the plot, the width itself must be of odrer of several thousand. If squared, it may reach 10^7, times 2 gives 2*10^7 as the initial value. Very far from your 35!

One possible solution:

amp = 0.0106283 cen = 55784 wid = 1.92911e+08

Plot:

Plot of itting function

Post a Comment for "Fitting Data To A Gaussian Profile"