xaspy
🔬xray absorption spectroscopy module 💫 suitable for XMCD sum rule analysis
Science Score: 54.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
✓Academic publication links
Links to: zenodo.org -
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (14.8%) to scientific vocabulary
Keywords
Repository
🔬xray absorption spectroscopy module 💫 suitable for XMCD sum rule analysis
Basic Info
- Host: GitHub
- Owner: gnzng
- License: mit
- Language: Jupyter Notebook
- Default Branch: main
- Homepage: https://gnzng.github.io/xaspy/
- Size: 3.15 MB
Statistics
- Stars: 6
- Watchers: 3
- Forks: 0
- Open Issues: 0
- Releases: 16
Topics
Metadata Files
README.md
🔬 xaspy - framework for X-ray absorption spectroscopy
🚧🚧🚧 (always) under construction, developing parallel to my PhD journey 🚧🚧🚧
This small python module wants to help with X-ray absorption spectroscopy analysis and pre-evaluation during beam times. Similar software and strongly inspired by (but mostly for EXAFS): larch. Strong focus on X-ray magnetic circular dichroism XMCD.
toc of readme
💻 installation
xaspy can be installed via PyPi or downloaded here from github as the source code.
The necessary requirements can be found in requirement.txt file. Install via pip:
bash
pip install xaspy
Update to the newest version with:
bash
pip install xaspy -U
🤖 telegram bot
As a small side project I coded a small telegram bot (see folder botsrc). The telegram bot can be added via link to you contacts: t.me/xaspy_bot or writing to @xaspybot. The first implementation is returning the X-ray absorption edges for your specific elements. The backend is provided by XrayDB.
🔬 XAS
XMCD
The function XMCD merges and interpolates the spectra for same spin angular momentum of the photon. Correlates the curves on top of each other and builds the XMCD and XAS signal. After that subtraction of different backgrounds is possible (linear, stepfunctions, ...). Also different normalization factors are possible.
hysteresis loops
For multiple hysteresis curves in one file use class mHYST with included functions. Use plot_separated() to plot multiple hysteresis loops separated. Function average_loops() takes the loop numbers and averages them.
backgrounds
the xaspy.xas.backgrounds module provides multiple possible backgrounds to correct the measured data.
⬇️ import data
beam lines
Different read in functions for special beamlines: e.g. VEKMAG/PM3 at BESSY II in Berlin.
SPECS files
Large SPECS files usually contain multiple runs in one large ASCII file. A very useful SPECS file splitter (split.py) can be found in folder utils. For usage see the docstring in the file header.
Mössbauer
First functions for the implementation of the Pi program for Mössbauer analysis. readin.PiMoss('path/filename') can no be used to import plotting data from the .dat-files generated from Pi. Different implemented plotting funtions can be called from the class.
I would recommend using the following saving procedures:
| extension | content | | ---------------- | ------------------------------------ | | filename.mos | raw data from measurement | | filename.mos.rtf | fitting information important for Pi | | filename.dat | exported ascii data table |
import of theoretical calculations
Reading functions for output files for programs like FEFF, multiX, xraylarch, quanty ...
despiking of data
This function is to remove spikes from data while loading the data into the RAM. It does not change the raw data. This function creates '.spike' file with list of columns to avoid, which will automatically be dropped while reading data in via a pandas df. Please use a basic read in function as follows:
```python
function for read in a is number of scan
def rd(a,raw=False): path = '../path/to/' file = path + 'file' a = a dff = pd.readcsv(path+'file{0:03}'.format(a), delim_whitespace=True,skiprows=[1]) # example readin if raw==False: try: with open(file+'.spike','rb') as f: b = pickle.load(f) if a in b: todrop = b[a] dff = dff.drop(todrop) #returns cleaned pandas file if .spike is existent and has an entry for scan number except: pass else: pass return dff #returns pandas file ```
Alternatively you can also load the raw or spiked data with:
python
rd(nr, raw=True)
next steps (maybe/hopefully)
- [ ] write (better) docs
- [ ] improve telegram bot
- [ ] continous integration and testing
- [ ] Total Electron Yield measurement correction
- [ ] Luminescence 2nd order correction
- [ ] improve fast despiking
- [ ] fit convolution and energy shift between theoretic and measured spectrum
- [ ] working with .rtf-files for Mössbauer spectra from Pi
- [x] write unittests
- [x] plot Mössbauer spectra from Pi
- [x] fast and basic XMCD evaluation
- [x] added telegram bot
Owner
- Name: Damian Günzing
- Login: gnzng
- Kind: user
- Location: Duisburg
- Company: University of Duisburg-Essen
- Website: gnzng.me
- Repositories: 2
- Profile: https://github.com/gnzng
exploring magnets with x-rays | PhD student in physics
Citation (CITATION.cff)
# This CITATION.cff file was generated with cffinit.
# Visit https://bit.ly/cffinit to generate yours today!
cff-version: 1.2.0
title: xaspy
message: >-
If you use this software, please cite it using the
metadata from this file.
type: software
authors:
- given-names: Damian
family-names: Günzing
email: damian@guenzing.de
affiliation: Universität Duisburg-Essen
orcid: 'https://orcid.org/0000-0002-4350-5098'
repository-code: 'https://github.com/gnzng/xaspy'
abstract: >-
This small python module wants to help with X-ray
absorption spectroscopy analysis and pre-evaluation during
beam times. Similar software and strongly inspired by (but
mostly for EXAFS): larch. Strong focus on X-ray magnetic
circular dichroism XMCD.
keywords:
- XMCD
- spectroscopy
- data evaluation
GitHub Events
Total
- Release event: 3
- Delete event: 1
- Push event: 23
- Create event: 2
Last Year
- Release event: 3
- Delete event: 1
- Push event: 23
- Create event: 2
Committers
Last synced: almost 3 years ago
All Time
- Total Commits: 123
- Total Committers: 2
- Avg Commits per committer: 61.5
- Development Distribution Score (DDS): 0.008
Top Committers
| Name | Commits | |
|---|---|---|
| gnzng | 6****g@u****m | 122 |
| gnzng | d****n@g****e | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 7 months ago
All Time
- Total issues: 0
- Total pull requests: 3
- Average time to close issues: N/A
- Average time to close pull requests: 1 minute
- Total issue authors: 0
- Total pull request authors: 2
- Average comments per issue: 0
- Average comments per pull request: 0.0
- Merged pull requests: 3
- Bot issues: 0
- Bot pull requests: 1
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
- gnzng (2)
- dependabot[bot] (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- pypi 83 last-month
- Total dependent packages: 0
- Total dependent repositories: 1
- Total versions: 22
- Total maintainers: 1
pypi.org: xaspy
Package for analysis of experimental xray absorption spectroscopy data
- Homepage: https://github.com/gnzng/xaspy
- Documentation: https://xaspy.readthedocs.io/
- License: MIT
-
Latest release: 0.3.7
published 10 months ago
Rankings
Maintainers (1)
Dependencies
- Pillow ==9.0.1
- cycler ==0.11.0
- fonttools ==4.30.0
- kiwisolver ==1.3.2
- matplotlib ==3.5.1
- numpy ==1.22.3
- packaging ==21.3
- pandas ==1.4.1
- pyparsing ==3.0.7
- python-dateutil ==2.8.2
- pytz ==2021.3
- scipy ==1.8.0
- six ==1.16.0
- actions/checkout v3 composite
- actions/setup-python v3 composite
- matplotlib *
- numpy *
- pandas *
- python-telegram-bot *
- scipy *
- xraydb *