Skip to main content

A Python Package for Processing Double Electron-Electron Resonance (DEER) Data

Project description

pyDEER

pyDEER is a python package for processing Double Electron-Electron Resonance (DEER) data.

The source code for pyDEER is available here.

The complete documentation for pyDEER is available here.

Installing pyDEER

python -m pip install pyDEER

Python Requirements

  • Python2 (>= 2.7)
  • Python3 (>= 3.6)

Required Modules

  • scipy
  • numpy
python -m pip install scipy numpy

Importing ELEXSYS Data

from matplotlib.pylab import *
import pyDEER as deer

# Define path to data
path = './data/20170602_NR119_test/DEER_NR119_55ave'

# Import data
t, data = deer.load_elexsys(path)

# Plot data
figure()
plot(t, data)
xlabel('Time (ns)')
ylabel('Signal (a.u.)')
show()

Performing Tikhonov Regularization

import numpy as np
from matplotlib.pylab import *
import pyDEER as deer

# Define time and distance axes
t = np.r_[-100e-9:5e-6:500j]
r = np.r_[1.5e-9:10e-9:100j]

# Generate Kernel Matrix
K = deer.kernel(t, r)

# Simulate Gaussian P(r)
P_gauss = deer.gaussian(r, 0.2e-9, 4e-9)

# Calculate DEER trace from Gaussian P(r)
S = np.dot(K, P_gauss)

# Add noise to DEER trace
S_noisy = deer.add_noise(S, 0.1)

# Perform Tikhonov Regularization
P_lambda = deer.tikhonov(K, S_noisy, lambda_ = 1.0)

# Calculate Fit of DEER trace
S_fit = np.dot(K, P_lambda)

# Plot Result
figure()
plot(t*1e9, S_noisy, label = 'data')
plot(t*1e9, S_fit, label = 'Tikhonov')
xlabel('Time (ns)')
ylabel('Signal (a.u.)')
legend()

figure('P(r)')
plot(r*1e9, P_gauss, label = 'Exact')
plot(r*1e9, P_lambda, label = 'Tikhonov')
xlabel('r (nm)')
ylabel('P(r)')
legend()
show()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyDEER-1.0.7.tar.gz (11.1 kB view details)

Uploaded Source

Built Distribution

pyDEER-1.0.7-py3-none-any.whl (11.7 kB view details)

Uploaded Python 3

File details

Details for the file pyDEER-1.0.7.tar.gz.

File metadata

  • Download URL: pyDEER-1.0.7.tar.gz
  • Upload date:
  • Size: 11.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.3.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.1

File hashes

Hashes for pyDEER-1.0.7.tar.gz
Algorithm Hash digest
SHA256 c39101207298369328034a6e5db30211bd351edcd5e3fe84054ff27d1a2cf646
MD5 f699ee5bc5a2bb9886611fe158f5174d
BLAKE2b-256 504a437e59ce1238bd02703f864f0ce1928cf471119328e7ba7e7755172c68d5

See more details on using hashes here.

File details

Details for the file pyDEER-1.0.7-py3-none-any.whl.

File metadata

  • Download URL: pyDEER-1.0.7-py3-none-any.whl
  • Upload date:
  • Size: 11.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.3.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.1

File hashes

Hashes for pyDEER-1.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 f71f4a587b8485f744356d19ef4527a27ea37671c521d4fd474844070800ae7e
MD5 da3bee945c452a8d017ccae9be5d7c8a
BLAKE2b-256 3ff1516f425e60e9a3dbd2572cb61387887ab929d013fa0bbf8124a6f048bddb

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page