[SciPy-User] Fitting Gaussian in spectra
Joe Philip Ninan
indiajoe at gmail.com
Thu Oct 4 07:20:56 EDT 2012
Hi Matt, Christian, Jerome, Kevin and David.
Thanks a lot for all the suggestions.
First i apologize for my delay in replying. something was wrong with my
subscription, and i was only able to read the emails in archive page.
I tried to model the continuum as an exponential function and did least
square fit. ( at first i was trying out 2nd degree polynomials)
With the iterative masking method suggested. it seems to be doing a good
job. I haven't tried on all data set yet.
Since the width,position nor amplitude of peaks were not same in all data,
peak finding was not easy.
But the code by sixtenbe in github https://gist.github.com/1178136 helped
me find the peaks _almost_ reliably.
Thanking you again for all the help.
-cheers
joe
On 29 September 2012 00:15, Joe Philip Ninan <indiajoe at gmail.com> wrote:
> Hi,
> I have a spectra with multiple gaussian emission lines over a noisy
> continuum.
> My primary objective is to find areas under all the gaussian peaks.
> For that, the following is the algorithm i have in mind.
> 1) fit the continuum and subtract it.
> 2) find the peaks
> 3) do least square fit of gaussian at the peaks to find the area under
> each gaussian peaks.
> I am basically stuck at the first step itself. Simple 2nd or 3rd order
> polynomial fit is not working because the contribution from peaks are
> significant. Any tool exist to fit continuum ignoring the peaks?
> For finding peaks, i tried find_peaks_cwt in signal module of scipy. But
> it seems to be quite sensitive of the width of peak and was picking up
> non-existing peaks also.
> The wavelet used was default mexican hat. Is there any better wavelet i
> should try?
>
> Or is there any other module in python/scipy which i should give a try?
> Thanking you.
> -cheers
> joe
> --
> /---------------------------------------------------------------
> "GNU/Linux: because a PC is a terrible thing to waste" - GNU Generation
>
>
>
--
/---------------------------------------------------------------
"GNU/Linux: because a PC is a terrible thing to waste" - GNU Generation
************************************************
Joe Philip Ninan http://sites.google.com/site/jpninan/
Research Scholar /________________\
DAA, | Vadakeparambil |
TIFR, | Pullad P.O. |
Mumbai-05, India. | Kerala, India |
Ph: +917738438212 | PIN:689548 |
------------------------------\_______________/--------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20121004/8724ab53/attachment.html>
More information about the SciPy-User
mailing list