Energy scale calibration

Reference spectra

# Peak parameters estimation
# Fit peaks at chanel 82, 492, 872 (starting positions)
calib_peaks <- list(
  ## BRIQUE
  BRIQUE = fitPeaks(calib_spc[["BRIQUE"]], peaks = c(82, 492, 872)),
  ## C341
  C341 = fitPeaks(calib_spc[["C341"]], peaks = c(82, 492, 872)),
  ## C347
  C347 = fitPeaks(calib_spc[["C347"]], peaks = c(82, 492, 872)),
  ## GOU
  GOU = fitPeaks(calib_spc[["GOU"]], peaks = c(82, 492, 872)),
  ## PEP
  PEP = fitPeaks(calib_spc[["PEP"]], peaks = c(82, 492, 872))
)

BRIQUE - Estimated peak parameters
Mean (chanel) Std. dev. (chanel) Height (count)
peak #1 85.276 2.704 4912.141
peak #2 491.898 9.712 2351.512
peak #3 872.313 13.175 200.405

C341 - Estimated peak parameters
Mean (chanel) Std. dev. (chanel) Height (count)
peak #1 85.990 3.060 804.562
peak #2 495.532 10.233 365.515
peak #3 878.435 14.330 34.895

C347 - Estimated peak parameters
Mean (chanel) Std. dev. (chanel) Height (count)
peak #1 85.055 3.201 703.798
peak #2 493.321 9.813 925.307
peak #3 874.137 15.527 25.923

GOU - Estimated peak parameters
Mean (chanel) Std. dev. (chanel) Height (count)
peak #1 86.346 2.842 1577.332
peak #2 497.044 9.989 628.539
peak #3 881.724 14.031 66.557

PEP - Estimated peak parameters
Mean (chanel) Std. dev. (chanel) Height (count)
peak #1 85.806 2.686 2447.413
peak #2 494.862 9.744 877.720
peak #3 877.186 14.328 98.544
# Expected peak positions (energy scale)
expected_peaks <- c(Pb212 = 238, K40 = 1461, Tl208 = 2615)

# Energy scale calibration
calib_scaled <- lapply(X = calib_peaks, FUN = calibrate,  lines = expected_peaks)
calib_scaled <- methods::as(calib_scaled, "GammaSpectra")

plot(calib_scaled, xaxis = "energy", yaxis = "rate") +
  ggplot2::geom_vline(xintercept = expected_peaks, linetype = 3) +
  ggplot2::theme_bw()

Background noise spectrum

noise_lines <- list(
  Pb212 = c(chanel = 84, energy = 238),
  K40 = c(chanel = 492, energy = 1461),
  Tl208 = c(chanel = 865, energy = 2615)
)
noise_scaled <- calibrate(noise_spc, lines = noise_lines)

plot(noise_spc, noise_scaled, xaxis = "energy", yaxis = "rate") +
  ggplot2::geom_vline(xintercept = expected_peaks, linetype = 3) +
  ggplot2::theme_bw()

Build Calibration curve

Check model

#> 
#> Call:
#> stats::lm(formula = fit_formula, data = fit_data, weights = fit_weights)
#> 
#> Residuals:
#>        1        2        3        4        5 
#>  -0.1149  34.6430 -32.5464 -26.7330  24.7514 
#> 
#> Coefficients:
#>                Estimate Std. Error t value Pr(>|t|)    
#> (Intercept)  -3.436e+01  4.933e+01  -0.697    0.536    
#> signal_value  1.821e-02  4.992e-04  36.485 4.53e-05 ***
#> ---
#> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#> 
#> Residual standard error: 34.58 on 3 degrees of freedom
#> Multiple R-squared:  0.9978, Adjusted R-squared:  0.997 
#> F-statistic:  1331 on 1 and 3 DF,  p-value: 4.528e-05

R session

#> R version 3.6.0 (2017-01-27)
#> Platform: x86_64-pc-linux-gnu (64-bit)
#> Running under: Ubuntu 14.04.5 LTS
#> 
#> Matrix products: default
#> BLAS:   /home/travis/R-bin/lib/R/lib/libRblas.so
#> LAPACK: /home/travis/R-bin/lib/R/lib/libRlapack.so
#> 
#> locale:
#>  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
#>  [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
#>  [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
#>  [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
#>  [9] LC_ADDRESS=C               LC_TELEPHONE=C            
#> [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       
#> 
#> attached base packages:
#> [1] stats     graphics  grDevices utils     datasets  methods   base     
#> 
#> other attached packages:
#> [1] magrittr_1.5 gamma_0.1.1 
#> 
#> loaded via a namespace (and not attached):
#>  [1] Rcpp_1.0.1       highr_0.8        compiler_3.6.0   pillar_1.4.1    
#>  [5] plyr_1.8.4       tools_3.6.0      digest_0.6.19    evaluate_0.14   
#>  [9] memoise_1.1.0    tibble_2.1.3     gtable_0.3.0     pkgconfig_2.0.2 
#> [13] rlang_0.3.4      commonmark_1.7   yaml_2.2.0       pkgdown_1.3.0   
#> [17] xfun_0.7         rxylib_0.2.4     stringr_1.4.0    dplyr_0.8.1     
#> [21] roxygen2_6.1.1   xml2_1.2.0       knitr_1.23       desc_1.2.0      
#> [25] fs_1.3.1         cowplot_0.9.4    rprojroot_1.3-2  grid_3.6.0      
#> [29] tidyselect_0.2.5 glue_1.3.1       R6_2.4.0         rmarkdown_1.13  
#> [33] tidyr_0.8.3      purrr_0.3.2      ggplot2_3.1.1    backports_1.1.4 
#> [37] scales_1.0.0     htmltools_0.3.6  MASS_7.3-51.4    assertthat_0.2.1
#> [41] colorspace_1.4-1 labeling_0.3     stringi_1.4.3    lazyeval_0.2.2  
#> [45] munsell_0.5.0    crayon_1.3.4