Peak Algorithm

  • Found peak using second derivative of data. Double differential used as it enables us to find some hidden peaks.
  • Picked a cut off point for second derivative of data to give a range, $x_1$ and $x_2$, where the values inside the range would be considered a peak
  • Used equation,
 \begin{equation} W.A.= \frac{\sum x_iy_i}{\sum y_i} \end{equation}
to find the weighted average, peak, of the for each spectrum.
  • RMS was obtained by the equation,
 \begin{equation} \sigma= \frac{\sum (x_i-\bar{x_i})^2y_i}{\sum y_i} \end{equation}
  • FWHM can be obtained by $2\sqrt{ln2}\sigma$.

  • Peak locator algorithm used for camera angle at 1.50mm:
    PeakAt1.50mm.png
Error Bars and Chi Squared

  • First attempt at error bars, setting y error as the square root of the count:
    Improved_Cd_0650_Gaussians_lowest_errorbar.png
  • Error bars are tiny due to incorrect assumption that data follows a poison distribution.

  • Gaussian function used:
 \begin{equation} f(x) = a e^{- \frac{(x - \mu )^2}{2 \sigma ^2}} + b \end{equation}
  • Chi squared function used:
 \begin{equation} \chi2 = \sum \frac{(x_i - \mu)^2}{\sigma^2} \, . \end{equation}
  • Cd spectrum at 06.50mm with Gaussian fits, error bars and Chi squared values:
    Cd_0650_gaussian_errors_chi.png
  • Array of test parameters passed to fucntion : test_array_Cd650 = [[8E6, 150, 30, 3E5], [1.6E7, 270, 30, 3E5], [1.6E7, 520, 30, 3E5]]
  • Chi squared values are huge as expected due to poor fit. Once errors and fit equation are correct, Chi squared should reduce.

-- JamesAngthopo - 03 Nov 2016
Topic attachments
I Attachment History Action Size Date Who Comment
PNGpng Cd_0650_gaussian_errors_chi.png r1 manage 48.9 K 04 Nov 2016 - 12:21 WilliamBurrows Cd spectrum at 06.50mm with Gaussian fits, error bars and Chi squared values
PNGpng Improved_Cd_0650_Gaussians_lowest.png r1 manage 19.6 K 04 Nov 2016 - 10:17 WilliamBurrows Zoomed in look at the lowest Cd peak at 06.50mm
PNGpng Improved_Cd_0650_Gaussians_lowest_errorbar.png r1 manage 22.1 K 04 Nov 2016 - 10:17 WilliamBurrows First attempt at error bars, setting y error as sqrt of count
PNGpng PeakAt1.50mm.png r1 manage 95.1 K 03 Nov 2016 - 20:39 JamesAngthopo Peak locator algorithm used for camera angle at 1.50mm
Texttxt gaussian_fit.py.txt r1 manage 6.1 K 04 Nov 2016 - 13:50 WilliamBurrows Gaussian, erro, chi squared pyhton code
Edit | Attach | Watch | Print version | History: r5 < r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions

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

Topic revision: r5 - 04 Nov 2016 - WilliamBurrows

 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2023 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