Learn R Programming

gamma (version 1.1.0)

signal_slice: Choose channels by Position

Description

Choose channels by position.

Usage

signal_slice(object, ...)

# S4 method for GammaSpectrum signal_slice(object, ...)

# S4 method for GammaSpectra signal_slice(object, ...)

Value

A GammaSpectrum or GammaSpectra object.

Arguments

object

A GammaSpectrum or GammaSpectra object.

...

integer values giving the channels of the spectrum to be kept/dropped (see below). Numeric values are coerced to integer as by as.integer() (and hence truncated towards zero).

Author

N. Frerebeau

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.

See Also

Other signal processing: baseline, peaks_find(), peaks_search(), signal_integrate(), signal_split(), signal_stabilize(), smooth()

Examples

Run this code
## 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)

Run the code above in your browser using DataLab