/
README.Rmd
118 lines (82 loc) · 3.25 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-"
)
## Examples
library(gammaSpec)
file <- system.file("extdata", "Nievenheim_DORNIE_1.spe", package = "gammaSpec")
```
# gammaSpec <a href='https://tzerk.github.io/gammaSpec/'><img src='man/figures/logo.png' align="right" height="138.5" /></a>
<!-- badges: start -->
[![Build Status](https://travis-ci.org/tzerk/gammaSpec.svg?branch=master)](https://travis-ci.org/tzerk/gammaSpec)
[![Build status](https://ci.appveyor.com/api/projects/status/kgrhm1tni43qohm1?svg=true)](https://ci.appveyor.com/project/tzerk/gammaspec)
<!-- badges: end -->
> [Find a full documentation of the package on the project page](https://tzerk.github.io/gammaSpec/)
## Overview
The **R** package 'gammaSpec' provides a small collection of functions to analyse
gamma spectra of NaI(Tl) scintillation radiation detectors.
## Installation
The ‘gammaSpec’ package is not available on the official CRAN servers.
However, the latest development builds can directly be installed from GitHub. Simply run the following from an R console
```{r, eval = FALSE}
if(!require("devtools"))
install.packages("devtools")
devtools::install_github("tzerk/gammaSpec")
```
## Features
### Data import
The function `read_SPE()` can be used to import SPE files produces by the
ORTEC application software 'MAESTRO Mulichannel Analyzer Emulation' and
'GammaVision Gamma Spectroscopy'. All meta information in the SPE files
are preserved in the return object.
```{r, eval = FALSE}
file <- read_SPE(file = "~/path/to/file.spe")
```
```{r, warning=FALSE}
spectrum <- read_SPE(file)
str(spectrum, max.level = 1)
```
### Plotting
The package contains a custom S3 method for `plot()` to quickly visualise the
imported spectrum. It further offers to re-calculate the absolute counts per
channel to a count rate per energy (keV).
```{r spec_plot, warning = FALSE}
plot(spectrum,
type = c("bar", "line", "point")[2],
xval = c("energy", "channel")[1],
yval = c("rate", "count")[1],
info = TRUE, fill = FALSE)
```
### Estimating the gamma dose rate
The function `calc_DoseRate()` estimates the in-situ gamma dose rate of the
provided gamma spectrum based on the recorded count rate and comparing the
integrated sum within a user specified energy range to that of an
internal calibration spectrum.
```{r doserate, fig.height=10, fig.width=7}
res <- calc_DoseRate(data = spectrum,
energy.min = 500,
energy.max = 2600,
background.correction = TRUE,
plot = TRUE,
plot.combine = TRUE,
app = FALSE,
cex = 0.8)
```
### Shiny application
Finally, the package includes a simple [shiny](https://github.com/rstudio/shiny)
application.
```{r, eval = FALSE}
calc_DoseRate(app = TRUE)
```
![app](man/figures/app.png)
## Note
This version is a development version and it comes without any guarentee!
## License
The gammaSpec package is licensed under the GPLv3. See these files in the main directory for additional details:
* LICENSE - gammaSpec package license (GPLv3)