Skip to content

Commit 28ace41

Browse files
committed
Small edits
1 parent 5829f01 commit 28ace41

File tree

2 files changed

+47
-36
lines changed

2 files changed

+47
-36
lines changed

vignettes/doserate.Rmd

Lines changed: 45 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,12 @@ If you determine your calibration curve, you will need to use
4848
your own data. All data used here were measured with a NaI probe.
4949

5050
```{r import}
51-
# Import CNF files for calibration
51+
## Import CNF files for calibration
5252
spc_dir <- system.file("extdata/AIX_NaI_1/calibration", package = "gamma")
5353
spc <- read(spc_dir)
5454
spc
5555
56-
# Import a CNF file of background measurement
56+
## Import a CNF file of background measurement
5757
bkg_dir <- system.file("extdata/AIX_NaI_1/background", package = "gamma")
5858
bkg <- read(bkg_dir)
5959
bkg
@@ -76,8 +76,8 @@ to each spectrum, including the background spectrum. One subsection for each
7676
spectrum with the corresponding R code.
7777

7878
```{r signal}
79-
# Spectrum pre-processing
80-
# Remove baseline for peak detection
79+
## Spectrum pre-processing
80+
## Remove baseline for peak detection
8181
bsl <- spc |>
8282
signal_slice(-1:-40) |>
8383
signal_stabilize(f = sqrt) |>
@@ -87,11 +87,13 @@ bsl <- spc |>
8787

8888
### BRIQUE
8989
```{r calibrate-BRIQUE}
90-
# Peak detection
90+
## Peak detection
9191
pks <- peaks_find(bsl[["BRIQUE"]])
92-
# Set energy values
92+
93+
## Set energy values
9394
set_energy(pks) <- c(238, NA, NA, NA, 1461, NA, NA, 2615)
94-
# Adjust the energy scale
95+
96+
## Adjust the energy scale
9597
BRIQUE <- energy_calibrate(spc[["BRIQUE"]], pks)
9698
```
9799

@@ -102,11 +104,13 @@ plot(BRIQUE, pks) +
102104

103105
### C341
104106
```{r calibrate-C341}
105-
# Spectrum pre-processing and peak detection
107+
## Spectrum pre-processing and peak detection
106108
pks <- peaks_find(bsl[["C341"]])
107-
# Set energy values
109+
110+
## Set energy values
108111
set_energy(pks) <- c(238, NA, NA, NA, 1461, NA, 2615)
109-
# Adjust the energy scale
112+
113+
## Adjust the energy scale
110114
C341 <- energy_calibrate(spc[["C341"]], pks)
111115
```
112116

@@ -117,11 +121,13 @@ plot(C341, pks) +
117121

118122
### C347
119123
```{r calibrate-C347}
120-
# Spectrum pre-processing and peak detection
124+
## Spectrum pre-processing and peak detection
121125
pks <- peaks_find(bsl[["C347"]], span = 10)
122-
# Set energy values
126+
127+
## Set energy values
123128
set_energy(pks) <- c(238, NA, NA, NA, NA, 1461, NA, 2615)
124-
# Adjust the energy scale
129+
130+
## Adjust the energy scale
125131
C347 <- energy_calibrate(spc[["C347"]], pks)
126132
```
127133

@@ -132,11 +138,13 @@ plot(C347, pks) +
132138

133139
### GOU
134140
```{r calibrate-GOU}
135-
# Spectrum pre-processing and peak detection
141+
## Spectrum pre-processing and peak detection
136142
pks <- peaks_find(bsl[["GOU"]])
137-
# Set energy values
143+
144+
## Set energy values
138145
set_energy(pks) <- c(238, NA, NA, NA, 1461, NA, NA, 2615)
139-
# Adjust the energy scale
146+
147+
## Adjust the energy scale
140148
GOU <- energy_calibrate(spc[["GOU"]], pks)
141149
```
142150

@@ -147,11 +155,13 @@ plot(GOU, pks) +
147155

148156
### PEP
149157
```{r calibrate-PEP}
150-
# Spectrum pre-processing and peak detection
158+
## Spectrum pre-processing and peak detection
151159
pks <- peaks_find(bsl[["PEP"]])
152-
# Set energy values
160+
161+
## Set energy values
153162
set_energy(pks) <- c(238, NA, NA, NA, 1461, NA, NA, 2615)
154-
# Adjust the energy scale
163+
164+
## Adjust the energy scale
155165
PEP <- energy_calibrate(spc[["PEP"]], pks)
156166
```
157167

@@ -211,16 +221,16 @@ function `dose_fit()` we will use later to derive the calibration curve.
211221

