Title: | Dose Rate Estimation from in-Situ Gamma-Ray Spectrometry Measurements |
Version: | 1.1.0 |
Maintainer: | Archéosciences Bordeaux <services-archeosciences@u-bordeaux-montaigne.fr> |
Description: | Process in-situ Gamma-Ray Spectrometry for Luminescence Dating. This package allows to import, inspect and correct the energy shifts of gamma-ray spectra. It provides methods for estimating the gamma dose rate by the use of a calibration curve as described in Mercier and Falguères (2007). The package only supports Canberra CNF and TKA and Kromek SPE files. |
License: | GPL-3 |
URL: | https://crp2a.github.io/gamma/, https://github.com/crp2a/gamma |
BugReports: | https://github.com/crp2a/gamma/issues |
Depends: | R (≥ 3.5) |
Imports: | ggplot2, graphics, IsoplotR, methods, rlang, rxylib, stats, tools, utils |
Suggests: | covr, knitr, rmarkdown, testthat (≥ 3.0.0), vdiffr (≥ 1.0.0) |
VignetteBuilder: | knitr |
Config/testthat/edition: | 3 |
Encoding: | UTF-8 |
LazyData: | false |
RoxygenNote: | 7.3.2 |
Collate: | 'AllClasses.R' 'AllGenerics.R' 'baseline.R' 'baseline_linear.R' 'baseline_rubberband.R' 'baseline_snip.R' 'coerce.R' 'data.R' 'dose_fit.R' 'dose_predict.R' 'energy_calibrate.R' 'gamma-package.R' 'initialize.R' 'mutators.R' 'operators.R' 'peaks_find.R' 'peaks_search.R' 'plot.R' 'read.R' 'show.R' 'signal_integrate.R' 'signal_slice.R' 'signal_split.R' 'signal_stabilize.R' 'smooth.R' 'smooth_rectangular.R' 'smooth_savitzky.R' 'smooth_triangular.R' 'subset.R' 'summarize.R' 'utilities.R' 'validate.R' 'zzz.R' |
NeedsCompilation: | no |
Packaged: | 2024-09-23 19:26:18 UTC; nicolas |
Author: | Nicolas Frerebeau |
Repository: | CRAN |
Date/Publication: | 2024-09-23 22:00:12 UTC |
gamma: Dose Rate Estimation from in-Situ Gamma-Ray Spectrometry Measurements
Description
Process in-situ Gamma-Ray Spectrometry for Luminescence Dating. This package allows to import, inspect and correct the energy shifts of gamma-ray spectra. It provides methods for estimating the gamma dose rate by the use of a calibration curve as described in Mercier and Falguères (2007). The package only supports Canberra CNF and TKA and Kromek SPE files.
Details
Package: | gamma |
Type: | Package |
Version: | 1.1.0 |
License: | GPL-3 |
Zenodo: | doi:10.5281/zenodo.2652393 |
Note
This work received a state financial support managed by the Agence Nationale de la Recherche (France) through the program Investissements d'avenir (ref. ANR-10-LABX-52 and 11-IDEX-0001).
Author(s)
Full list of authors and contributors (alphabetic order)
Nicolas Frerebeau | Université Bordeaux Montaigne, France |
Sebastian Kreutzer | Universität Heidelberg, Germany |
Christelle Lahaye | Université Bordeaux Montaigne, France |
Brice Lebrun | Université Bordeaux Montaigne, France |
Guilhem Paradol | Commissariat à l'Énergie Atomique, France |
Magali Rizza | Aix-Marseille Université, France |
Package maintainer
Nicolas Frerebeau
services-archeosciences@u-bordeaux-montaigne.fr
Archéosciences Bordeaux (UMR 6034)
Maison de l'Archéologie
Université Bordeaux Montaigne
F-33607 Pessac cedex
France
See Also
Useful links:
Report bugs at https://github.com/crp2a/gamma/issues
CEREGE Calibration Curve (NaI)
Description
CEREGE Calibration Curve (NaI)
Usage
data(AIX_NaI_1)
Format
An object of class CalibrationCurve.
Laboratory | CEREGE |
Instrument | Canberra Inspector 1000 |
Detector | NaI |
Authors | CEREGE Luminescence Team |
See Also
Other datasets:
BDX_LaBr_1
,
clermont
,
clermont_2024
Examples
## Load the curve
data(AIX_NaI_1, package = "gamma")
plot(AIX_NaI_1)
CRP2A Calibration Curve (LaBr)
Description
CRP2A Calibration Curve (LaBr)
Usage
data(BDX_LaBr_1)
Format
An object of class CalibrationCurve.
Laboratory | IRAMAT-CRP2A (UMR 5060) |
Instrument | Canberra Inspector 1000 |
Detector | LaBr |
Authors | CRP2A Luminescence Team |
See Also
Other datasets:
AIX_NaI_1
,
clermont
,
clermont_2024
Examples
## Load the curve
data(BDX_LaBr_1, package = "gamma")
plot(BDX_LaBr_1)
An S4 Class to Represent a Spectrum Baseline
Description
An S4 Class to Represent a Spectrum Baseline
Note
This class extends the GammaSpectrum class.
Author(s)
N. Frerebeau
See Also
Other class:
CalibrationCurve-class
,
GammaSpectra-class
,
GammaSpectrum-class
,
PeakPosition-class
,
coerce()
Examples
## Import a CNF file
spc_file <- system.file("extdata/LaBr.CNF", package = "gamma")
spc <- read(spc_file)
## Remove the first 35 channels
spc <- signal_slice(spc, -c(1:35))
## Linear baseline
bsl_linear <- baseline_linear(spc, from = 250, to = 750)
plot(spc, bsl_linear)
## SNIP baseline
bsl_snip <- baseline_snip(spc, LLS = FALSE, decreasing = FALSE, n = 100)
plot(spc, bsl_snip)
## Rubberband baseline
bsl_rubber <- baseline_rubberband(spc)
plot(spc, bsl_rubber)
## Remove baseline
spc_clean1 <- signal_correct(spc)
spc_clean2 <- spc - bsl_snip
all(spc_clean1 == spc_clean2)
plot(spc_clean1)
An S4 class to Represent a Dose Rate Calibration Curve
Description
An S4 class to Represent a Dose Rate Calibration Curve
Slots
Ni
A DoseRateModel object.
NiEi
A DoseRateModel object.
details
A
list
of length-one vector giving the curve metadata.slope
A
numeric
vector.intercept
A
numeric
vector.covariance
A
numeric
vector.MSWD
A
numeric
vector.df
A
numeric
vector.p_value
A
numeric
vector.data
A
data.frame
.range
A
numeric
vector.background
A
numeric
vector.
Subset
In the code snippets below, x
is a CalibrationCurve
object.
x[[i]]
Extracts information from a slot selected by subscript
i
.i
is acharacter
vector of length one.
Author(s)
N. Frerebeau
See Also
Other class:
Baseline-class
,
GammaSpectra-class
,
GammaSpectrum-class
,
PeakPosition-class
,
coerce()
An S4 Class to Represent a Collection of Gamma Sectra
Description
Represents a collection of spectra of gamma ray spectrometry measurements.
Details
This class extends the base list
and can only contains
GammaSpectrum objects.
Access
In the code snippets below, x
is a GammaSpectra
object.
length(x)
Get the number of elements in
x
.lengths(x)
Get the number of channels in each element of
x
.get_names(x)
,set_names(x) <- value
Retrieves or sets the names of
x
according tovalue
.get_hash(x)
Get the MD5 hash of the raw data files.
get_channels(x)
Get the number of channels in each element of
x
.get_counts(x)
Get the counts of each element of
x
.get_energy(x)
Get the energy range of each element of
x
.get_rates(x)
Get the count rates of each element of
x
.
Subset
In the code snippets below, x
is a GammaSpectra
object.
x[i]
Extracts the elements selected by subscript
i
.i
can bemissing
orNULL
,numeric
orcharacter
vector or afactor
. Returns a newGammaSpectra
object.x[i, j]
Like the above but allows to select a slot thru
j
(see examples).j
is acharacter
vector of length one. Returns alist
.x[[i]]
Extracts the elements selected by subscript
i
.i
can be anumeric
orcharacter
vector of length one. Returns the corresponding GammaSpectrum object.
Author(s)
N. Frerebeau
See Also
Other class:
Baseline-class
,
CalibrationCurve-class
,
GammaSpectrum-class
,
PeakPosition-class
,
coerce()
Examples
## Import all CNF files in a given directory
spc_dir <- system.file("extdata/BDX_LaBr_1/calibration", package = "gamma")
(spc <- read(spc_dir))
## Access
get_hash(spc)
get_names(spc)
get_livetime(spc)
get_realtime(spc)
lengths(spc)
range_energy(spc)
## Subset
spc[] # All spectra
spc[NULL] # All spectra
spc[1] # The first spectrum
spc[-6] # Delete the sixth spectrum
spc[1:3] # The first three spectra
spc[c(1, 3)] # The first and third spectra
spc["BRIQUE"] # The spectrum named 'BRIQUE'
spc[c("BRIQUE", "C347")] # The spectra named 'BRIQUE' and 'C347'
spc[1:3, "energy"] # The slot 'energy' of the first three spectra
spc[[1]]
spc[["BRIQUE"]]
An S4 Class to Represent a Gamma Spectrum
Description
Represents a single spectrum of a gamma ray spectrometry measurement.
Slots
hash
A
character
string giving the 32-byte MD5 hash of the imported file.name
A
character
string the measurement reference.date
A
POSIXct
element giving the measurement date and time.instrument
A
character
string giving the instrument name.file_format
A
character
string giving the format of the imported file.live_time
A
numeric
value.real_time
A
numeric
value.channel
A
integer
vector giving the channel number. Numeric values are coerced to integer as byas.integer()
(and hence truncated towards zero).energy
A
numeric
vector giving the gamma ray's energy (in keV).count
A
numeric
vector giving the counts number for each channel. Numeric values are coerced to integer as byas.integer()
(and hence truncated towards zero).rate
A
numeric
vector the count rate (1/s
) for each channel.calibration
A linear model used for energy scale calibration (see
energy_calibrate()
).
Access
In the code snippets below, x
is a GammaSpectrum
object.
length(x)
Get number of channel in
x
.get_hash(x)
Get the MD5 hash of the raw data file.
get_names(x)
,set_names(x) <- value
Retrieves or sets the name of
x
according tovalue
.get_channels(x)
Get the number of channels in
x
.get_counts(x)
Get the counts of
x
.get_energy(x)
Get the energy range of
x
.get_rates(x)
Get the count rates of
x
.
Coerce
In the code snippets below, x
is a GammaSpectrum
object.
as.matrix(x)
Coerces
x
to amatrix
.as.data.frame(x)
Coerces
x
to adata.frame
.
Subset
In the code snippets below, x
is a GammaSpectrum
object.
x[[i]]
Extracts information from a slot selected by subscript
i
.i
is acharacter
vector of length one and will be matched to the name of the slots.
Note
This class retains copy construction.
Author(s)
N. Frerebeau
See Also
Other class:
Baseline-class
,
CalibrationCurve-class
,
GammaSpectra-class
,
PeakPosition-class
,
coerce()
Examples
## Import a Canberra CNF file
spc_file <- system.file("extdata/LaBr.CNF", package = "gamma")
(spc <- read(spc_file))
## Access
get_hash(spc)
get_names(spc)
get_livetime(spc)
get_realtime(spc)
length(spc)
range_energy(spc)
## Subset
spc[["date"]]
spc[["instrument"]]
spc[["file_format"]]
An S4 Class to Represent a Set of Peaks
Description
An S4 Class to Represent a Set of Peaks
Slots
hash
A
character
string giving the 32-byte MD5 hash of the imported spectrum file.noise_method
A
character
string specifying the method used for peak detection.noise_threshold
A length one
numeric
vector giving the noise threshold.window
A length one
numeric
vector giving the half-window size.channel
A
integer
vector giving the channel number. Numeric values are coerced to integer as byas.integer()
(and hence truncated towards zero).energy_observed
A
numeric
vector giving the observed gamma ray energy (in keV).energy_expected
A
numeric
vector giving the expected gamma ray energy (in keV).
Access
In the code snippets below, x
is a PeakPosition
object.
get_hash(x)
Get the MD5 hash of the raw data file.
get_channels(x)
Get the channels of
x
.get_energy(x)
,set_energy(x) <- value
Retrieves or sets the energy scale of
x
according tovalue
.
Coerce
In the code snippets below, x
is a PeakPosition
object.
as.matrix(x)
Coerces
x
to amatrix
.as.data.frame(x)
Coerces
x
to adata.frame
.
Subset
In the code snippets below, x
is a PeakPosition
object.
x[[i]]
Extracts information from a slot selected by subscript
i
.i
is acharacter
vector of length one and will be matched to the name of the slots.
Note
This class retains copy construction.
Author(s)
N. Frerebeau
See Also
Other class:
Baseline-class
,
CalibrationCurve-class
,
GammaSpectra-class
,
GammaSpectrum-class
,
coerce()
Baseline Estimation and Removal
Description
Baseline Estimation and Removal
Usage
signal_baseline(object, ...)
signal_correct(object, ...)
baseline_snip(object, ...)
baseline_rubberband(object, ...)
baseline_linear(object, ...)
## S4 method for signature 'GammaSpectrum'
signal_baseline(object, method = c("SNIP", "rubberband", "linear"), ...)
## S4 method for signature 'GammaSpectra'
signal_baseline(object, method = c("SNIP", "rubberband", "linear"), ...)
## S4 method for signature 'GammaSpectrum'
signal_correct(object, method = c("SNIP", "rubberband", "linear"), ...)
## S4 method for signature 'GammaSpectra'
signal_correct(object, method = c("SNIP", "rubberband", "linear"), ...)
## S4 method for signature 'GammaSpectrum'
baseline_linear(object, from = NULL, to = NULL)
## S4 method for signature 'GammaSpectra'
baseline_linear(object, from = NULL, to = NULL)
## S4 method for signature 'GammaSpectrum'
baseline_rubberband(object, noise = 0, spline = TRUE, ...)
## S4 method for signature 'GammaSpectra'
baseline_rubberband(object, noise = 0, spline = TRUE, ...)
## S4 method for signature 'GammaSpectrum'
baseline_snip(object, LLS = FALSE, decreasing = FALSE, n = 100, ...)
## S4 method for signature 'GammaSpectra'
baseline_snip(object, LLS = FALSE, decreasing = FALSE, n = 100, ...)
Arguments
object |
A GammaSpectrum or GammaSpectra object. |
... |
Extra parameters to be passed to further methods. |
method |
A |
from |
An |
to |
An |
noise |
A length-one |
spline |
A |
LLS |
A |
decreasing |
A |
n |
An |
Details
The following methods are available for baseline estimation:
SNIP
Sensitive Nonlinear Iterative Peak clipping algorithm.
rubberband
A convex envelope of the spectrum is determined and the baseline is estimated as the part of the convex envelope lying below the spectrum. Note that the rubber band does not enter the concave regions (if any) of the spectrum.
linear
Linear baseline estimation.
Value
-
baseline_*()
returns a BaseLine object. -
signal_correct()
returns a corrected GammaSpectrum or GammaSpectra object (same asobject
).
Note
baseline_rubberband()
is slightly modified from C. Beleites'
hyperSpec::spc.rubberband()
.
Author(s)
N. Frerebeau
References
Liland, K. H. (2015). 4S Peak Filling - baseline estimation by iterative mean suppression. MethodsX, 2, 135-140. doi:10.1016/j.mex.2015.02.009.
Morháč, M., Kliman, J., Matoušek, V., Veselský, M. & Turzo, I. (1997). Background elimination methods for multidimensional gamma-ray spectra. Nuclear Instruments and Methods in Physics Research Section A: Accelerators, Spectrometers, Detectors and Associated Equipment, 401(1), p. 113-132. doi:10.1016/S0168-9002(97)01023-1
Morháč, M. & Matoušek, V. (2008). Peak Clipping Algorithms for Background Estimation in Spectroscopic Data. Applied Spectroscopy, 62(1), p. 91-106. doi:10.1366/000370208783412762
Ryan, C. G., Clayton, E., Griffin, W. L., Sie, S. H. & Cousens, D. R. (1988). SNIP, a statistics-sensitive background treatment for the quantitative analysis of PIXE spectra in geoscience applications. Nuclear Instruments and Methods in Physics Research Section B: Beam Interactions with Materials and Atoms, 34(3), p. 396-402. doi:10.1016/0168-583X(88)90063-8
See Also
Other signal processing:
peaks_find()
,
peaks_search()
,
signal_integrate()
,
signal_slice()
,
signal_split()
,
signal_stabilize()
,
smooth()
Examples
## Import a CNF file
spc_file <- system.file("extdata/LaBr.CNF", package = "gamma")
spc <- read(spc_file)
## Remove the first 35 channels
spc <- signal_slice(spc, -c(1:35))
## Linear baseline
bsl_linear <- baseline_linear(spc, from = 250, to = 750)
plot(spc, bsl_linear)
## SNIP baseline
bsl_snip <- baseline_snip(spc, LLS = FALSE, decreasing = FALSE, n = 100)
plot(spc, bsl_snip)
## Rubberband baseline
bsl_rubber <- baseline_rubberband(spc)
plot(spc, bsl_rubber)
## Remove baseline
spc_clean1 <- signal_correct(spc)
spc_clean2 <- spc - bsl_snip
all(spc_clean1 == spc_clean2)
plot(spc_clean1)
Clermont Reference Data
Description
Clermont Reference Data
Usage
data("clermont")
Format
A data.frame
with tabulated data and conversion factor reference.
Source
Guérin, G., Mercier, N. & Adamiec, G. (2011). Dose-Rate Conversion Factors: Update. Ancient TL, 29(1), p. 5-8.
Miallier, D., Guérin, G., Mercier, N., Pilleyre, T. & Sanzelle, S. (2009). The Clermont Radiometric Reference Rocks: A Convenient Tool for Dosimetric Purposes. Ancient TL, 27(2), p. 37-44.
See Also
Other datasets:
AIX_NaI_1
,
BDX_LaBr_1
,
clermont_2024
Clermont Reference Data 2024
Description
An updated version for the clermont
dataset with additional columns
for the applied dose rate conversion factors and their reference. The dataset
also contains gamma dose rate values and uncertainties for different published
conversion factors. Please note that the values for the conversion factors
applied in the original clermont
dataset differ slightly due to rounding
errors.
Usage
data("clermont_2024")
Format
A data.frame
with tabulated data and conversion factor reference.
Source
Adamiec, G. & Aitken, M.J. (1998). Dose-rate conversion factors: update. Ancient TL, 16, p. 37–50.
Cresswell, A.J., Carter, J. & Sanderson, D.C.W. (2018). Dose rate conversion parameters: Assessment of nuclear data. Radiation Measurements, 120, p. 195–201.
Guérin, G., Mercier, N. & Adamiec, G. (2011). Dose-Rate Conversion Factors: Update. Ancient TL, 29(1), p. 5-8.
Liritzis, I., Stamoulis, K., Papachristodoulou, C. & Ioannides, K. (2013). A re-evaluation of radiation dose-rate conversion factors. Mediterranean Archaeology and Archaeometry, 12, p. 1–15.
Miallier, D., Guérin, G., Mercier, N., Pilleyre, T. & Sanzelle, S. (2009). The Clermont Radiometric Reference Rocks: A Convenient Tool for Dosimetric Purposes. Ancient TL, 27(2), p. 37-44.
See Also
Other datasets:
AIX_NaI_1
,
BDX_LaBr_1
,
clermont
Coerce
Description
Coerce
Usage
## S3 method for class 'GammaSpectrum'
as.matrix(x, ...)
Arguments
x |
An object to be coerced. |
... |
Currently not used. |
Value
A coerced object.
Author(s)
N. Frerebeau
See Also
Other class:
Baseline-class
,
CalibrationCurve-class
,
GammaSpectra-class
,
GammaSpectrum-class
,
PeakPosition-class
Examples
## Import a Canberra CNF file
spc_file <- system.file("extdata/LaBr.CNF", package = "gamma")
spc <- read(spc_file)
## Coerce
mtx <- as.matrix(spc)
df <- as.data.frame(spc)
head(df)
Nuclear Decay Data
Description
An internal dataset containing the decay data for the following isotopes: 232-Th, 235-U, 238-U and 40-K.
Format
A data.frame
with the following columns (absolute errors):
- decay_chain
- isotope
- occurrence
- occurrence_error
- post_radon
- half_life
- half_life_error
- energy
Energy in keV.
- energy_error
- gamma_intensity
- gamma_intensity_error
- counts_chain
- counts_chain_error
Source
Nuclides And Isotopes : Chart of the Nuclides.
Lanthanum Decay Data
Description
An internal dataset containing the decay data for the Lanthanum isotopes.
Format
A data.frame
with the following columns (absolute errors):
- decay_chain
- isotope
- occurrence
- occurrence_error
- post_radon
- half_life
- half_life_error
- energy
Energy in keV.
- energy_error
- gamma_intensity
- gamma_intensity_error
Source
Nuclides And Isotopes : Chart of the Nuclides.
Dose Rate Estimation
Description
-
dose_fit()
builds a calibration curve for gamma dose rate estimation. -
dose_predict()
predicts in situ gamma dose rate.
Usage
dose_fit(object, background, doses, ...)
dose_predict(object, spectrum, ...)
## S4 method for signature 'GammaSpectra,GammaSpectrumOrNumeric,matrix'
dose_fit(
object,
background,
doses,
range_Ni,
range_NiEi,
details = list(authors = "", date = Sys.time())
)
## S4 method for signature 'GammaSpectra,GammaSpectrumOrNumeric,data.frame'
dose_fit(
object,
background,
doses,
range_Ni,
range_NiEi,
details = list(authors = "", date = Sys.time())
)
## S4 method for signature 'CalibrationCurve,missing'
dose_predict(
object,
sigma = 1,
epsilon = 0.015,
water_content = NULL,
use_MC = FALSE
)
## S4 method for signature 'CalibrationCurve,GammaSpectrum'
dose_predict(
object,
spectrum,
sigma = 1,
epsilon = 0.015,
water_content = NULL,
use_MC = FALSE
)
## S4 method for signature 'CalibrationCurve,GammaSpectra'
dose_predict(
object,
spectrum,
sigma = 1,
epsilon = 0.015,
water_content = NULL,
use_MC = FALSE
)
Arguments
object |
A GammaSpectra or CalibrationCurve object. |
background |
A GammaSpectrum object or a length-two |
doses |
A |
... |
Currently not used. |
spectrum |
An optional GammaSpectrum or GammaSpectra object in which to look for variables with which to predict. If omitted, the fitted values are used. |
range_Ni , range_NiEi |
A length-two |
details |
A |
sigma |
A |
epsilon |
A |
water_content |
|
use_MC |
A |
Details
To estimate the gamma dose rate, one of the calibration curves distributed with this package can be used. These built-in curves are in use in several luminescence dating laboratories and can be used to replicate published results. As these curves are instrument specific, the user may have to build its own curve.
The construction of a calibration curve requires a set of reference spectra for which the gamma dose rate is known and a background noise measurement. First, each reference spectrum is integrated over a given interval, then normalized to active time and corrected for background noise. The dose rate is finally modelled by the integrated signal value used as a linear predictor (York et al., 2004).
Value
-
dose_fit()
returns a CalibrationCurve object. -
dose_predict()
returns adata.frame
with the following columns:name
(
character
) the name of the spectra.signal_Ni
(
numeric
) the integrated signal value (according to the value ofthreshold
; seesignal_integrate()
) forenergy = FALSE
signal_err_Ni
(
numeric
) the integrated signal error value (according to the value ofthreshold
; seesignal_integrate()
) forenergy = FALSE
.dose_Ni
(
numeric
) the predicted gamma dose rate forenergy = FALSE
.dose_err_Ni
(
numeric
) the predicted gamma dose rate error forenergy = FALSE
.signal_Ni
(
numeric
) the integrated signal value (according to the value ofthreshold
; seesignal_integrate()
).signal_err_NiEi
(
numeric
) the integrated signal error value (according to the value ofthreshold
; seesignal_integrate()
) forenergy = TRUE
.dose_NiEi
(
numeric
) the predicted gamma dose rate forenergy = TRUE
.dose_err_NiEi
(
numeric
) the predicted gamma dose rate error forenergy = TRUE
.dose_final
(
numeric
) the predicted final gamma dose rate as the mean ofdose_Ni
anddose_NiEi
dose_err_final
(
numeric
) the predicted final gamma dose rate error asSE(\dot{D}_{\gamma}) = \sqrt{(\frac{SE(\dot{D}_{\gamma\mathrm{Ni}})}{\dot{D}_{\gamma\mathrm{Ni}}})^2 + (\frac{SE(\dot{D}_{\gamma\mathrm{NiEi}})}{\dot{D}_{\gamma\mathrm{NiEi}}})^2}
Uncertainty calculation of the gamma-dose rate
The analytical uncertainties of the final gamma-dose rate (SE(\dot{D}_{\gamma})
) are calculated as
follows:
\sigma_{\dot{D_\gamma}} = \sqrt((\frac{m_{\delta}s}{m})^2 + (\frac{s_{\delta}}{s})^2 + \epsilon^2)
with m
and m_{\delta}
being the slope of the fit an its uncertainty,
\sigma
the error scaler for the slope uncertainty, s
and s_{\delta}
the integrated signal and its uncertainty, and \epsilon
an additional relative uncertainty
term that can be set by the user using the argument epsilon
.
If the parameter use_MC
is set to TRUE
, the a Monte Carlo sampling approach
is chosen to approximate the uncertainties on the dose rate:
\sigma_{\dot{D_\gamma}} :=
\sqrt((\frac{SD(\mathcal{N}(\mu_{slope}, \sigma_{slope}) \times \mathcal{N}(\mu_{signal}, \sigma_{signal}) +
\mathcal{N}(\mu_{intercept}, \sigma_{intercept})) * \rho}{\dot{D_\gamma}})^2 +
\epsilon^2) * \dot{D_\gamma}
\ rho
is the parameter sigma
provided with the function call, SD
equals the
the call to sd()
, i.e. the calculation of the standard deviation. To achieve a good
Gaussian normal approximation with sample 1+e06 times (the values is fixed).
Water content correction
If gamma-dose rates are measured in the field, they are measured at "as-is"
conditions. In dating studies, however, using the dry dose rate is often
more desirable to model the long-term effect of different assumptions for
the water content. If the parameter water_content
, either as numeric
vector or as matrix with the number of rows equal to the number of
processed spectra, if different values are desired, the final
gamma-dose rate is corrected for the water content provided. Final
uncertainties are obtained using the square root of the summed squared
relative uncertainties of the dose rate and the water content.
A word of caution: When estimating the water content in the laboratory, the water analytical uncertainty is usually minimal, and it does not make sense to correct with a relative water content of, e.g., c(0.02,0.02) (2% +/- 2%) because this massively inflates the final dose rate error.
Note
See vignette(doserate)
for a reproducible example.
Author(s)
N. Frerebeau
References
Aitken, M.J. (1985). Thermoluminescence dating. London: Academic Press.
Mercier, N. & Falguères, C. (2007). Field Gamma Dose-Rate Measurement with a NaI(Tl) Detector: Re-Evaluation of the "Threshold" Technique. Ancient TL, 25(1), p. 1-4.
York, D., Evensen, N. M., Martínez, M. L. & De Basabe Delgado, J. (2004). Unified Equations for the Slope, Intercept, and Standard Errors of the Best Straight Line. American Journal of Physics, 72(3), p. 367-75. doi:10.1119/1.1632486.
See Also
Examples
## Import CNF files
## Spectra
spc_dir <- system.file("extdata/BDX_LaBr_1/calibration", package = "gamma")
spc <- read(spc_dir)
## Background
bkg_dir <- system.file("extdata/BDX_LaBr_1/background", package = "gamma")
bkg <- read(bkg_dir)
## Get dose rate values
data("clermont")
(doses <- clermont[, c("gamma_dose", "gamma_error")])
## Build the calibration curve
calib_curve <- dose_fit(spc, bkg, doses,
range_Ni = c(300, 2800),
range_NiEi = c(165, 2800))
## Plot the curve
plot(calib_curve, threshold = "Ni")
## Estimate gamma dose rates
dose_predict(calib_curve, spc)
Energy Scale Calibration
Description
Calibrates the energy scale of a gamma spectrum.
Usage
energy_calibrate(object, lines, ...)
has_energy(object)
has_calibration(object)
## S4 method for signature 'GammaSpectrum,lm'
energy_calibrate(object, lines, ...)
## S4 method for signature 'GammaSpectrum,GammaSpectrum'
energy_calibrate(object, lines, ...)
## S4 method for signature 'GammaSpectrum,CalibrationCurve'
energy_calibrate(object, lines, ...)
## S4 method for signature 'GammaSpectrum,list'
energy_calibrate(object, lines, ...)
## S4 method for signature 'GammaSpectrum,PeakPosition'
energy_calibrate(object, lines, ...)
## S4 method for signature 'GammaSpectra,list'
energy_calibrate(object, lines, ...)
## S4 method for signature 'GammaSpectra,PeakPosition'
energy_calibrate(object, lines, ...)
## S4 method for signature 'GammaSpectra,lm'
energy_calibrate(object, lines, ...)
## S4 method for signature 'GammaSpectra,GammaSpectrum'
energy_calibrate(object, lines, ...)
## S4 method for signature 'GammaSpectra,CalibrationCurve'
energy_calibrate(object, lines, ...)
## S4 method for signature 'GammaSpectrum'
has_energy(object)
## S4 method for signature 'GammaSpectra'
has_energy(object)
## S4 method for signature 'GammaSpectrum'
has_calibration(object)
## S4 method for signature 'GammaSpectra'
has_calibration(object)
## S4 method for signature 'CalibrationCurve'
has_calibration(object)
Arguments
object |
A GammaSpectrum or GammaSpectra object. |
lines |
A PeakPosition object or a |
... |
Currently not used. |
Details
The energy calibration of a spectrum is the most tricky part. To do this, the user must specify the position of at least three observed peaks and the corresponding energy value (in keV). A second order polynomial model is fitted on these energy vs channel values, then used to predict the new energy scale of the spectrum.
The package allows to provide the channel-energy pairs to be use. However, the spectrum can be noisy so it is difficult to properly determine the peak channel. In this case, a better approach may be to pre-process the spectrum (variance-stabilization, smoothing and baseline correction) and perform a peak detection. Once the identified peaks are satisfactory, you can set the corresponding energy values (in keV) and use these lines to calibrate the energy scale of the spectrum.
Regardless of the approach you choose, it is strongly recommended to check the result before proceeding.
Value
-
energy_calibrate()
returns either a GammaSpectrum or a GammaSpectra object depending on the input# -
has_energy()
andhas_calibration()
return alogical
vector.
Author(s)
N. Frerebeau
Examples
## Import a CNF file
spc_file <- system.file("extdata/LaBr.TKA", package = "gamma")
(spc <- read(spc_file))
## Set peak positions (channel) and expected energy values
calib_lines <- list(
channel = c(86, 495, 879),
energy = c(238, 1461, 2615)
)
## Adjust the energy scale
(spc1 <- energy_calibrate(spc, lines = calib_lines))
## Inspect results
plot(spc1, xaxis = "energy", yaxis = "count") +
ggplot2::geom_vline(xintercept = c(238, 1461, 2615), linetype = 3)
Get or Set Parts of an Object
Description
Getters and setters to extract or replace parts of an object.
Usage
get_hash(x)
get_names(x)
set_names(x) <- value
get_energy_calibration(x)
set_energy_calibration(x) <- value
get_livetime(x)
get_realtime(x)
get_channels(x)
get_counts(x)
get_rates(x)
get_energy(x, ...)
set_energy(x) <- value
get_method(x)
set_method(x) <- value
get_residuals(x)
range_channels(x, ...)
range_energy(x, ...)
## S4 method for signature 'GammaSpectrum'
length(x)
## S4 method for signature 'GammaSpectrum'
get_hash(x)
## S4 method for signature 'GammaSpectrum'
get_names(x)
## S4 method for signature 'GammaSpectrum'
get_livetime(x)
## S4 method for signature 'GammaSpectrum'
get_realtime(x)
## S4 method for signature 'GammaSpectrum'
get_channels(x)
## S4 method for signature 'GammaSpectrum'
get_counts(x)
## S4 method for signature 'GammaSpectrum'
get_rates(x)
## S4 method for signature 'GammaSpectrum'
get_energy(x)
## S4 method for signature 'GammaSpectrum'
range_energy(x, na.rm = FALSE)
## S4 method for signature 'GammaSpectrum'
range_channels(x, na.rm = FALSE)
## S4 method for signature 'Baseline'
get_method(x)
## S4 method for signature 'GammaSpectra'
get_hash(x)
## S4 method for signature 'GammaSpectra'
get_names(x)
## S4 method for signature 'GammaSpectra'
get_livetime(x)
## S4 method for signature 'GammaSpectra'
get_realtime(x)
## S4 method for signature 'GammaSpectra'
get_channels(x)
## S4 method for signature 'GammaSpectra'
get_counts(x)
## S4 method for signature 'GammaSpectra'
get_rates(x)
## S4 method for signature 'GammaSpectra'
get_energy(x)
## S4 method for signature 'GammaSpectra'
range_energy(x, na.rm = FALSE)
## S4 method for signature 'GammaSpectra'
range_channels(x, na.rm = FALSE)
## S4 method for signature 'DoseRateModel'
get_residuals(x)
## S4 method for signature 'PeakPosition'
get_hash(x)
## S4 method for signature 'PeakPosition'
get_channels(x)
## S4 method for signature 'PeakPosition'
get_energy(x, expected = FALSE)
## S4 replacement method for signature 'GammaSpectrum'
set_names(x) <- value
## S4 replacement method for signature 'GammaSpectrum'
set_energy_calibration(x) <- value
## S4 method for signature 'GammaSpectrum'
get_energy_calibration(x)
## S4 replacement method for signature 'Baseline'
set_method(x) <- value
## S4 replacement method for signature 'GammaSpectra'
set_names(x) <- value
## S4 replacement method for signature 'GammaSpectra'
set_energy_calibration(x) <- value
## S4 method for signature 'GammaSpectra'
get_energy_calibration(x)
## S4 replacement method for signature 'PeakPosition,numeric'
set_energy(x) <- value
Arguments
x |
An object from which to get or set element(s). |
value |
A possible value for the element(s) of |
... |
Currently not used. |
na.rm |
|
expected |
A |
Value
An object of the same sort as x
with the new values assigned.
Author(s)
N. Frerebeau
See Also
Other mutator:
subset()
Common Operations on GammaSpectrum Objects
Description
Performs common operations on GammaSpectrum
objects.
Usage
## S4 method for signature 'GammaSpectrum,GammaSpectrum'
Arith(e1, e2)
## S4 method for signature 'GammaSpectrum,numeric'
Arith(e1, e2)
## S4 method for signature 'GammaSpectrum,GammaSpectrum'
Compare(e1, e2)
## S4 method for signature 'GammaSpectrum,numeric'
Compare(e1, e2)
## S4 method for signature 'GammaSpectrum,GammaSpectrum'
Logic(e1, e2)
## S4 method for signature 'GammaSpectrum,numeric'
Logic(e1, e2)
## S4 method for signature 'GammaSpectrum,logical'
Logic(e1, e2)
## S4 method for signature 'GammaSpectrum'
Math(x)
## S4 method for signature 'GammaSpectrum'
Math2(x, digits)
## S4 method for signature 'GammaSpectrum'
Summary(x, ..., na.rm = FALSE)
Arguments
x , e1 , e2 |
An object (typically a GammaSpectrum object). |
digits |
A length-one |
... |
Further arguments passed to or from methods. |
na.rm |
A |
Group Generics
GammaSpectrum objects have support for S4 group generic functionality to operate within elements across objects:
Arith
"
+
", "-
", "*
", "^
", "\%\%
", "\%/\%
", "/
"Compare
"
==
", ">
", "<
", "!=
", "<=
", ">=
"Logic
"
&
", "|
"Math
"
abs
", "sign
", "sqrt
", "ceiling
", "floor
", "trunc
", "cummax
", "cummin
", "cumprod
", "cumsum
", "log
", "log10
", "log2
", "log1p
", "acos
", "acosh
", "asin
", "asinh
", "atan
", "atanh
", "exp
", "expm1
", "cos
", "cosh
", "cospi
", "sin
", "sinh
", "sinpi
", "tan
", "tanh
", "tanpi
", "gamma
", "lgamma
", "digamma
", "trigamma
"Math2
"
round
", "signif
"Ops
"
Arith
", "Compare
", "Logic
"Summary
"
min
", "max
", "range
", "prod
", "sum
", "any
", "all
"
Author(s)
N. Frerebeau
Examples
## No examples
Find Peaks
Description
Finds local maxima in sequential data.
Usage
peaks_find(object, ...)
## S4 method for signature 'GammaSpectrum'
peaks_find(object, method = c("MAD"), SNR = 2, span = NULL, ...)
Arguments
object |
A GammaSpectrum object. |
... |
Extra parameters to be passed to internal methods. |
method |
A |
SNR |
An |
span |
An |
Details
A local maximum has to be the highest one in the given window and has to be
higher than SNR \times noise
to be recognized as peak.
The following methods are available for noise estimation:
MAD
Median Absolute Deviation.
Value
A PeakPosition object.
Author(s)
N. Frerebeau
See Also
Other signal processing:
baseline
,
peaks_search()
,
signal_integrate()
,
signal_slice()
,
signal_split()
,
signal_stabilize()
,
smooth()
Examples
## Import a LaBr spectrum
LaBr_file <- system.file("extdata/LaBr.TKA", package = "gamma")
LaBr_spc <- read(LaBr_file)
## Find peaks by channel
(LaBr_pks <- peaks_find(LaBr_spc)) # Ugly
plot(LaBr_spc, LaBr_pks)
## Search peaks by channel
(LaBr_pks <- peaks_search(LaBr_spc, index = c(86L, 207L, 496L), span = 7))
plot(LaBr_spc, LaBr_pks, split = TRUE)
## Import a BEGe spectrum
BEGe_file <- system.file("extdata/BEGe.CNF", package = "gamma")
BEGe_spc <- read(BEGe_file)
## Search peaks by energy
(BEGe_pks <- peaks_search(BEGe_spc, index = c(47, 63, 911, 1460)))
plot(BEGe_spc, BEGe_pks, split = TRUE)
Search Peaks
Description
Search the maxima in sequential data around a given value.
Usage
peaks_search(object, index, ...)
## S4 method for signature 'GammaSpectrum,integer'
peaks_search(object, index, span = 10, tolerance = 0.025)
## S4 method for signature 'GammaSpectrum,numeric'
peaks_search(object, index, span = 10, tolerance = 0.025)
Arguments
object |
A GammaSpectrum object. |
index |
A vector giving the expected peak position.
If |
... |
Currently not used. |
span |
A |
tolerance |
A |
Value
A PeakPosition object.
Author(s)
N. Frerebeau
See Also
Other signal processing:
baseline
,
peaks_find()
,
signal_integrate()
,
signal_slice()
,
signal_split()
,
signal_stabilize()
,
smooth()
Examples
## Import a LaBr spectrum
LaBr_file <- system.file("extdata/LaBr.TKA", package = "gamma")
LaBr_spc <- read(LaBr_file)
## Find peaks by channel
(LaBr_pks <- peaks_find(LaBr_spc)) # Ugly
plot(LaBr_spc, LaBr_pks)
## Search peaks by channel
(LaBr_pks <- peaks_search(LaBr_spc, index = c(86L, 207L, 496L), span = 7))
plot(LaBr_spc, LaBr_pks, split = TRUE)
## Import a BEGe spectrum
BEGe_file <- system.file("extdata/BEGe.CNF", package = "gamma")
BEGe_spc <- read(BEGe_file)
## Search peaks by energy
(BEGe_pks <- peaks_search(BEGe_spc, index = c(47, 63, 911, 1460)))
plot(BEGe_spc, BEGe_pks, split = TRUE)
Plot
Description
Plot
Usage
## S4 method for signature 'GammaSpectrum,missing'
plot(x, xaxis = c("channel", "energy"), yaxis = c("count", "rate"), ...)
## S4 method for signature 'GammaSpectrum,Baseline'
plot(x, y, xaxis = c("channel", "energy"), yaxis = c("count", "rate"), ...)
## S4 method for signature 'GammaSpectra,missing'
plot(
x,
xaxis = c("channel", "energy"),
yaxis = c("count", "rate"),
select = NULL,
facet = FALSE,
nrow = c("fixed", "auto")
)
## S4 method for signature 'GammaSpectrum,PeakPosition'
plot(x, y, split = FALSE, span = 25)
## S4 method for signature 'CalibrationCurve,missing'
plot(
x,
error_ellipse = TRUE,
error_bar = FALSE,
energy = FALSE,
level = 0.95,
n = 50,
...
)
Arguments
x , y |
Objects to be plotted. |
xaxis , yaxis |
A |
... |
Currently not used. |
select |
A |
facet |
A |
nrow |
A |
split |
A |
span |
An |
error_ellipse |
A |
error_bar |
A |
energy |
A |
level |
length-one |
n |
A length-one |
Value
A ggplot2::ggplot object.
Author(s)
N. Frerebeau
See Also
IsoplotR::ellipse()
, IsoplotR::isochron()
Examples
# Import CNF files
spc_dir <- system.file("extdata/BDX_LaBr_1/calibration", package = "gamma")
spc <- read(spc_dir)
# Plot all spectra
plot(spc, yaxis = "rate", facet = FALSE) +
ggplot2::theme_bw()
# Plot the spectrum named 'BRIQUE'
plot(spc, xaxis = "energy", yaxis = "count", select = "BRIQUE") +
ggplot2::theme_bw()
# Plot the first three spectra
plot(spc, xaxis = "channel", yaxis = "rate", select = 1:3, facet = TRUE) +
ggplot2::theme_bw()
Data Input
Description
Reads a gamma ray spectrum file.
Usage
read(file, ...)
## S4 method for signature 'character'
read(file, extensions = c("cnf", "tka", "spe"), ...)
Arguments
file |
A |
... |
Extra parameters to be passed to |
extensions |
A |
Value
A GammaSpectra object if more than one spectrum are imported at once, else a GammaSpectrum object.
Note
Supports Canberra CNF and TKA and Kromek SPE files.
Author(s)
N. Frerebeau
See Also
Other IO:
summarise()
Examples
## Import a Canberra CNF file
cnf_file <- system.file("extdata/LaBr.CNF", package = "gamma")
(cnf_spc <- read(cnf_file))
## Import a TKA file
tka_file <- system.file("extdata/LaBr.TKA", package = "gamma")
(tka_spc <- read(tka_file))
## Import all files in a given directory
spc_dir <- system.file("extdata/BDX_LaBr_1/calibration", package = "gamma")
(spc <- read(spc_dir))
Signal Integration
Description
Integration of the spectrum including uncertainty calculation.
Usage
signal_integrate(object, background, ...)
## S4 method for signature 'GammaSpectrum,missing'
signal_integrate(object, range = NULL, energy = FALSE)
## S4 method for signature 'GammaSpectrum,GammaSpectrum'
signal_integrate(object, background, range = NULL, energy = FALSE)
## S4 method for signature 'GammaSpectrum,numeric'
signal_integrate(object, background, range = NULL, energy = FALSE)
## S4 method for signature 'GammaSpectra,missing'
signal_integrate(object, range = NULL, energy = FALSE, simplify = TRUE)
## S4 method for signature 'GammaSpectra,GammaSpectrum'
signal_integrate(
object,
background,
range = NULL,
energy = FALSE,
simplify = TRUE
)
## S4 method for signature 'GammaSpectra,numeric'
signal_integrate(
object,
background,
range = NULL,
energy = FALSE,
simplify = TRUE
)
Arguments
object |
A GammaSpectrum or GammaSpectra object. |
background |
A GammaSpectrum object. |
... |
Currently not used. |
range |
A length-two |
energy |
A |
simplify |
A |
Details
The function supports two integration techniques (see Guérin & Mercier 2011), the (1) count threshold integration and the (2) energy integration method:
The count integration technique (energy = FALSE
) integrates
all counts in given range
:
A = \frac{\Sigma_{i}^{N}S_i}{t_{live}}
Contrary, the energy integration techniques is the integrated cross-product of counts and corresponding energy per channel:
A = \frac{\Sigma_{i}^{N}S_i \times E_i}{t_{live}}
A
is the area, S_i
is the signal in the i^{th}
channel,
N
the number of channels, E_i
the energy of the corresponding
channel in keV. t_{live}
is the live time of the measurement in s.
For calculating the uncertainties, Poisson statistics are assumed and hence the errors is calculated as:
\sigma_A = \frac{\sqrt{A}}{t_{live}}
Value
If simplify
is FALSE
(the default) returns a list
of numeric vectors
(the signal value and its error), else returns a matrix
.
Note
The integration assumes that each spectrum has an energy scale.
Author(s)
N. Frerebeau
References
Guérin, G. & Mercier, M. (2011). Determining Gamma Dose Rates by Field Gamma Spectroscopy in Sedimentary Media: Results of Monte Carlo Simulations. Radiation Measurements, 46(2), p. 190-195. doi:10.1016/j.radmeas.2010.10.003.
Mercier, N. & Falguères, C. (2007). Field Gamma Dose-Rate Measurement with a NaI(Tl) Detector: Re-Evaluation of the "Threshold" Technique. Ancient TL, 25(1), p. 1-4.
See Also
Other signal processing:
baseline
,
peaks_find()
,
peaks_search()
,
signal_slice()
,
signal_split()
,
signal_stabilize()
,
smooth()
Choose channels by Position
Description
Choose channels by position.
Usage
signal_slice(object, ...)
## S4 method for signature 'GammaSpectrum'
signal_slice(object, ...)
## S4 method for signature 'GammaSpectra'
signal_slice(object, ...)
Arguments
object |
A GammaSpectrum or GammaSpectra object. |
... |
|
Details
Either positive values to keep, or negative values to drop, should be provided. The values provided must be either all positive or all negative.
If no value is provided, an attempt is made to define the number of channels to skip at the beginning of the spectrum. This drops all channels before the highest count maximum. This is intended to deal with the artefact produced by the rapid growth of random background noise towards low energies.
Value
A GammaSpectrum or GammaSpectra object.
Author(s)
N. Frerebeau
See Also
Other signal processing:
baseline
,
peaks_find()
,
peaks_search()
,
signal_integrate()
,
signal_split()
,
signal_stabilize()
,
smooth()
Examples
## Import CNF files
spc_file <- system.file("extdata/LaBr.CNF", package = "gamma")
spc <- read(spc_file)
## Plot spectrum
plot(spc)
## Slice
sliced <- signal_slice(spc)
plot(sliced)
sliced <- signal_slice(spc, -c(1:35))
plot(sliced)
sliced <- signal_slice(sliced, 450:550)
plot(sliced)
## Split
g <- rep(c("A", "B", "C"), c(250, 500, 274))
splited <- signal_split(spc, g)
plot(splited, facet = TRUE)
Split
Description
Split
Usage
signal_split(object, ...)
## S4 method for signature 'GammaSpectrum'
signal_split(object, groups)
Arguments
object |
A GammaSpectrum object. |
... |
Currently not used. |
groups |
A a |
Value
A GammaSpectra object.
Author(s)
N. Frerebeau
See Also
Other signal processing:
baseline
,
peaks_find()
,
peaks_search()
,
signal_integrate()
,
signal_slice()
,
signal_stabilize()
,
smooth()
Examples
## Import CNF files
spc_file <- system.file("extdata/LaBr.CNF", package = "gamma")
spc <- read(spc_file)
## Plot spectrum
plot(spc)
## Slice
sliced <- signal_slice(spc)
plot(sliced)
sliced <- signal_slice(spc, -c(1:35))
plot(sliced)
sliced <- signal_slice(sliced, 450:550)
plot(sliced)
## Split
g <- rep(c("A", "B", "C"), c(250, 500, 274))
splited <- signal_split(spc, g)
plot(splited, facet = TRUE)
Transform Intensities
Description
Transform Intensities
Usage
signal_stabilize(object, ...)
## S4 method for signature 'GammaSpectrum'
signal_stabilize(object, f, ...)
## S4 method for signature 'GammaSpectra'
signal_stabilize(object, f, ...)
Arguments
object |
A GammaSpectrum object. |
... |
Extra arguments to be passed to |
f |
A |
Details
The stabilization step aims at improving the identification of peaks with a low signal-to-noise ratio. This particularly targets higher energy peaks.
Value
A GammaSpectrum or GammaSpectra object with transformed intensities.
Author(s)
N. Frerebeau
See Also
Other signal processing:
baseline
,
peaks_find()
,
peaks_search()
,
signal_integrate()
,
signal_slice()
,
signal_split()
,
smooth()
Smooth
Description
Smoothes intensities.
Usage
signal_smooth(object, ...)
smooth_rectangular(object, ...)
smooth_triangular(object, ...)
smooth_savitzky(object, ...)
## S4 method for signature 'GammaSpectrum'
signal_smooth(object, method = c("rectangular", "triangular", "savitzky"), ...)
## S4 method for signature 'GammaSpectra'
signal_smooth(object, method = c("rectangular", "triangular", "savitzky"), ...)
## S4 method for signature 'GammaSpectrum'
smooth_rectangular(object, m = 3, ...)
## S4 method for signature 'GammaSpectra'
smooth_rectangular(object, m = 3, ...)
## S4 method for signature 'GammaSpectrum'
smooth_savitzky(object, m = 3, p = 2, ...)
## S4 method for signature 'GammaSpectra'
smooth_savitzky(object, m = 3, p = 2, ...)
## S4 method for signature 'GammaSpectrum'
smooth_triangular(object, m = 3, ...)
## S4 method for signature 'GammaSpectra'
smooth_triangular(object, m = 3, ...)
Arguments
object |
A GammaSpectrum or GammaSpectra object. |
... |
Extra parameters to be passed to further methods. |
method |
A |
m |
An odd |
p |
An |
Details
The following smoothing methods are available:
rectangular
Unweighted sliding-average or rectangular smooth. It replaces each point in the signal with the average of
m
adjacent points.triangular
Weighted sliding-average or triangular smooth. It replaces each point in the signal with the weighted mean of
m
adjacent points.savitzky
Savitzky-Golay filter. This method is based on the least-squares fitting of polynomials to segments of
m
adjacent points.
There will be (m - 1) / 2
points both at the beginning and at the end
of the spectrum for which a complete m
-width smooth cannot be
calculated. To prevent data loss, progressively smaller smooths are used at
the ends of the spectrum if method
is unweighted
or weighted
. If the
Savitzky-Golay filter is used, the original (m - 1) / 2
points at the
ends of the spectrum are preserved.
Value
A GammaSpectrum or GammaSpectra object.
Author(s)
N. Frerebeau
References
Gorry, P. A. (1990). General Least-Squares Smoothing and Differentiation by the Convolution (Savitzky-Golay) Method. Analytical Chemistry, 62(6), p. 570-573. doi:10.1021/ac00205a007.
Savitzky, A. & Golay, M. J. E. (1964). Smoothing and Differentiation of Data by Simplified Least Squares Procedures. Analytical Chemistry, 36(8), p. 1627-1639. doi:10.1021/ac60214a047.
See Also
Other signal processing:
baseline
,
peaks_find()
,
peaks_search()
,
signal_integrate()
,
signal_slice()
,
signal_split()
,
signal_stabilize()
Examples
# Import CNF files
spc_file <- system.file("extdata/LaBr.CNF", package = "gamma")
spc <- read(spc_file)
spc <- signal_slice(spc, -c(1:35))
# Plot raw spectrum
spc_clean <- signal_correct(spc)
plot(spc_clean)
# Rectangular smooth
spc_unweighted <- smooth_rectangular(spc, m = 3)
spc_unweighted_clean <- signal_correct(spc_unweighted)
plot(spc_unweighted_clean)
# Triangular smooth
spc_weighted <- smooth_triangular(spc, m = 5)
spc_weighted_clean <- signal_correct(spc_weighted)
plot(spc_weighted_clean)
# Savitzky–Golay
spc_savitzky <- smooth_savitzky(spc, m = 21, p = 2)
spc_savitzky_clean <- signal_correct(spc_savitzky)
plot(spc_savitzky_clean)
Extract or Replace Parts of an Object
Description
Operators acting on objects to extract or replace parts.
Usage
## S4 method for signature 'GammaSpectrum'
x[[i]]
## S4 method for signature 'GammaSpectra'
x[i, j]
## S4 method for signature 'DoseRateModel'
x[[i]]
## S4 method for signature 'CalibrationCurve'
x[[i]]
## S4 method for signature 'PeakPosition'
x[[i]]
Arguments
x |
An object from which to extract element(s) or in which to replace element(s). |
i , j |
Indices specifying elements to extract or replace. Indices are
|
Value
A subsetted object.
Author(s)
N. Frerebeau
See Also
Other mutator:
mutator
Summarize
Description
Summarize
Usage
summarise(object, ...)
## S4 method for signature 'GammaSpectrum'
summarise(object)
## S4 method for signature 'GammaSpectra'
summarise(object)
## S4 method for signature 'DoseRateModel'
summarise(object)
## S4 method for signature 'CalibrationCurve'
summarise(object)
Arguments
object |
A GammaSpectrum or GammaSpectra object. |
... |
Currently not used. |
Value
A data.frame
.
Author(s)
N. Frerebeau
See Also
Other IO:
read()
Examples
## Import a Canberra CNF file
cnf_file <- system.file("extdata/LaBr.CNF", package = "gamma")
spc <- read(cnf_file)
summarise(spc)
## Import all CNF files in a given directory
spc_dir <- system.file("extdata/BDX_LaBr_1/calibration", package = "gamma")
spc <- read(spc_dir)
summarise(spc)