pyepr

Submodules

Attributes

Classes

Parameter

Represents a sequence or pulse parameter.

Interface

Represents the interface connection from autoEPR to the spectrometer.

Parameter

Represents a sequence or pulse parameter.

Pulse

Represents a general experimental pulse.

Detection

Represents a detection pulse.

Delay

DEPRECATION WARNING: THIS WILL BE REMOVED SOON.

RectPulse

Represents a rectangular monochromatic pulse.

Sequence

Represents an experimental pulse sequence.

HahnEchoSequence

Represents a Hahn-Echo sequence.

T2RelaxationSequence

Represents a T2 relaxation sequence. A Hahn Echo where the interpulse delay increases

FieldSweepSequence

Represents a Field Sweep (EDFS) sequence.

ReptimeScan

Represents a reptime scan of a Hahn Echo Sequence.

CarrPurcellSequence

Represents a Carr-Purcell sequence.

ResonatorProfileSequence

Builds nutation based Resonator Profile sequence.

TWTProfileSequence

Builds TWT based Resonator Profile sequence.

Parameter

Represents a sequence or pulse parameter.

Pulse

Represents a general experimental pulse.

Detection

Represents a detection pulse.

Delay

DEPRECATION WARNING: THIS WILL BE REMOVED SOON.

RectPulse

Represents a rectangular monochromatic pulse.

GaussianPulse

Represents a Gaussian monochromatic pulse.

FrequencySweptPulse

A general parent class for Frequency Swept Pulses.

HSPulse

Represents a hyperboilc secant frequency-swept pulse.

ChirpPulse

Represents a linear frequency-swept pulse.

SincPulse

Represents a general experimental pulse.

Criteria

A class for defining criteria for terminating experiments. This should

TimeCriteria

A class for defining criteria for terminating experiments. This should

SNRCriteria

A class for defining criteria for terminating experiments. This should

Parameter

Represents a sequence or pulse parameter.

FieldSweepAnalysis

Analysis and calculation of FieldSweep Experiment.

SpinSystem

Sequence

Represents an experimental pulse sequence.

CarrPurcellAnalysis

Analysis and calculation of Carr Purcell decay.

HahnEchoRelaxationAnalysis

Analysis, fitting and plotting for the HahnEchoRelaxation Sequence.

ReptimeAnalysis

Analysis and calculation of Reptime based saturation recovery.

ResonatorProfileAnalysis

Analysis and calculation of resonator profiles.

Functions

build_table(source, params, params_widths)

sop(spins, comps)

Spin Operator Matricies.

transpose_dict_of_list(d)

Turns a dictionary of lists into a list of dictionaries.

transpose_list_of_dicts(d)

Turns a list of dictionaries into a dictionary of lists.

save_file(path, str)

autoEPRDecoder(dct)

gcd(values)

Generates the greatest common dividor on a list of floats

val_in_us(Param[, axis])

Returns the value or axis of a parameter in microseconds

val_in_ns(Param)

Returns the value or axis of a parameter in nanoseconds

add_phaseshift(data, phase)

Adds a phase shift to the data

_gen_ESEEM(t, freq, depth)

Add an ESEEM modulation to a time domain signal

round_step(value, step)

val_in_ns(Param)

Returns the value or axis of a parameter in nanoseconds

val_in_us(Param[, axis])

Returns the value or axis of a parameter in microseconds

add_phaseshift(data, phase)

Adds a phase shift to the data

_gen_ESEEM(t, freq, depth)

Add an ESEEM modulation to a time domain signal

create_Nmodel(mwFreq)

Create the field sweep model for a Nitroxide spin system.

build_table(source, params, params_widths)

autoEPRDecoder(dct)

build_table(source, params, params_widths)

sop(spins, comps)

Spin Operator Matricies.

autoEPRDecoder(dct)

build_default_pulses([AWG, SPFU, tp])

get_waveform_precision()

set_waveform_precision(precision)

sop(spins, comps)

Spin Operator Matricies.

create_Nmodel(mwFreq)

Create the field sweep model for a Nitroxide spin system.

erot(*args)

Passive rotation matrix.

eyekron(M)

Calculates the Kronecker product of the identity matrix with a matrix M.

kroneye(M)

Computes the Kronecker product of a matrix with the identity matrix of the same size.

ham(SpinSystem[, elspins, nucspins])

ham_ez(SpinSystem[, B, espins])

ham_nz(SpinSystem[, B, nspins])

resfields(system, Orientations, mwFreq[, ...])

build_spectrum(system, mwFreq, Range[, knots, ...])

Build a field sweep spectrum

