I have data that looks like this:
When I try to fit a Gaussian to it, it obviously tries to fit the first peak, like so:
This fit was found using
ff = FindFit[data, a*Exp[-(x - b)^2/(2*c^2)] + d, {a, b, c, d}, x]
This isn't what I want. The huge peak on the left should be ignored because it's due to "irrelevant artifacts." However, when I try to make it just ignore the first ~400 points, I get a fit that's even more unhelpful:
I got this by editing my previous code slightly:
ff = FindFit[Take[data,-1648], a*Exp[-(x - b)^2/(2*c^2)] + d, {a, b, c, d}, x]
I'm not sure what to do that will fit only the smaller peak on the right-hand side. I have some success if I adjust the data such that the y values of all the data points between 0 and 400 are equal to some constant (roughly between 600 and 1000), but the value of that constant changes the fit parameters and I don't know how to find the right constant without brute-forcing it, and I'm not even sure if that's the right thing to be doing here. Any advice would be much appreciated!