autodeer.Relaxation

Module Contents

Classes

CarrPurcellAnalysis

Analysis and calculation of Carr Purcell decay.

ReptimeAnalysis

Analysis and calculation of Reptime based saturation recovery.

RefocusedEcho2DAnalysis

Analysis and calculation of Refocused Echo 2D data.

Functions

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.

Attributes

class autodeer.Relaxation.CarrPurcellAnalysis(dataset, sequence=None)[source]

Analysis and calculation of Carr Purcell decay.

Parameters:
dataset

_description_

Parameters:

sequence (autodeer.sequences.Sequence)

dataset[source]
data[source]
fit(type='mono')[source]

Fit the experimental CP decay

Parameters:
typestr, optional

Either a mono or double exponential decay model, by default “mono”

Parameters:

type (str)

plot(norm=True, axs=None, fig=None)[source]

Plot the carr purcell decay with fit, if avaliable.

Parameters:
normbool, optional

Normalise the fit to a maximum of 1, by default True

Returns:
Figure

The figure.

Parameters:

norm (bool)

Return type:

matplotlib.figure.Figure

check_decay(level=0.05)[source]

Checks that the data has decayed by over 5% in the entire length and less than 5% in the first 30% of the data.

Parameters:
levelfloat, optional

The level to check the decay, by default 0.05

Returns:
int

0 if both conditions are met, 1 if the decay is less than 5% in the first 30% of the data, and -1 if the decay is less than 5% in the entire length.

find_optimal(SNR_target, target_time, target_step, averages=None)[source]

Calculate the optimal inter pulse delay for a given total measurment time.

Parameters:
SNR_target: float,

The Signal to Noise ratio target.

target_timefloat

The target time in hours

target_shrtfloat

The shot repettition time of target in seconds

target_step: float

The target step size in ns.

averagesint, optional

The total number of shots taken, by default None. If None, the number of shots will be calculated from the dataset.

Returns:
float

The calculated optimal time in us

Parameters:

target_time (float)

Return type:

float

class autodeer.Relaxation.ReptimeAnalysis(dataset, sequence=None)[source]

Analysis and calculation of Reptime based saturation recovery.

Parameters:
dataset

The dataset to be analyzed.

sequenceSequence, optional

The sequence object describing the experiment. (not currently used)

Parameters:

sequence (autodeer.sequences.Sequence)

axis[source]
seq[source]
fit(**kwargs)[source]
plot(axs=None, fig=None)[source]
calc_optimal_reptime(recovery=0.9)[source]
autodeer.Relaxation.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.

autodeer.Relaxation.cmap = "['#D95B6F', '#42A399']"[source]
autodeer.Relaxation.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

class autodeer.Relaxation.RefocusedEcho2DAnalysis(dataset, sequence=None)[source]

Analysis and calculation of Refocused Echo 2D data.

Parameters:
dataset

The dataset to be analyzed.

sequenceSequence, optional

The sequence object describing the experiment. (not currently used)

Parameters:

sequence (autodeer.sequences.Sequence)

axis = '[]'[source]
dataset[source]
data[source]
_smooth(elements=3)[source]

Used SVD to smooth the 2D data.

Parameters:
elementsint, optional

The number of elements to use in the smoothing, by default 3

Returns:
np.ndarray

The smoothed data.

plot2D(contour=True, smooth=False, norm='Normal', axs=None, fig=None)[source]

Create a 2D plot of the 2D relaxation data.

Parameters:
contourbool, optional

Plot the contour of the data, by default True

normstr, optional

Normalise the data, by default ‘Normal’. Options are ‘Normal’ and ‘tau2’. With ‘tau2’ normalisation, the data is normalised to the maximum of each row.

axsAxes, optional

The axes to plot to, by default None

figFigure, optional

The figure to plot to, by default None

plot1D(axs=None, fig=None)[source]

Create a 1D plot of the 2D relaxation data.

Parameters:
axsAxes, optional

The axes to plot to, by default None

figFigure, optional

The figure to plot to, by default None

find_optimal(type, SNR_target, target_time, target_step, averages=None)[source]

Calculate the optimal inter pulse delay for a given total measurment time, using either 4pulse or 5pulse data.

Parameters:
typestr

The type of data to use, either ‘4pDEER’ or ‘5pDEER’

SNR_targetfloat

The Signal to Noise ratio target.

target_timefloat

The target time in hours

target_step: float

The target step size in ns.

averagesint, optional

The total number of shots taken, by default None. If None, the number of shots will be calculated from the dataset.

Returns:
tau1: float

The calculated optimal tau1 in us

tau2: float

The calculated optimal tau2 in us

Parameters:
  • type (str)

  • target_time (float)

Return type:

float

optimal_tau1(tau2=None)[source]