Corrects artifacts in a spectrum based on reference spectra of the artifact compound
Source:R/ir_correct_atmosphere.R
ir_correct_atmosphere.Rd
ir_correct_atmosphere
takes two objects of class ir
with the same number
of spectra in each and corrects the spectra of the first object with the
spectra of the second object according to the procedure presented by
(Perez-Guaita et al. 2013)
.
Usage
ir_correct_atmosphere(
x,
ref,
wn1,
wn2,
do_interpolate = FALSE,
start = NULL,
dw = 1,
warn = TRUE
)
Source
Perez-Guaita D, Kuligowski J, Quintás G, Garrigues S, de La Guardia M (2013). “Atmospheric compensation in Fourier transform infrared (FT-IR) spectra of clinical samples.” Applied spectroscopy, 67(11), 1339--1342. doi:10.1366/13-07159 .
Arguments
- x
An object of class
ir
containing the spectra to correct (with intensities representing absorbances).- ref
An object of class
ir
containing the reference spectra to use for correction (with intensities representing absorbances).ref
must have the same number of rows asx
, the contained spectra must cover the wavenumber range of all spectra inx
, and ifdo_interpolate = FALSE
, all spectra must have identical wavenumber values.- wn1
A numeric value representing the first wavenumber value to use as reference point (Perez-Guaita et al. 2013) . Examples used by Perez-Guaita et al. (2013) are:
- H\(_2\)O
3902 cm\(^{-1}\).
- CO\(_2\)
2361 cm\(^{-1}\).
- wn2
A numeric value representing the second wavenumber value to use as reference point (Perez-Guaita et al. 2013) . Examples used by Perez-Guaita et al. (2013) are:
- H\(_2\)O
3912 cm\(^{-1}\).
- CO\(_2\)
2349 cm\(^{-1}\).
- do_interpolate
A logical value indicating if
x
andref
should be interpolated prior correction (TRUE
) or not (FALSE
).- start
See
ir_interpolate()
.- dw
See
ir_interpolate()
.- warn
A logical value indicating whether warnings about mismatching wavenumber values should be displayed (
TRUE
) or not (FALSE
). If set toTRUE
andwn1
orwn2
do not exactly match the wavenumber values inx
andref
, a warning will be printed to inform about the wavenumber difference between the selected and targeted wavenumber value.
Examples
ir_correct_atmosphere(ir_sample_data, ir_sample_data, wn1 = 2361, wn2 = 2349)
#> # A tibble: 58 × 7
#> id_measurement id_sample sample_type sample_comment klason_lignin
#> * <int> <chr> <chr> <chr> <units>
#> 1 1 GN 11-389 needles Abies Firma Momi fir 0.359944
#> 2 2 GN 11-400 needles Cupressocyparis leylandii… 0.339405
#> 3 3 GN 11-407 needles Juniperus chinensis Chine… 0.267552
#> 4 4 GN 11-411 needles Metasequoia glyptostroboi… 0.350016
#> 5 5 GN 11-416 needles Pinus strobus Torulosa 0.331100
#> 6 6 GN 11-419 needles Pseudolarix amabili Golde… 0.279360
#> 7 7 GN 11-422 needles Sequoia sempervirens Cali… 0.329672
#> 8 8 GN 11-423 needles Taxodium distichum Cascad… 0.356950
#> 9 9 GN 11-428 needles Thuja occidentalis Easter… 0.369360
#> 10 10 GN 11-434 needles Tsuga caroliniana Carolin… 0.289050
#> # … with 48 more rows, and 2 more variables: holocellulose <units>,
#> # spectra <list>