Giter VIP home page Giter VIP logo

xanespy's Introduction

Xanespy

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.

xanespy's People

Contributors

canismarko avatar decarlof avatar khageshkumar avatar williamjudge94 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

xanespy's Issues

nanosurveryor.py has no logging import

Khagesh found that line 134 fails since you do not import any logging information. A quick way to solve this is just to import warnings and use warnings.warn

Add support for BNL FXI beamline data

I'd like to be able to use data from the Full-field X-ray Imaging (FXI) beamline at Brookhaven Naitional Lab. I e-mailed Ming Ge to ask for some test data.

Implement a mechanism for producing masks based on simple image contrast

Using the O K-edge with some ptychography data produces masks that are inverted (maybe?) from what they should be (i.e. 1's mark active material instead of background). We need to review the various edge combinations to make sure they're at least all consistent.

Also, there should be a page in the docs about using masks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.