Skip to main content
Build status Test coverage status Documentation status

Xanespy is a library for analyzing X-ray absorbance spectroscopy data for materials science, chemistry and similar fields. The major focus is on X-ray microscopy frames collected at multiple energies and over multiple timesteps. However, a design goal is for most (if not all) of the calculation routines to be applicable to bulk XAS data as well.

Motivation & Features

  • Importing and analysis of transmission X-ray microscopy framesets

  • Analysis of X-ray spectroscopy data (K-edge XANES and L-edge)

  • Efficient analysis of large operando datasets

Installation

Xanespy can be installed from the python package index (PyPI) using pip

$ pip install xanespy

Usage

Each beamline generally has its own importer in the xanespy.importers module, which will process the data and create an HDF5 file ready for the rest of xanespy to use

import xanespy

# Example for importing from SSRL 6-2c
xanespy.import_ssrl_frameset('<data_dir>',
                             hdf_filename='imported_data.h5')

# Load a pre-defined XAS edge or create your own subclass xanespy.Edge
edge = xanespy.k_edges['Ni_NCA']
# Now load the newly created HDF5 file and the X-ray absorbance edge
fs = xanespy.XanesFrameset(filename='imported_data.h5', edge=edge)

# Perform automatic frame alignment
fs.align_frames(passes=5)
# Fit the absorbance spectra and extract the edge position (SLOW!)
fs.fit_spectra()

# Inspect the result with the built-in Qt5 GUI
fs.qt_viewer()

Beamlines

We currently have importers for data from the following beamlines. If you would like support a beamline that is not listed and are willing to share some test data publicly, please open an issue.

  • 32-ID-C - Advanced Photon Source

  • 8-BM-B - Advanced Photon Source

  • 6-2c - Stanford Synchrotron Radiation Lightsource

  • 5.3.2.1 - Advanced Light Source (ptychography)

Ptychography

Xanespy has support for ptychography data from ALS beamline 5.3.2.1. Use xanespy.import_nanosurveyor_frameset to import the .cxi files and xanespy.PtychoFrameset to load the data.

License

This project is released under the GNU General Public License version 3.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

Acknowledgement

This work was supported as part of the NorthEast Center for Chemical Energy Storage (NECCES), an Energy Frontier Research Center funded by the U.S. Department of Energy, Office of Science, Basic Energy Sciences under Award # DE-SC0012583.

Release files for xanespy 0.3.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for xanespy 0.3.3
File Size Uploaded
xanespy-0.3.3.tar.gz 107.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for xanespy 0.3.3
File Interpreter ABI Platform
xanespy-0.3.3-py3-none-any.whl Python 3 none any Details

Total release size: 229.6 kB

Release files / xanespy-0.3.3.tar.gz

Download URL xanespy-0.3.3.tar.gz
Size 107.2 kB
Tags Source
SHA-256 checksum
How to use checksums
dd9b773c2df920bb03a8875961e4d7ad1b2ab8b9f516e02003f2e8aae729e4c4
BLAKE2b-256 checksum
How to use checksums
3fe2194afcbd0b1d3ce4f08bfb844d76531f57394f3e8f714d812a17f0c63691
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/36.5.0.post20170921 requests-toolbelt/0.8.0 tqdm/4.20.0 CPython/3.6.2

Release files / xanespy-0.3.3-py3-none-any.whl

Download URL xanespy-0.3.3-py3-none-any.whl
Size 122.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0f70c585c6d65361961d6142f84d9f9de6ac6e475ada8c05cf093bf730965afd
BLAKE2b-256 checksum
How to use checksums
6b28f27ab27035cdb96b6c191b06c8605942b91aa007b83f2b9c76e470c03d54
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/36.5.0.post20170921 requests-toolbelt/0.8.0 tqdm/4.20.0 CPython/3.6.2

Release history Release notifications | RSS feed

This release

0.3.3 This release

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page