Coder Social home page Coder Social logo

eprtools's Introduction

eprTools

eprTools is a package for interacting with and analyzing EPR data using numpy, scipy and sklearn. The two main classes DEERspec and CWspec corresponding to Double Electron-Electron Resonance experiments and Continuous Wave experiments

Installation

git clone https://gitlab.com/mtessmer/eprTools.git 
cd eprTools
python setup.py install

Getting Started -- CWspec

import matplotlib.pyplot as plt
from eprTools import CWSpec

# import EPR data
mySpc1 = CWSpec.from_file('Example_Apo.DTA', preprocess = True)
mySpc2 = CWSpec.from_file('Example_Holo.DTA', preprocess = True)

# plot CW spectra
fig, ax = plt.subplots()
ax.plot(mySpc1.field, mySpc1.spec)
ax.plot(mySpc2.field, mySpc2.spec)
ax.set_xlabel('field (G)')
ax.set_yticks([])
plt.show()
fig.savefig('CW.png')

CW

Getting Started -- DEERSpec

import matplotlib.pyplot as plt
from eprTools import DeerExp

# import data
spc = DeerExp.from_file('Example_DEER.DTA', r=(15, 60))

# fit data
spc.get_fit()

# plot form factor, background correction, fit and distance distribution
fig, (ax1, ax2) = plt.subplots(2, constrained_layout=True)
ax1.plot(spc.t, spc.V)
ax1.plot(spc.t, spc.Vfit)
ax1.plot(spc.t, spc.B)
ax1.set_xlabel(r'time ($\rm\mu s$)')

ax2.plot(spc.r, spc.P)
ax2.set_yticks([])
ax2.set_xlabel(r'distance ($\rm\AA$)')
plt.show()
fig.savefig('DEER.png')

DEER

# plot L-curve
rho, eta, alpha_idx = spc.get_L_curve()

fig2, ax = plt.subplots()
ax.scatter(rho, eta)
ax.scatter(rho[alpha_idx], eta[alpha_idx], c='r', facecolor=None)
ax.set_xlabel(r'$\rm\rho$')
ax.set_ylabel(r'$\rm\eta$')

plt.show()
fig2.savefig('L_curve.png')

L-curve

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.