xrd.peakEstimate.Rd
Simple peak position estimate, yields largest peak only in a particular data set. This is not a fit, just an estimate based on the data at hand. It returns the background (b0), the amplitude (A0), the peak position (th0), and the half-width sigma (s0). In order to learn more, turn on the *verbose* output.
xrd.peakEstimate(twoTheta, I, verbose = FALSE)
XRD 2q angle
intensity
logical, if TRUE
, prints a graph of the data and fit
4 estimated parameters: background (b0), amplitude (A0), peakposition (th0), and half-width (s0)
d = xrd.import(xrd.getSampleFiles()[1])
d = subset(d, theta > 30 & theta < 42)
p = xrd.peakEstimate(d$theta, d$I)
plot(d$theta, d$I, col='red'); abline(v=p[3], lwd=2)
abline(h=p[1], col='darkgrey')
p
#> $b0
#> [1] 664.5614
#>
#> $A0
#> [1] 640.8772
#>
#> $th0
#> [1] 38.20684
#>
#> $s0
#> [1] 0.9004582
#>