spens

Load an ascii .spe file as a numpy array.


License
MIT
Install
pip install spens==1.0.0

Documentation

PyPI version

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.