212222
### Using the count threshold
213223
```{r integrate-Ni}
214-
# Integration range (in keV)
224+
## Integration range (in keV)
215225
Ni_range <- c(200, 2800)
216226
217-
# Integrate background spectrum
227+
## Integrate background spectrum
218228
Ni_bkg <- signal_integrate(
219229
object = bkg_scaled,
220230
range = Ni_range,
221231
energy = FALSE)
222232
223-
# Integrate reference spectra
233+
## Integrate reference spectra
224234
Ni_spc <- signal_integrate(
225235
object = spc_scaled,
226236
range = Ni_range,
@@ -232,16 +242,16 @@ Ni_spc <- signal_integrate(
232242
### Using the energy threshold
233243

234244
```{r integrate-NiEi}
235-
# Integration range (in keV)
245+
## Integration range (in keV)
236246
NiEi_range <- c(200, 2800)
237247
238-
# Integrate background spectrum
248+
## Integrate background spectrum
239249
NiEi_bkg <- signal_integrate(
240250
object = bkg_scaled,
241251
range = NiEi_range,
242252
energy = TRUE)
243253
244-
# Integrate reference spectra
254+
## Integrate reference spectra
245255
NiEi_signal <- signal_integrate(
246256
object = spc_scaled,
247257
range = NiEi_range,
@@ -262,7 +272,7 @@ To model the calibration curve we will need have measured sites with known radio
262272
with your probe in that locations you do not have to manually add values from @miallier2009 or @richter2010.
263273

264274
```{r}
265-
# Get reference dose rates
275+
## Get reference dose rates
266276
data("clermont")
267277
doses <- clermont[, c("gamma_dose", "gamma_error")]
268278
```
@@ -276,7 +286,7 @@ to be passed onto the calibration R object. You have to modify those values for
276286
detector.
277287

278288
```{r}
279-
# Metadata
289+
## Metadata
280290
info <- list(
281291
laboratory = "CEREGE",
282292
instrument = "InSpector 1000",
@@ -288,7 +298,7 @@ info <- list(
288298
In the last step we construct the calibration curve and inspect the results.
289299

290300
```{r}
291-
# Build the calibration curve
301+
## Build the calibration curve
292302
AIX_NaI <- dose_fit(
293303
object = spc_scaled,
294304
background = bkg_scaled,
@@ -304,12 +314,12 @@ If this information seems too opaque , we can further inspect the output numeric
304314
(`summary()`) and graphically using the package `plot()` methods.
305315

306316
```{r}
307-
# show summary
317+
## Show summary
308318
summarise(AIX_NaI)
309319
```
310320

311321
```{r calibration, fig.width=3.5, fig.show='hold'}
312-
# plot calibration curves
322+
## Plot calibration curves
313323
plot(AIX_NaI, energy = FALSE) +
314324
ggplot2::theme_bw()
315325
plot(AIX_NaI, energy = TRUE) +
@@ -431,7 +441,7 @@ ggplot2::ggplot(NiEi_residuals, ggplot2::aes(sample = standardized)) +
431441
# x = "Observation", y = "D")
432442
```
433443

434-
## Application example: opredict new dose rates
444+
## Application example: predict new dose rates
435445

436446
After calibrating our detector, it is time to derive gamma dose rates from
437447
sites with unknown radionuclide concentrations. As mentioned above, we will use
@@ -441,15 +451,15 @@ only three steps:
441451
### Import measured data
442452

443453
```{r}
444-
# Import CNF files for dose rate prediction
454+
## Import CNF files for dose rate prediction
445455
test_dir <- system.file("extdata/AIX_NaI_1/test", package = "gamma")
446456
test <- read(test_dir)
447457
```
448458

449459
### Inspect the spectra
450460

451461
```{r predict}
452-
# Inspect spectra
462+
## Inspect spectra
453463
plot(test, yaxis = "rate") +
454464
ggplot2::theme_bw()
455465
```
@@ -487,7 +497,8 @@ rates
487497

488498
# Outro: our R session {-}
489499

490-
Finally, for transparency, the R session setting used for rendering this vignette.
500+
Finally, for transparency, the R session setting used for rendering this vignette:
501+
491502
```{r session-info, echo=FALSE}
492503
sessionInfo()
493504
```

vignettes/gamma.Rmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: "Manual"
2+
title: "Introduction to gamma"
33
author: "N. Frerebeau"
44
date: "`r Sys.Date()`"
55
output:
@@ -12,7 +12,7 @@ header-includes:
1212
- \usepackage{amssymb}
1313
bibliography: bibliography.bib
1414
vignette: >
15-
%\VignetteIndexEntry{Manual}
15+
%\VignetteIndexEntry{Introduction to gamma}
1616
%\VignetteEncoding{UTF-8}
1717
%\VignetteEngine{knitr::rmarkdown}
1818
---

0 commit comments

Comments
 (0)