Load an ascii .spe file as a numpy array.
Project description
spens
is a simple python package that does one thing: loads an ascii .spe file containing neutron scattering (NS) from disk and return numpy
arrays containing the wavevector (Q), energy (E), scattering intensity (S) and error (ΔS).
Supported Python Versions
Python >= 3.6 (for f-strings)
Installation
To install via pip:
pip install spens
Or from within a notebook:
import sys
!{sys.executable} -m pip install spens
Usage
The library implements a single function load_spe
which takes the filename of a .spe
file and return numpy
arrays.
import spesns
import numpy as np
# load the data
Q,E,S,ΔS = spe.load_file(f'/path/to/scattering/file.spe')
# create meshes for plotting
Emesh,Qmesh = np.meshgrid(E,Q)
Support
The creation of this software was supported in part by the National Science Foundation under Award Nos. DMR-1808440 and DMR-1809027.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file spens-1.0.0.tar.gz
.
File metadata
- Download URL: spens-1.0.0.tar.gz
- Upload date:
- Size: 2.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.23.0 setuptools/52.0.0.post20210125 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.7.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5b457fdb9f60a1c44476c17257e03459f8d4d57e84bca37c589f858a543bbf63 |
|
MD5 | 2a472dcf55eda3b269bcae09dd8de641 |
|
BLAKE2b-256 | 0035a488abb8e2aac0accf5564ddc3c60f521e826ac0484fbe647a4237cbd017 |
File details
Details for the file spens-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: spens-1.0.0-py3-none-any.whl
- Upload date:
- Size: 4.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.23.0 setuptools/52.0.0.post20210125 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.7.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f6620cfc187580a5de2a4257c65d12f50f3ca815b703f9aa8520a2674a0cf96b |
|
MD5 | e95078db867ebc34640371eb39d1699c |
|
BLAKE2b-256 | cd64cf3610eebae00b08e41f26445d0db317d79e6959b7df53cedcaa3636836b |