| assess_spec | R Documentation |
assess_spec() scans spectra for common quality-control issues and
returns one row for each issue found.
assess_spec(x, ...)
## Default S3 method:
assess_spec(x, ...)
## S3 method for class 'OpenSpecy'
assess_spec(
x,
checks = c("high_tail", "silent_region", "co2_region", "missing_values",
"flat_spectrum", "negative_intensity", "low_snr"),
high_prob = 0.9,
artifact_ratio = 2,
tail_n = 5L,
silent_region = c(2420, 2550),
co2_region = c(2200, 2420),
snr_threshold = 4,
flat_tol = sqrt(.Machine$double.eps),
negative_tol = 0,
na.rm = TRUE,
report = c("issues", "all"),
snr_metric = "run_sig_over_noise",
spike_args = list(),
saturation = "auto",
saturation_min_run = NULL,
saturation_tolerance = sqrt(.Machine$double.eps),
...
)
x |
an |
checks |
character; checks to run. Options include
|
high_prob |
numeric; spectrum-wide quantile used as the high intensity threshold for the silent-region check. |
artifact_ratio |
numeric; minimum ratio between the normalized maximum
in a tail or carbon dioxide region and the normalized maximum outside both
artifact regions required to flag an issue. The default |
tail_n |
integer; number of points to check at each end of the spectrum. |
silent_region |
numeric length two; wavenumber range expected to be
mostly silent. The default is |
co2_region |
numeric length two; carbon dioxide wavenumber range. |
snr_threshold |
numeric; spectra with run signal-to-noise below this value are flagged. |
flat_tol |
numeric; maximum finite intensity range considered flat. |
negative_tol |
numeric; minimum allowed intensity before a spectrum is flagged as negative. |
na.rm |
logical; indicating whether missing values should be removed when calculating thresholds and metrics. |
report |
character; |
snr_metric |
character; signal-to-noise metric passed to
|
spike_args |
named list of arguments passed to the shared internal spike
detector when |
saturation |
|
saturation_min_run |
integer or |
saturation_tolerance |
numeric; relative equality tolerance for automatic detector plateaus. |
... |
further arguments passed to |
With report = "issues", a
data.table-class() with one row per issue found
and columns describing the spectrum, check, issue, likely cause, potential
fix, metric value, threshold, and region. If no issues are found, an empty
table with the same columns is returned. With report = "all", one
status row is returned for every requested spectrum/check pair, plus any
applicable batch-level error, with stable IDs and correction diagnostics.
Win Cowger
data("raman_hdpe")
assess_spec(raman_hdpe)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.