Skip to main content

NeutronPy is a python library with commonly used tools for neutron scattering measurements, primarily for Triple Axis Spectrometer data, but easily applied to other types of data, including some reduced Time of Flight data. Below is a non-exhaustive list of Neutronpy’s features:

  • Triple Axis Spectrometer resolution function calculation (Translated from ResLib), including
    • Resolution ellipses

    • Instrument visualization

    • Convolution

  • Time of Flight Spectrometer resolution function calculation (based on Violini et al doi:10.1016/j.nima.2013.10.042 ), including
    • Resolution ellipses

  • Structure factor calculation, including
    • Structure factors with support for
      • Mass Normalization

      • Debye-Waller factor

      • Unit cell visualization

    • Single-ion magnetic form factor calculation

  • Least-Squares fitting (custom interface for scipy.optimize.leastsq using lmfit features), including
    • Built-in physical models

  • Basic data operations
    • Binning

    • Normalization (time/monitor)

    • Calculated peak integrated intensity, position, and width

    • Plotting

    • Slicing

  • Loading from common TAS file types, including
    • SPICE

    • ICE

    • ICP

    • MAD

See Roadmap for panned future features.

David M Fobes started development of NeutronPy while in the Neutron Scattering Group, part of the Condensed Matter Physics & Materials Science Department (CMPMSD) at Brookhaven National Laboratory, and has continued within the MPA-CMMS and A-1 groups of Los Alamos National Laboratory. Both are US Department of Energy, Office of Basic Energy Sciences funded laboratories.

NeutronPy is a work-in-progress (see the Roadmap in the wiki for indications of new upcoming features) and as such, still has many bugs, so use at your own risk; see Disclaimer. To report bugs or suggest features see Contributions.

Requirements

The following packages are required to install this library:

  • Python >= 3.6

  • numpy >= 1.10.0

  • scipy >= 1.0.0

  • lmfit >= 0.9.5

  • matplotlib >= 2.0.0

  • h5py

The following package is required to use the neutronpy entry-point gui optional feature

  • pyqt5 >= 5.4.1

The following packages are required to test this library:

  • pytest >= 3

  • mock

Installation

It is recommended that you use anaconda or pip to install NeutronPy:

conda install -c neutronpy neutronpy

or:

pip install neutronpy

See Installation for more detailed instructions.

Documentation

Documentation is available at neutronpy.github.io, or can be built using sphinx by navigating to the doc/ folder and executing make html; results will be in the doc/_build/ folder.

To ask questions you may either request access to the Neutronpy Slack Team, or create a Github issue.

Building documentation requires the following additional packages:

  • sphinx>=1.4

  • releases>=1.5.0

  • numpydoc>=0.8.0

  • neutronpy_rtd_sphinx_theme

Contributions

Contributions may be made by submitting a pull-request for review using the fork-and-pull method on GitHub. Feature requests and bug reports can be made using the GitHub issues interface. Please read the development guide for details on how to best contribute.

To discuss development you may request access to the Neutronpy Slack Team.

Disclaimer

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Metadata

Release files for neutronpy 2.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 neutronpy 2.0.0
File Size Uploaded Provenance
neutronpy-2.0.0.tar.gz 114.5 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 248.1 kB

Release files / neutronpy-2.0.0.tar.gz

Download URL neutronpy-2.0.0.tar.gz
Size 114.5 kB
Tags Source
SHA-256 checksum
How to use checksums
428720230c84a19ccf12c6a7788bca5db1c1b540a162e0c092f69fef741f7b86
BLAKE2b-256 checksum
How to use checksums
31e3f6683bfe94a63ef113ef6ecc9a8c067ab95c022a1821b144bd3dc76d1e88
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.4 CPython/3.9.0 Darwin/19.6.0

Release files / neutronpy-2.0.0-py3-none-any.whl

Download URL neutronpy-2.0.0-py3-none-any.whl
Size 133.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
53e1afa05cd52d1e456d42fe0680a7b9af4557c83328a938c84146b2c330ea48
BLAKE2b-256 checksum
How to use checksums
e78276be1a2ee73f972c8834d8c6b021908ba4c205d1f5af1e91d0a1e5ce0f67
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.4 CPython/3.9.0 Darwin/19.6.0

Security for neutronpy 2.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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