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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

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

Hashes for spens-1.0.0.tar.gz
Algorithm Hash digest
SHA256 5b457fdb9f60a1c44476c17257e03459f8d4d57e84bca37c589f858a543bbf63
MD5 2a472dcf55eda3b269bcae09dd8de641
BLAKE2b-256 0035a488abb8e2aac0accf5564ddc3c60f521e826ac0484fbe647a4237cbd017

See more details on using hashes here.

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

Hashes for spens-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f6620cfc187580a5de2a4257c65d12f50f3ca815b703f9aa8520a2674a0cf96b
MD5 e95078db867ebc34640371eb39d1699c
BLAKE2b-256 cd64cf3610eebae00b08e41f26445d0db317d79e6959b7df53cedcaa3636836b

See more details on using hashes here.

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