The following units can be converted into each other: nm, \(cm^{-1}\), eV, THz and Raman shift.
wl_convert_units(x, from, to, ref_wl = NULL)
# S3 method for default
wl_convert_units(x, from, to, ref_wl = NULL)
# S3 method for hyperSpec
wl_convert_units(x, from, to, ref_wl = NULL)
Data to be converted.
Either a hyperSpec
object or a numeric or integer vector.
(character): Source units. E.g. "nm", "1/cm", "eV", "tHz", "Raman shift".
(character): Destination units.
(numeric): Laser/Reference wavelength (required for work with Raman shift).
Object of the same class as input x
.
For hyperSpec
objects, values of @wavelength
and label of wavelengths
(@label$.wavelength
) are changed.
wl_convert_units(3200, "Raman shift", "nm", ref_wl = 785.04)
#> [1] 1048.415
wl_convert_units(785, "nm", "invcm")
#> [1] 12738.85