@@ -48,12 +48,12 @@ If you determine your calibration curve, you will need to use
48
48
your own data. All data used here were measured with a NaI probe.
49
49
50
50
``` {r import}
51
- # Import CNF files for calibration
51
+ ## Import CNF files for calibration
52
52
spc_dir <- system.file("extdata/AIX_NaI_1/calibration", package = "gamma")
53
53
spc <- read(spc_dir)
54
54
spc
55
55
56
- # Import a CNF file of background measurement
56
+ ## Import a CNF file of background measurement
57
57
bkg_dir <- system.file("extdata/AIX_NaI_1/background", package = "gamma")
58
58
bkg <- read(bkg_dir)
59
59
bkg
@@ -76,8 +76,8 @@ to each spectrum, including the background spectrum. One subsection for each
76
76
spectrum with the corresponding R code.
77
77
78
78
``` {r signal}
79
- # Spectrum pre-processing
80
- # Remove baseline for peak detection
79
+ ## Spectrum pre-processing
80
+ ## Remove baseline for peak detection
81
81
bsl <- spc |>
82
82
signal_slice(-1:-40) |>
83
83
signal_stabilize(f = sqrt) |>
@@ -87,11 +87,13 @@ bsl <- spc |>
87
87
88
88
### BRIQUE
89
89
``` {r calibrate-BRIQUE}
90
- # Peak detection
90
+ ## Peak detection
91
91
pks <- peaks_find(bsl[["BRIQUE"]])
92
- # Set energy values
92
+
93
+ ## Set energy values
93
94
set_energy(pks) <- c(238, NA, NA, NA, 1461, NA, NA, 2615)
94
- # Adjust the energy scale
95
+
96
+ ## Adjust the energy scale
95
97
BRIQUE <- energy_calibrate(spc[["BRIQUE"]], pks)
96
98
```
97
99
@@ -102,11 +104,13 @@ plot(BRIQUE, pks) +
102
104
103
105
### C341
104
106
``` {r calibrate-C341}
105
- # Spectrum pre-processing and peak detection
107
+ ## Spectrum pre-processing and peak detection
106
108
pks <- peaks_find(bsl[["C341"]])
107
- # Set energy values
109
+
110
+ ## Set energy values
108
111
set_energy(pks) <- c(238, NA, NA, NA, 1461, NA, 2615)
109
- # Adjust the energy scale
112
+
113
+ ## Adjust the energy scale
110
114
C341 <- energy_calibrate(spc[["C341"]], pks)
111
115
```
112
116
@@ -117,11 +121,13 @@ plot(C341, pks) +
117
121
118
122
### C347
119
123
``` {r calibrate-C347}
120
- # Spectrum pre-processing and peak detection
124
+ ## Spectrum pre-processing and peak detection
121
125
pks <- peaks_find(bsl[["C347"]], span = 10)
122
- # Set energy values
126
+
127
+ ## Set energy values
123
128
set_energy(pks) <- c(238, NA, NA, NA, NA, 1461, NA, 2615)
124
- # Adjust the energy scale
129
+
130
+ ## Adjust the energy scale
125
131
C347 <- energy_calibrate(spc[["C347"]], pks)
126
132
```
127
133
@@ -132,11 +138,13 @@ plot(C347, pks) +
132
138
133
139
### GOU
134
140
``` {r calibrate-GOU}
135
- # Spectrum pre-processing and peak detection
141
+ ## Spectrum pre-processing and peak detection
136
142
pks <- peaks_find(bsl[["GOU"]])
137
- # Set energy values
143
+
144
+ ## Set energy values
138
145
set_energy(pks) <- c(238, NA, NA, NA, 1461, NA, NA, 2615)
139
- # Adjust the energy scale
146
+
147
+ ## Adjust the energy scale
140
148
GOU <- energy_calibrate(spc[["GOU"]], pks)
141
149
```
142
150
@@ -147,11 +155,13 @@ plot(GOU, pks) +
147
155
148
156
### PEP
149
157
``` {r calibrate-PEP}
150
- # Spectrum pre-processing and peak detection
158
+ ## Spectrum pre-processing and peak detection
151
159
pks <- peaks_find(bsl[["PEP"]])
152
- # Set energy values
160
+
161
+ ## Set energy values
153
162
set_energy(pks) <- c(238, NA, NA, NA, 1461, NA, NA, 2615)
154
- # Adjust the energy scale
163
+
164
+ ## Adjust the energy scale
155
165
PEP <- energy_calibrate(spc[["PEP"]], pks)
156
166
```
157
167
@@ -211,16 +221,16 @@ function `dose_fit()` we will use later to derive the calibration curve.
211
221
212
222
### Using the count threshold
213
223
``` {r integrate-Ni}
214
- # Integration range (in keV)
224
+ ## Integration range (in keV)
215
225
Ni_range <- c(200, 2800)
216
226
217
- # Integrate background spectrum
227
+ ## Integrate background spectrum
218
228
Ni_bkg <- signal_integrate(
219
229
object = bkg_scaled,
220
230
range = Ni_range,
221
231
energy = FALSE)
222
232
223
- # Integrate reference spectra
233
+ ## Integrate reference spectra
224
234
Ni_spc <- signal_integrate(
225
235
object = spc_scaled,
226
236
range = Ni_range,
@@ -232,16 +242,16 @@ Ni_spc <- signal_integrate(
232
242
### Using the energy threshold
233
243
234
244
``` {r integrate-NiEi}
235
- # Integration range (in keV)
245
+ ## Integration range (in keV)
236
246
NiEi_range <- c(200, 2800)
237
247
238
- # Integrate background spectrum
248
+ ## Integrate background spectrum
239
249
NiEi_bkg <- signal_integrate(
240
250
object = bkg_scaled,
241
251
range = NiEi_range,
242
252
energy = TRUE)
243
253
244
- # Integrate reference spectra
254
+ ## Integrate reference spectra
245
255
NiEi_signal <- signal_integrate(
246
256
object = spc_scaled,
247
257
range = NiEi_range,
@@ -262,7 +272,7 @@ To model the calibration curve we will need have measured sites with known radio
262
272
with your probe in that locations you do not have to manually add values from @miallier2009 or @richter2010 .
263
273
264
274
``` {r}
265
- # Get reference dose rates
275
+ ## Get reference dose rates
266
276
data("clermont")
267
277
doses <- clermont[, c("gamma_dose", "gamma_error")]
268
278
```
@@ -276,7 +286,7 @@ to be passed onto the calibration R object. You have to modify those values for
276
286
detector.
277
287
278
288
``` {r}
279
- # Metadata
289
+ ## Metadata
280
290
info <- list(
281
291
laboratory = "CEREGE",
282
292
instrument = "InSpector 1000",
@@ -288,7 +298,7 @@ info <- list(
288
298
In the last step we construct the calibration curve and inspect the results.
289
299
290
300
``` {r}
291
- # Build the calibration curve
301
+ ## Build the calibration curve
292
302
AIX_NaI <- dose_fit(
293
303
object = spc_scaled,
294
304
background = bkg_scaled,
@@ -304,12 +314,12 @@ If this information seems too opaque , we can further inspect the output numeric
304
314
(` summary() ` ) and graphically using the package ` plot() ` methods.
305
315
306
316
``` {r}
307
- # show summary
317
+ ## Show summary
308
318
summarise(AIX_NaI)
309
319
```
310
320
311
321
``` {r calibration, fig.width=3.5, fig.show='hold'}
312
- # plot calibration curves
322
+ ## Plot calibration curves
313
323
plot(AIX_NaI, energy = FALSE) +
314
324
ggplot2::theme_bw()
315
325
plot(AIX_NaI, energy = TRUE) +
@@ -431,7 +441,7 @@ ggplot2::ggplot(NiEi_residuals, ggplot2::aes(sample = standardized)) +
431
441
# x = "Observation", y = "D")
432
442
```
433
443
434
- ## Application example: opredict new dose rates
444
+ ## Application example: predict new dose rates
435
445
436
446
After calibrating our detector, it is time to derive gamma dose rates from
437
447
sites with unknown radionuclide concentrations. As mentioned above, we will use
@@ -441,15 +451,15 @@ only three steps:
441
451
### Import measured data
442
452
443
453
``` {r}
444
- # Import CNF files for dose rate prediction
454
+ ## Import CNF files for dose rate prediction
445
455
test_dir <- system.file("extdata/AIX_NaI_1/test", package = "gamma")
446
456
test <- read(test_dir)
447
457
```
448
458
449
459
### Inspect the spectra
450
460
451
461
``` {r predict}
452
- # Inspect spectra
462
+ ## Inspect spectra
453
463
plot(test, yaxis = "rate") +
454
464
ggplot2::theme_bw()
455
465
```
@@ -487,7 +497,8 @@ rates
487
497
488
498
# Outro: our R session {-}
489
499
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
+
491
502
``` {r session-info, echo=FALSE}
492
503
sessionInfo()
493
504
```
0 commit comments