point_intensity: Measure spectral intensity at one wavenumber

View source: R/point_intensity.R

point_intensityR Documentation

Measure spectral intensity at one wavenumber

Description

Measures the intensity at one user-supplied wavenumber for every spectrum in an OpenSpecy object.

Usage

point_intensity(x, ...)

## Default S3 method:
point_intensity(x, ...)

## S3 method for class 'OpenSpecy'
point_intensity(x, wavenumber, method = c("nearest", "linear"), ...)

Arguments

x

an OpenSpecy object.

wavenumber

a finite numeric scalar giving the wavenumber to measure.

method

character; use "nearest" to select the nearest measured point or "linear" to interpolate between adjacent measured points.

...

additional arguments passed to methods.

Details

This function measures a specified spectral point; it does not search for a local maximum. With method = "nearest", a point exactly halfway between two measured wavenumbers uses the lower wavenumber. Linear interpolation is confined to the two adjacent measured points and never extrapolates beyond the shared wavenumber axis.

Value

A named numeric vector with one intensity per spectrum. Names and order match the columns of x$spectra. A non-finite selected or interpolated intensity is returned as NA for that spectrum. If the requested wavenumber is outside the shared axis, all values are returned as NA.

See Also

peak_ratio() for ratios between two point intensities and area_under_band() for measurements over a spectral region.

Examples

data("raman_hdpe")
point_intensity(raman_hdpe, wavenumber = 2880)
point_intensity(raman_hdpe, wavenumber = 2880, method = "linear")


OpenSpecy documentation built on Oct. 6, 2026, 1:07 a.m.