detect_ESEEM(dataset[, type, threshold])

Detect if the dataset is an ESEEM experiment.

plot_1Drelax(*args[, fig, axs, cmap])

Create a superimposed plot of relaxation data and fits.

ceil(number[, decimals])

floor(number[, decimals])

calc_overlap(x, func1, func2)

Calcuates the overlap between two functions.

BSpline_extra(tck_s)

optimise_spectra_position(resonator_profile, fieldsweep)

Package Contents

pyepr.build_table(source, params, params_widths)[source]
pyepr.sop(spins, comps)[source]

Spin Operator Matricies.

This function is ported from EasySpin (https://easyspin.org/easyspin/documentation/sop.html)

References:

[1] Stefan Stoll, Arthur Schweiger EasySpin, a comprehensive software package for spectral simulation and analysis in EPR J. Magn. Reson. 178(1), 42-55 (2006)

[2] Stefan Stoll, R. David Britt General and efficient simulation of pulse EPR spectra Phys. Chem. Chem. Phys. 11, 6614-6625 (2009)

Parameters:
spinslist

A list of each spin and its spin qunatum number

compsstr

The type of spin operator matrix to create. Options are: x,y,z,+,-,e

pyepr.transpose_dict_of_list(d)[source]

Turns a dictionary of lists into a list of dictionaries.

pyepr.transpose_list_of_dicts(d)[source]

Turns a list of dictionaries into a dictionary of lists.

pyepr.save_file(path, str)[source]
pyepr.autoEPRDecoder(dct)[source]
pyepr.gcd(values)[source]

Generates the greatest common dividor on a list of floats

Parameters:
valueslist

_description_

Parameters:

values (list)

pyepr.val_in_us(Param, axis=True)[source]

Returns the value or axis of a parameter in microseconds

Parameters:
Paramautodeer.Parameter

The parameter to be converted

Returns:
float or numpy.ndarray
pyepr.val_in_ns(Param)[source]

Returns the value or axis of a parameter in nanoseconds

Parameters:
Paramautodeer.Parameter

The parameter to be converted

Returns:
float or numpy.ndarray
pyepr.add_phaseshift(data, phase)[source]

Adds a phase shift to the data

Parameters:
datanumpy.ndarray

The data to be phase shifted

phasefloat

The phase shift in degrees

Returns:
numpy.ndarray
pyepr._gen_ESEEM(t, freq, depth)[source]

Add an ESEEM modulation to a time domain signal

Parameters:
tnumpy.ndarray

The time domain signal

freqfloat

The modulation frequency

depthfloat

The modulation depth

Returns:
numpy.ndarray

The

pyepr.round_step(value, step)[source]
pyepr.val_in_ns(Param)[source]

Returns the value or axis of a parameter in nanoseconds

Parameters:
Paramautodeer.Parameter

The parameter to be converted

Returns:
float or numpy.ndarray
pyepr.val_in_us(Param, axis=True)[source]

Returns the value or axis of a parameter in microseconds

Parameters:
Paramautodeer.Parameter

The parameter to be converted

Returns:
float or numpy.ndarray
pyepr.add_phaseshift(data, phase)[source]

Adds a phase shift to the data

Parameters:
datanumpy.ndarray

The data to be phase shifted

phasefloat

The phase shift in degrees

Returns:
numpy.ndarray
pyepr._gen_ESEEM(t, freq, depth)[source]

Add an ESEEM modulation to a time domain signal

Parameters:
tnumpy.ndarray

The time domain signal

freqfloat

The modulation frequency

depthfloat

The modulation depth

Returns:
numpy.ndarray

The

pyepr.create_Nmodel(mwFreq)[source]

Create the field sweep model for a Nitroxide spin system.

Parameters:
mwFreqfloat

The microwave frequency in MHz

pyepr.build_table(source, params, params_widths)[source]
pyepr.autoEPRDecoder(dct)[source]
pyepr.build_table(source, params, params_widths)[source]
pyepr.sop(spins, comps)[source]

Spin Operator Matricies.

This function is ported from EasySpin (https://easyspin.org/easyspin/documentation/sop.html)

References:

[1] Stefan Stoll, Arthur Schweiger EasySpin, a comprehensive software package for spectral simulation and analysis in EPR J. Magn. Reson. 178(1), 42-55 (2006)

[2] Stefan Stoll, R. David Britt General and efficient simulation of pulse EPR spectra Phys. Chem. Chem. Phys. 11, 6614-6625 (2009)

Parameters:
spinslist

A list of each spin and its spin qunatum number

compsstr

The type of spin operator matrix to create. Options are: x,y,z,+,-,e

pyepr.autoEPRDecoder(dct)[source]
pyepr.build_default_pulses(AWG=True, SPFU=False, tp=12)[source]
pyepr.log[source]
pyepr.get_waveform_precision()[source]
pyepr.set_waveform_precision(precision)[source]
pyepr.sop(spins, comps)[source]

Spin Operator Matricies.

This function is ported from EasySpin (https://easyspin.org/easyspin/documentation/sop.html)

References:

[1] Stefan Stoll, Arthur Schweiger EasySpin, a comprehensive software package for spectral simulation and analysis in EPR J. Magn. Reson. 178(1), 42-55 (2006)

[2] Stefan Stoll, R. David Britt General and efficient simulation of pulse EPR spectra Phys. Chem. Chem. Phys. 11, 6614-6625 (2009)

Parameters:
spinslist

A list of each spin and its spin qunatum number

compsstr

The type of spin operator matrix to create. Options are: x,y,z,+,-,e

pyepr.primary_colors = ['#D95B6F', '#42A399', '#E1AE38'][source]
pyepr.ReIm_colors = ['#D61B00', '#00BBD6'][source]
pyepr.create_Nmodel(mwFreq)[source]

Create the field sweep model for a Nitroxide spin system.

Parameters:
mwFreqfloat

The microwave frequency in MHz

pyepr.erot(*args)[source]

Passive rotation matrix.

pyepr.eyekron(M)[source]

Calculates the Kronecker product of the identity matrix with a matrix M.

Parameters: M (np.ndarray): The matrix to be multiplied with the identity matrix.

Returns: np.ndarray: The Kronecker product of the identity matrix with M.

Parameters:

M (numpy.ndarray)

pyepr.kroneye(M)[source]

Computes the Kronecker product of a matrix with the identity matrix of the same size.

Args:

M (numpy.ndarray): The matrix to compute the Kronecker product with.

Returns:

numpy.ndarray: The Kronecker product of M with the identity matrix of the same size.

pyepr.ham(SpinSystem, elspins=None, nucspins=None)[source]
pyepr.ham_ez(SpinSystem, B=None, espins=None)[source]
pyepr.ham_nz(SpinSystem, B=None, nspins=None)[source]
pyepr.resfields(system, Orientations, mwFreq, computeIntensities=True, RejectionRatio=1e-08, Range=(0, 100000000.0), Threshold=0, computeFreq2Field=True)[source]
pyepr.build_spectrum(system, mwFreq, Range, knots=19, npoints=1000, Guass_broadening=0.25)[source]

Build a field sweep spectrum

Parameters:
systemSpinSystem

The spin system it must include: I & S spins, g, A, gn

mwFreqfloat

The microwave frequency in MHz

Rangefloat

The field range in mT

knotsint, optional

The number of knots of orientation averaging, by default 19

npointsint, optional

The number of points in the spectrum, by default 1000

Returns:
xAxis: np.ndarray

The xAxis in mT

y: np.ndarray

The spectrum intensities normalised to 1

pyepr.primary_colors = ['#D95B6F', '#42A399', '#E1AE38'][source]
pyepr.detect_ESEEM(dataset, type='deuteron', threshold=1.5)[source]

Detect if the dataset is an ESEEM experiment.

Parameters:
datasetxr.DataArray

The dataset to be analyzed.

typestr, optional

The type of ESEEM experiment, either deuteron or proton, by default ‘deuteron’

thresholdfloat, optional

The SNR threshold for detection, by default 1.5

Returns:
bool

True if ESEEM is detected, False if not.

pyepr.cmap = ['#D95B6F', '#42A399'][source]
pyepr.plot_1Drelax(*args, fig=None, axs=None, cmap=cmap)[source]

Create a superimposed plot of relaxation data and fits.

Parameters:
argsad.Analysis

The 1D relaxation data to be plotted.

figFigure, optional

The figure to plot to, by default None

axsAxes, optional

The axes to plot to, by default None

cmaplist, optional

The color map to use, by default ad.cmap

pyepr.ceil(number, decimals=0)[source]
pyepr.floor(number, decimals=0)[source]
pyepr.calc_overlap(x, func1, func2)[source]

Calcuates the overlap between two functions.

Parameters:
xnp.ndarray

The x axis of the functions

func1function

The first function

func2function

The second function

Returns:
float

The overlap between the two functions.

pyepr.BSpline_extra(tck_s)[source]
pyepr.optimise_spectra_position(resonator_profile, fieldsweep, verbosity=0)[source]
pyepr.primary_colors = ['#D95B6F', '#42A399', '#E1AE38'][source]