Skip to main content

Load an ascii .spe file as a numpy array.

Project description

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.

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

spens-1.0.0.tar.gz (2.3 kB view hashes)

Uploaded Source

Built Distribution

spens-1.0.0-py3-none-any.whl (4.4 kB view hashes)

Uploaded Python 3

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