Skip to content

patrickmelix/NMRLineshape

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

DOI

NMRLineshape

Implements the calculation of NMR lineshapes for anisotropic, linear molecules (e.g. CO2) as presented in Bon et al. (10.1016/j.micromeso.2015.02.042). The original code and theory by E. Eisbein are published in his PhD Thesis (only in German and not available online). This implementation and an example application are described in detail in my paper 10.1002/cphc.202100489.

Requirements:

  • Python Version >3.6 (any should be fine)
  • Numpy (any recent version should be fine)

Citing:

You should cite my paper and the original paper if you're publishing data obtained using this code.

Contributing:

Please do contact me with questions or use the GitHub features to contribute.

Usage:

from nmrlineshape import NMRLineshape
import matplotlib.pyplot as plt

#Frozen, all vectors aligned
frozen = NMRLineshape([np.ones(3) for i in range(10)], nBins=1000, nIntersections=256)

#Gaseous, homogeneous random orientation
gas = NMRLineshape([np.random.normal(size=3) for i in range(1000000)], nBins=1000, nIntersections=256)

print("Eigenvalues of gaseous matrix:")
print(gas.eigenvalues)

print("Eigenvalues of frozen matrix:")
print(frozen.eigenvalues)

#Plot results
ax = plt.figure().gca()
ax.set_xlim([1.0,0.0])
ax.set_ylim([0.0,5.0])
plt.xlabel(r"Relative Chemical Shift $\sigma / \Delta$")
plt.ylabel(r"Intensity [arb. unit]")
plt.plot(frozen.shifts, frozen.intensities,marker=None,color='blue',label='Frozen',linestyle='-')
plt.plot(gas.shifts, gas.intensities,marker=None,color='red',label='Gas',linestyle='-')
plt.legend()
plt.tight_layout()
plt.savefig('lineshape-frozen-gas.png')
plt.show()

About

Calculates the NMR Lineshape of Linear Molecules

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages