align_xy.XY {powdR}R Documentation

Align XRPD data in an XY object to a given standard

Description

align_xy.XY takes an XY object and aligns it to a given standard. An optimisation routine is used that computes a suitable linear shift.

Usage

## S3 method for class 'XY'
align_xy(x, std, xmin, xmax, xshift, ...)

Arguments

x

an XY object.

std

a dataframe of the chosen standard that each sample is aligned to (column 1 = 2theta, column 2 = counts)

xmin

the minimum 2theta value used during alignment

xmax

the maximum 2theta value used during alignment

xshift

the maximum (positive and negative) 2theta shift that is allowed during alignment

...

other arguments

Value

an XY object.

Examples

# Load soils xrd data
data(soils)

#Load minerals library
data(minerals)

## Not run: 

#Create a standard quartz pattern to align to
quartz <- data.frame(tth = minerals$tth,
                     counts = minerals$xrd$QUA.1)

unaligned <- as_multi_xy(list("quartz" = quartz,
                              "sandstone" = soils$sandstone))

plot(unaligned, wav = "Cu",
     xlim = c(26,27), normalise = TRUE)

sandstone_a <- align_xy(soils$sandstone,
                        std = quartz,
                        xmin = 10,
                        xmax = 60,
                        xshift = 0.3)

aligned <- as_multi_xy(list("quartz" = quartz,
                            "sandstone" = sandstone_a))

plot(aligned, wav = "Cu",
     xlim = c(26,27), normalise = TRUE)


## End(Not run)


[Package powdR version 1.3.0 Index]