fps.powdRlib: Full pattern summation

Description Usage Arguments Details Value References Examples

View source: R/fps.R

Description

fps.powdRlib returns estimates of phase concentrations using full pattern summation of X-ray powder diffraction data.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
## S3 method for class 'powdRlib'
fps(
  lib,
  smpl,
  harmonise,
  solver,
  obj,
  refs,
  std,
  force,
  std_conc,
  normalise,
  tth_align,
  align,
  manual_align,
  tth_fps,
  shift,
  remove_trace,
  ...
)

Arguments

lib

A powdRlib object representing the reference library. Created using the powdRlib constructor function.

smpl

A data frame. First column is 2theta, second column is counts

harmonise

logical parameter defining whether to harmonise the lib and smpl. Default = TRUE. Harmonises to the intersecting 2theta range at the coarsest resolution available using natural splines.

solver

The optimisation routine to be used. One of c("BFGS", "Nelder-Mead", "CG", or "NNLS"). Default = "BFGS".

obj

The objective function to minimise when "BFGS", "Nelder-Mead", or "CG" are used as the 'solver' argument. One of c("Delta", "R", "Rwp"). Default = "Rwp". See Chipera and Bish (2002) and page 247 of Bish and Post (1989) for definitions of these functions.

refs

A character string of reference pattern ID's or names from the specified library. The ID's or names supplied must be present within the lib$phases$phase_id or lib$phases$phase_name columns. If missing from the function call then all phases in the reference library will be used.

std

The phase ID (e.g. "QUA.1") to be used as internal standard. Must match an ID provided in the refs parameter.

force

An optional string of phase ID's or names specifying which phases should be forced to remain throughout the automated full pattern summation. The ID's or names supplied must be present within the lib$phases$phase_id or lib$phases$phase_name columns.

std_conc

The concentration of the internal standard (if known) in weight percent. If unknown then use std_conc = NA (default), in which case it will be assumed that all phases sum to 100 percent.

normalise

A logical parameter to be used when the std_conc argument is defined. When normalise = TRUE the internal standard concentration is removed and the remaining phase concentrations normalised to sum to 100 percent.

tth_align

A vector defining the minimum and maximum 2theta values to be used during alignment (e.g. c(5,65)). If not defined, then the full range is used.

align

The maximum shift that is allowed during initial 2theta alignment (degrees). Default = 0.1.

manual_align

A logical operator denoting whether to optimise the alignment within the negative/position 2theta range defined in the align argument, or to use the specified value of the align argument for alignment of the sample to the standards. Default = FALSE, i.e. alignment is optimised.

tth_fps

A vector defining the minimum and maximum 2theta values to be used during full pattern summation (e.g. c(5,65)). If not defined, then the full range is used.

shift

A single numeric value denoting the maximum (positive or negative) shift, in degrees 2theta, that is allowed during the shifting of selected phases. Default = 0.

remove_trace

A single numeric value representing the limit for the concentration of trace phases to be retained, i.e. any mineral with an estimated concentration below remove_trace will be omitted. Default = 0.

...

other arguments

Details

Applies full pattern summation (Chipera & Bish, 2002, 2013; Eberl, 2003) to an XRPD sample to quantify phase concentrations. Requires a powdRlib library of reference patterns with reference intensity ratios in order to derive mineral concentrations.

Value

a list with components:

tth

a vector of the 2theta scale of the fitted data

fitted

a vector of the fitted XRPD pattern

measured

a vector of the original XRPD measurement (aligned)

residuals

a vector of the residuals (fitted vs measured)

phases

a dataframe of the phases used to produce the fitted pattern and their concentrations

phases_grouped

the phases dataframe grouped by phase_name and concentrations summed

rwp

the Rwp of the fitted vs measured pattern

weighted_pure_patterns

a dataframe of reference patterns used to produce the fitted pattern. All patterns have been weighted according to the coefficients used in the fit

coefficients

a named vector of coefficients used to produce the fitted pattern

inputs

a list of input arguments used in the function call

References

Bish, D.L., Post, J.E., 1989. Modern powder diffraction. Mineralogical Society of America.

Chipera, S.J., Bish, D.L., 2013. Fitting Full X-Ray Diffraction Patterns for Quantitative Analysis: A Method for Readily Quantifying Crystalline and Disordered Phases. Adv. Mater. Phys. Chem. 03, 47-53. doi:10.4236/ampc.2013.31A007

Chipera, S.J., Bish, D.L., 2002. FULLPAT: A full-pattern quantitative analysis program for X-ray powder diffraction using measured and calculated patterns. J. Appl. Crystallogr. 35, 744-749. doi:10.1107/S0021889802017405

Eberl, D.D., 2003. User's guide to RockJock - A program for determining quantitative mineralogy from powder X-ray diffraction data. Boulder, CA.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#Load the minerals library
data(minerals)

# Load the soils data
data(soils)

#Since the reference library is relatively small,
#the whole library can be used at once to get an
#estimate of the phases within each sample.
## Not run: 
fps_sand <-  fps(lib = minerals,
                 smpl = soils$sandstone,
                 refs = minerals$phases$phase_id,
                 std = "QUA.1",
                 align = 0.2)

fps_lime <- fps(lib = minerals,
                smpl = soils$limestone,
                refs = minerals$phases$phase_id,
                std = "QUA.1",
                align = 0.2)

fps_granite <- fps(lib = minerals,
                   smpl = soils$granite,
                   refs = minerals$phases$phase_id,
                   std = "QUA.1",
                   align = 0.2)

#Alternatively run all 3 at once using lapply

fps_soils <- lapply(soils, fps,
                    lib = minerals,
                    std = "QUA.2",
                    refs = minerals$phases$phase_id,
                    align = 0.2)

#Using the rockjock library:

data(rockjock)
data(rockjock_mixtures)

rockjock_1 <- fps(lib = rockjock,
                  smpl = rockjock_mixtures$Mix1,
                  refs = c("ORDERED_MICROCLINE",
                           "LABRADORITE",
                           "KAOLINITE_DRY_BRANCH",
                           "MONTMORILLONITE_WYO",
                           "ILLITE_1M_RM30",
                           "CORUNDUM"),
                  std = "CORUNDUM",
                  align = 0.3)

#Alternatively you can specify the internal standard
#concentration if known:
rockjock_1s <- fps(lib = rockjock,
                 smpl = rockjock_mixtures$Mix1,
                 refs = c("ORDERED_MICROCLINE",
                          "LABRADORITE",
                          "KAOLINITE_DRY_BRANCH",
                          "MONTMORILLONITE_WYO",
                          "ILLITE_1M_RM30",
                          "CORUNDUM"),
                 std = "CORUNDUM",
                 std_conc = 20,
                 align = 0.3)


## End(Not run)

benmbutler/powdR documentation built on Sept. 16, 2020, 5:03 a.m.