A python toolbox for simulating NMR spectra
Project description
[![Build Status](https://travis-ci.org/DeepanshS/mrsimulator.svg?branch=master)](https://travis-ci.org/DeepanshS/mrsimulator) [![Documentation Status](https://readthedocs.org/projects/mrsimulator/badge/?version=stable)](https://mrsimulator.readthedocs.io/en/stable/?badge=stable) [![PyPI version](https://badge.fury.io/py/mrsimulator.svg)](https://badge.fury.io/py/mrsimulator) [![Total alerts](https://img.shields.io/lgtm/alerts/g/DeepanshS/mrsimulator.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/DeepanshS/mrsimulator/alerts/) [![Language grade: Python](https://img.shields.io/lgtm/grade/python/g/DeepanshS/mrsimulator.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/DeepanshS/mrsimulator/context:python) [![codecov](https://codecov.io/gh/DeepanshS/mrsimulator/branch/master/graph/badge.svg)](https://codecov.io/gh/DeepanshS/mrsimulator)
# Mrsimulator
Mrsimulator is a python package with methods and tools for simulating fast solid-state nuclear magnetic resonance (NMR) line-shapes. The core library is written in C, wrapped and made available in python for python users.
> :warning: The package is currently under development. We advice using with caution. Bug report are greatly appreciated.
Features At present, _mrsimulator_ offers fast-simulation of one-dimensional NMR line-shape of uncoupled spins for the following scenarios:
Spin $I=frac{1}{2}$, and quadrupole $I ge frac{1}{2}$, (See the list of supported isotopes),
Arbitrary macroscopic magnetic flux density,
Magic angle spinning (MAS) at arbitrary spin frequency,
Variable angle spinning (VAS) at arbitrary angle and spin frequency,
Static line-shape.
For more information, refer to the [documentation](https://deepanshs.github.io/mrsimulator/).
## Installation
We recommend installing [anaconda](https://www.anaconda.com/distribution/) distribution for python version 3.6 or higher. The anaconda distribution ships with numerous packages and modules including Numpy, Scipy, and Matplotlib which are useful for scientific datasets.
### Using pip
Pip is the probably the easiest way to install python packages. We recommend using pip for installing Mrsimulator. PIP is a package manager for Python packages, and is included with python version 3.4 and higher.
Mac and Linux system For mac and linux systems, we provide binary distributions of mrsimulator package for python version 3.6-3.8. To install, type the following in the terminal,
$ pip install mrsimulator
Windows For windows, we currently do not provide binary distribution. You’ll need to compile and build the mrsimulator library. Please follow the instructions below.
Install dependencies using conda
$ conda install -c conda-forge openblas fftw>=3.3.0 numpy>=1.13.3 cython>=0.29.11
Install mrsimulator using pip
$ pip install mrsimulator
### Building from source
#### Download mrsimulator package
First, clone and download the mrsimulator package from Github. If you prefer git, type the following in the terminal,
$ git clone git://github.com/DeepanshS/mrsimulator.git
else, [download](https://github.com/DeepanshS/mrsimulator) the package using the browser. Once downloaded, use the terminal to navigate to the directory containing the package (usually, the folder is named mrsimulator).
$ cd mrsimulator
#### Installing dependencies
Next, install the dependencies of the package. We recommend using conda to install the dependencies, as follows,
$ conda install -c conda-forge openblas –file requirements.txt
#### Building and Installing mrsimulator package
Because the core of the mrsimulator package is written in C, you will require a C-compiler to build and install the package. We recommend the following C-compiler for the OS types:
Mac OS - clang
Linux - gcc
Windows - msvc
Install the package with,
$ python setup.py install
## Check your build
If the installation is successful, you should be able to run the following [test file](https://raw.github.com/DeepanshS/mrsimulator-test/master/test_file.py?raw=true) in your terminal.
$ python test_file.py
This should produce the following figure.
![alt text](https://raw.githubusercontent.com/DeepanshS/mrsimulator/master/docs/_static/test_output.png)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for mrsimulator-0.2.0-cp38-cp38-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dc7bac60c960d9c6ad093b43f21e558f955c3756a936fc23feae370249415291 |
|
MD5 | 37cb9235535bdda533377c4a2eeccd8b |
|
BLAKE2b-256 | b1f9de78320157d01eebcf0cf9e698110d28b68363f699cd8ef0115e20cbd1b1 |
Hashes for mrsimulator-0.2.0-cp38-cp38-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cf79f8707c8484a71ae8fd7886851fce122680a795851620129e7200e0db636a |
|
MD5 | dae60268ddc60a25fcdae3ea890c9106 |
|
BLAKE2b-256 | a3532ffaa5333621cefc5bb51fb44b509833af82e2f818437e1e098cc25780ea |
Hashes for mrsimulator-0.2.0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7016197a30ac4a38b3b8bd67e17a5916932e1a727492ddc4c0b8034d474dc0cf |
|
MD5 | 67272fbaa4771affda33dd22d76a643b |
|
BLAKE2b-256 | c754c86dc24b317a00b8beaa023c59d06f5c0431bd9d43633ce6ed8384b83fde |
Hashes for mrsimulator-0.2.0-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0d1c54ca37288e1254f94464238609a0b917553e48d0f773a08e5ccff76530a5 |
|
MD5 | b24091d9bac26d6e38cfdc7e3d7df924 |
|
BLAKE2b-256 | 8fc0b70411817f63cf3def4eaffa7baefb6aa5f3c50c121efb78957fae410c0e |
Hashes for mrsimulator-0.2.0-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8d929304eeb8b6f4286e87a66e0fdd65357d7d10e8f66b143b7bef8a7093a4eb |
|
MD5 | 40348ed3171ed52629402857a50dfbb1 |
|
BLAKE2b-256 | 525a5c2bc39c81396c4c9e4316d646877a50588340b384ca9341c9b32d883788 |
Hashes for mrsimulator-0.2.0-cp37-cp37m-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fadc4637eef8ca0b16433968cc0a3ea1f22591fffd7be601307b3140a40bb37c |
|
MD5 | d4b98e4e4657cdf2241e0d34ce236b23 |
|
BLAKE2b-256 | d42debdd9fc6a000cef23ea79b06a4f43346227cb5801963232d916c30acacca |
Hashes for mrsimulator-0.2.0-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3fc6b5d90d316e53823580ffa90084a6e2b4e603a318643d194eb7d511c9614c |
|
MD5 | 623895ac03f70e2d6afff628dd610880 |
|
BLAKE2b-256 | 05af8759c16b07b0bd26b4feaabf436f80daa698786d2d564859574897983edc |
Hashes for mrsimulator-0.2.0-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 32a51fd690e73083e851c0b86176618ad6cfeba8a45a26bfd65d59be0bef0bd0 |
|
MD5 | 8079ee1149a264994cd98630238032c1 |
|
BLAKE2b-256 | d97d8439f2df416f24b496348929ac5bfd1533f89ec4d76f2b864ee459e2d60b |
Hashes for mrsimulator-0.2.0-cp36-cp36m-macosx_10_6_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 005ff5ee7468a91230ecb47cb40f82d21cd4b45a6e57076851412e29a12ce56a |
|
MD5 | e136a3e553819f5daa143eea4b219326 |
|
BLAKE2b-256 | cd0a64d80579df5c85b6286ebd3de6d270aec82bfe8e85280b23cf9c31f220ef |