Skip to main content

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.

Metadata

Release files for spens 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for spens 1.0.0
File Size Uploaded
spens-1.0.0.tar.gz 2.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for spens 1.0.0
File Interpreter ABI Platform
spens-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 6.7 kB

Release files / spens-1.0.0.tar.gz

Download URL spens-1.0.0.tar.gz
Size 2.3 kB
Tags Source
SHA-256 checksum
How to use checksums
5b457fdb9f60a1c44476c17257e03459f8d4d57e84bca37c589f858a543bbf63
BLAKE2b-256 checksum
How to use checksums
0035a488abb8e2aac0accf5564ddc3c60f521e826ac0484fbe647a4237cbd017
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / spens-1.0.0-py3-none-any.whl

Download URL spens-1.0.0-py3-none-any.whl
Size 4.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f6620cfc187580a5de2a4257c65d12f50f3ca815b703f9aa8520a2674a0cf96b
BLAKE2b-256 checksum
How to use checksums
cd64cf3610eebae00b08e41f26445d0db317d79e6959b7df53cedcaa3636836b
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page