Improved peak location

  • Second derivative of the data is used over the first derivative as the peak locations are easier to locate via Python using a cut off.

  • Location of local peaks of Cd at 06.50mm found using for loop and weighted average:
    peaklocated.png

  • Location of local peaks of Cd at 06.50mm found using for loop and weighted average after processing with median filter:
    peaklocatedmfilter.png

  • text.txt: Code for peak finders and width
Improved Gaussian Fits

  • Gaussian function used:
 \begin{equation} f(x) = a e^{- \frac{(x - \mu )^2}{2 \sigma ^2}} + b \end{equation}

  • Where a is amplitude, μ is pixel position, σ is peak width and b is background level.
  • First guess parameters for each peak (obtained from peak finding code) are passed to scipy.optimize.curvefit whose function is defined above. curve_fit returns the optimal parameters which are then passed again to the Gaussian function and the outputs are plotted as fits to the data.

  • Improved Gaussian fits to the Cadmium 6.50mm spectrum peaks:
    Improved_Cd_0650_Gaussians.png
  • Currently x range is limited to 50 pixels of the estimated pixel position, in order for the fit to be able to work
  • Still struggles with closely grouped peaks

-- JamesAngthopo - 27 Oct 2016
Topic attachments
I Attachment Action Size Date Who Comment
PNGpng Improved_Cd_0650_Gaussians.png manage 40.1 K 27 Oct 2016 - 20:18 WillBurrows Improved Gaussian fits to the Cadmium 6.50mm spectrum peaks
Texttxt gaussian_fit.py.txt manage 4.7 K 27 Oct 2016 - 21:50 WillBurrows Improved Gaussian fit python code
PNGpng peaklocated.png manage 66.5 K 27 Oct 2016 - 17:42 JamesAngthopo Location of local peaks found using for loop and weighted average
PNGpng peaklocatedmfilter.png manage 64.1 K 27 Oct 2016 - 17:42 JamesAngthopo Location of local peaks found using for loop and weighted average where the data has been filtered using median filter
Texttxt text.txt manage 3.7 K 28 Oct 2016 - 12:39 JamesAngthopo Code for peak finders and width

Physics WebpagesRHUL WebpagesCampus Connect • Royal Holloway, University of London, Egham, Surrey TW20 0EX; Tel/Fax +44 (0)1784 434455/437520

Topic revision: r4 - 04 Nov 2016 - WillBurrows

 
This site is powered by the TWiki collaboration platformCopyright © 2008-2018 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding RHUL Physics Department TWiki? Send feedback