Giter Site home page Giter Site logo

svey / pynmr Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bennomeier/pynmr

0.0 1.0 0.0 279 KB

A python module to import NMR data stored in Bruker / TopSpin, TecMag / NTNMR, Magritek / Kea or Chemagnetics / Spinsight format

License: MIT License

Jupyter Notebook 36.84% Python 63.16%

pynmr's Introduction

pyNMR

pyNMR is a python module to import and analyze NMR data as generated by Bruker, TecMag, Magritek and Chemagnetics Consoles.

The module also provides basic processing routines.

offsetCorrection() - zeros the mean of the real and imaginary FID data

lineBroadening() - applies exponential linebroadening

fourierTransform() - complex fourier Transform

phase() - zero-order phase correction

autoPhase(0) - retunrs the zero-order phase that maximizes the real part of the spectrum in a specified frequency range

phaseFirstOrder() - first order phase correction

leftShift() - remove specified nubmer of points from beginning of the fid

zeroFilling() - fills the fid with zeros up to the specified number

getJoinedPartialSpectra() - concatenates spectral ranges from a 2D dataset (for plotting)

getPartialSpectrum() - returns part of the spectrum

integrateRealPart() - returns the integral of the real part over a specfied frequency range

integrateAllRealPart() - returns the integrals for all the spectra in a 2D dataset

getPeak() - get the maximum value of a spectrum

getCenterFrequency() - calculate the first moment of a spectrum in a specified range

getIndexFromFrequency() - get the index of a specified frequency from the frequency axis

getIndexFromPPM() - the same, but for a specified PPM value

getIndices() - get indices as above, but for an interval. scale may be specified as Hz or ppm

checkToPos() - internal function to create a position in .allFid

getPPMScale() - get PPM scale by specifying a reference frequeny and according shift value

export() - export ascii data

Core functionality

It provides a few basic routines for Fourier Transform. It is typically used in a IPython Notebook to interactively analyze NMR Data.

The data are stored in the allFid array. After import, the first FID of a 2D dataset (or the FID of a 1D dataset) is stored in nmrData.allFid[0]

When processing nmrData, the new data maybe stored at a position incremented by 1, using the `fromPos` and `toPos` attributes of the various functions.

A typical set of processing commands is

import nmrDataMod as ndm

data = ndm.nmrData(pathToData, "TopSpin")
data.leftShift(0, 1, 70)
data.lineBroadening(1, 2, 5)
data.fourierTransform(2, 3)
data.phase(3, 4, 45, degree = True)

Various functions exist to set a chemical shift scale or calculate integrals for all spectra in a 2D dataset.

Further modules

The modules listed below provide some NMR related utiliy functions.

gammaList.py provides a table with the gamma values of the various nuclei.

fitMod.py may be used to fit nmr data interactively and includes simple models to fit data from a few very basic NMR experiments.

fwhm.py allows to calculate the full with at half maximum of a spectrum

polarization.py provides a routine to calculate thermal polarization as function of nucleus, field and temperature.

nutation.py implements a formula to estimate the ฯ€/2 pulse by specifying coil volume, circuit Q, Larmor frequency and RF power.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.