Skip to main content

Tools for analyzing X-ray absorbance spectroscopy data

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xanespy-0.3.2.tar.gz (102.6 kB view details)

Uploaded Source

Built Distribution

xanespy-0.3.2-py3-none-any.whl (117.6 kB view details)

Uploaded Python 3

File details

Details for the file xanespy-0.3.2.tar.gz.

File metadata

  • Download URL: xanespy-0.3.2.tar.gz
  • Upload date:
  • Size: 102.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.19.1 setuptools/38.5.1 requests-toolbelt/0.8.0 tqdm/4.19.8 CPython/3.6.4

File hashes

Hashes for xanespy-0.3.2.tar.gz
Algorithm Hash digest
SHA256 2d9067e90e05a10997b0cf5c56f23c02b17acb018364dbe9457a85ea7e5b478b
MD5 3678e5c999c7b86c8a8cb377b86a6ea4
BLAKE2b-256 c6fc6e5cb6f9f0aacc0e08eaab61624afdf2ff5c74897d2566b0fc5539162e9c

See more details on using hashes here.

File details

Details for the file xanespy-0.3.2-py3-none-any.whl.

File metadata

  • Download URL: xanespy-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 117.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.19.1 setuptools/38.5.1 requests-toolbelt/0.8.0 tqdm/4.19.8 CPython/3.6.4

File hashes

Hashes for xanespy-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2779cec0e0d12ecc17da0c891653bae7da4dcc06b5cfff65e1c0678e65430b75
MD5 2ceda98c290621014b2f7bc1617868db
BLAKE2b-256 4821378ad04f4cd6c4299b3e22d7348469427de483a0f00a2c1a91930b63204a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page