Tim Green / MagresPython

MagresPython

MagresPython is a Python library for parsing the CCP-NC ab-initio magnetic resonance file format. This is used in the latest version of the CASTEP and Quantum ESPRESSO (PWSCF) codes.

The library is designed to allow you to write expressive code for processing the output of magnetic resonance calculations. It is designed from the ground-up to be ‘Pythonic’, that is, it is idiomatic Python and interacts well with standard conventions.

Loading the output of a calculation on an ethanol molecule and printing all the isotropic magnetic shieldings of the hydrogen atoms is as easy as

atoms = MagresAtoms.load_magres('ethanol.magres')
print atoms.species('H').ms.iso
[30.0, 30.0, 30.0, 27.0, 27.0, 32.0]

The library also comes with a number of command line helper scripts for use in the course of research, such as extract-ms.py.

It has been tested mostly on Linux (the Ubuntu distribution) and OS X.

If you have any questions about how you can use this library in your research, please contact me using the information in the footer.