Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

resample.twotheta

Resample an XRD Pattern


Description

Resample an XRD pattern along a user-defined twotheta resolution via local spline interpolation.

Usage

resample.twotheta(
  twotheta,
  x,
  tt.min = min(twotheta),
  tt.max = max(twotheta),
  new.res = 0.02
)

Arguments

twotheta

a vector of twotheta value

x

a vector of diffraction intensities corresponding with twotheta values

tt.min

new minimum twotheta value, defaults to current minimum

tt.max

new maximum twotheta value, defaults to current maximum

new.res

new twotheta resolution, defaults to 0.02

Details

Sometimes XRD patterns are collected at different resolutions, or at a resolution that is too great for full pattern matching. This function can be used to resample patterns to a consistent twotheta resolution, or to decimate massive patterns.

Value

A dataframe with the following columns

twotheta

new sequence of twotheta values

x

resampled diffraction intensities

Author(s)

Dylan E Beaudette

References

http://casoilresource.lawr.ucdavis.edu/

See Also

Examples

data(rruff.sample)

# resample single pattern
nontronite.resamp <- with(rruff.sample,
resample.twotheta(twotheta, nontronite, new.res=0.02) )

# plot original vs. resampled pattern
plot(nontronite ~ twotheta, data=rruff.sample, type='l', col='grey')
lines(nontronite.resamp, col='blue')

aqp

Algorithms for Quantitative Pedology

v1.29
GPL (>= 3)
Authors
Dylan Beaudette [aut, cre], Pierre Roudier [aut, ctb], Andrew Brown [aut, ctb]
Initial release
2021-04-05

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.