# 13. XAFS AnalysisΒΆ

One of the primary motivations for Larch was processing XAFS data. Larch was originally conceived to be version 2 of Ifeffit [Newville (2001)a], replacing and expanding all the XAFS analysis capabilities of that package. XAFS Analysis can generally be broken into a few separate steps: This replacement is essentially complete insofar as all the main functionality of Ifeffit is available in Larch. There may still be a few minor features of Ifeffit that are not yet available, and some functionality to port from Athena [Ravel and Newville (2005)] back to the core library. In addition, there are some minor differences in implementation details, so that slightly different numerical results may be obtained. Importantly, several features are available with Larch that were not available with Ifeffit 1.2 and some small errors in Ifeffit 1.2 have been fixed.

Reading in raw data.

Making corrections to the data, and converting to \(\mu(E)\)

Pre-edge background removal and normalization.

Interpreting normalized \(mu(E)\) as XANES spectra

Post-edge background removal, conversion to \(\chi(k)\)

XAFS Fourier Transform to \(\chi(R)\)

Reading and processing FEFF Paths from external files.

Fitting XAFS \(\chi(k)\) to a sum of FEFF paths.

The XAFS-specific functions in Larch follow these general steps. They are
all kept in the `_xafs`

Group, which can be easily accessed, as this
is in the default search path.

- synopsis
Basic XAFS Functions

- 13.1. XAFS Functions: Overview and Naming Conventions
- 13.2. XAFS: Pre-edge Subtraction, Normalization, and data treatment
- 13.3. XANES Analysis: Linear Combination Analysis, Principal Component Analysis, Pre-edge Peak Fitting
- 13.4. XAFS: Post-edge Background Subtraction
- 13.5. XAFS: Fourier Transforms for XAFS
- 13.5.1. Overview of XAFS Fourier transforms
- 13.5.2. Forward XAFS Fourier transforms (\(k{\rightarrow}R\))
- 13.5.3. Reverse XAFS Fourier transforms (\(R{\rightarrow}q\))
- 13.5.4.
`ftwindow()`

: Generating Fourier transform windows - 13.5.5. Catalog of Fourier transform window
- 13.5.6. Examples: Forward XAFS Fourier transforms
- 13.5.7. Examples: Reverse XAFS Fourier transforms, Fourier Filtering

- 13.6. XAFS: Wavelet Transforms for XAFS
- 13.7. XAFS: Reading and using Feff Paths
- 13.7.1. Running Feff
- 13.7.2.
`feffpath()`

and FeffPath Groups - 13.7.3.
`path2chi()`

and`ff2chi()`

: Generating \(\chi(k)\) for a FeffPath - 13.7.4. The _feffdat Group: Full Details of the Feff.Dat File
- 13.7.5. The EXAFS Equation using Feff and FeffPath Groups
- 13.7.6. Models for Calculating \(\sigma^2\)
- 13.7.7. Example: Reading a Feff file
- 13.7.8. Example: Adding Feff files
- 13.7.9. Example: Using Path Parameters when adding Feff files

- 13.8. XAFS: Fitting XAFS to Feff Paths
- 13.8.1. The Feffit Strategy for Modeling EXAFS Data
- 13.8.2. Fit statistics and goodness-of-fit meassures for
`feffit()`

- 13.8.3. The Feffit functions in Larch
- 13.8.4.
`feffit_transform()`

and the Feffit Transform Group - 13.8.5.
`feffit_dataset()`

- 13.8.6.
`feffit()`

- 13.8.7.
`feffit_report()`

- 13.8.8. Example 1: Simple fit with 1 Path
- 13.8.9. Example 2: Fit 1 dataset with 3 Paths
- 13.8.10. Example 3: Fit 3 datasets with 1 Path each
- 13.8.11. Example 4: Measuring Coordination number
- 13.8.12. Example 5: Comparing Fits in different Fit Spaces
- 13.8.13. Example 6: Testing EXAFS sensitivity to \(Z\)

- 13.9. XAFS: Computing anomalous scattering factors from XAFS data