autodeer.TwoD_Experiment

Module Contents

Classes

TwoDExperimentAnalysis

This is a class for loading and processing 2D Decoherence experiments

class autodeer.TwoD_Experiment.TwoDExperimentAnalysis[source]

This is a class for loading and processing 2D Decoherence experiments

snr_target = '20'[source]
time_target = '2'[source]
trace_length = '512'[source]
noise_frac = '0.75'[source]
load(file)[source]

Using deerlab the file is loaded. If the file is a bruker .DSC file then extra paremeters are loaded. If it is a .csv or .txt file then any required metadata will need to be inputted by the user

Parameters:
filestr

This is the full file path for the datafile

import_data(time, data, scans, shots, shrt)[source]

The loads all the import infomation directly from python variables and arrays

Parameters:
time_type_

[timex,timey]

data_type_

_description_

scansint

Number of scans done

shotsint

Number of shots per point

shrtint

The shot repetition time in us

Parameters:
  • scans (int)

  • shots (int)

  • shrt (int)

import_dataset(dataset)[source]
create_bahrenberg_plots()[source]

Returns a matplotlib figure object for the standard bahrenberg figure.

_stability_check()[source]

Private method that caclulates if a value in the 2D decoherence experiment is above the snr_threshold. The complete method is a wee bit more nuanced, so check the documentation for more detail

calculate_optimal()[source]

This function calculates and finds the optimal timing pairs for both 4 pulse and 5 pulse DEER.

calculate_snr_threshold()[source]

Quick script to calculate the SNR threshold from imported values

set_snr_threshold(value)[source]

Sets the SNR_threshold

set_snr_target(value)[source]
set_time_target(value)[source]
estimated_snr(exp)[source]
snr_normalize(shots='auto')[source]

Calculates the normalized signal. If the total number of shots cannot be calculated through the Bruker metadata file then an inputted value is required. If a value is given then this is given preference over any Bruker values. This script assumes a 16 step phase cycle was applied for the 2D decoherence experiment. Paramaters: shots(Int)=’auto’’: Number of shots per point, if None then total_shots = 1. If shots = None, then it doesn’t update the main variable

calculate_noise_level()[source]

This finds the noise level from std of top right hand corner of the 2D experiment. i.e very long delays. If the std deviation is not stable enough then a warning will be thrown

create_twoD_plot(norm=None, contour=None, optimal=False, **kwargs)[source]

This is the general method for generating 2D plots of these 2D Decoherence plots. There are many optional input parmeters which will dictate how they plot. Some of these possible outputs may require more infomation then is automatically filled from Deerload. If this is a case it will return an exception.

Parameters: norm(string or None): The normalization of the fit. Options: None,’Tau2’,’SNR’,’SNRpShot’ contour(string or None): How the contours are plotted. Options: ‘Auto’, ‘SNRpShot’,’None’ optimal(bool): Should the optimal 4pulse and 5pulse pairs be plotted.

Keywords: cmap: To set a particular colormap axis: To return a subplot title: A plot title

create_slice_plot(axis, target, norm=None, **kwargs)[source]

This function returns a plot of a slice of the 2D decoherence experiment

parameters: axis(0 or 1): The direction of the the slice (0 = constant tau2; 1 = constant tau1) target(float): in us the target time for the slice, due to varying spacing this will find the closest time.

optimal_slice_plot(norm=None, **kwargs)[source]

optimal_slice_plot Creates a plot of along the optimal decay time for 4 & 5 pulse DEER.

Parameters:
normstr, optional

The normalisation of the data. Options include = [‘Tau2’,’SNR’,’SNRpShot’,’None’], by default None

invert_signal()[source]

This function completely inverts the signal. I.e. -x -> x and -y -> y.

This is usefull if the measured sameple is pi out of phase, or the phase was aligned for a Hahn echo not a refocused echo

_data_transpose()[source]

This is an internal method that flips the data along the diagnal.

value_at_pos(pos, norm=None)[source]

Function that finds the value in this 2D experiment at specified coordinates Parameters: pos(tuple): (tau1 pos, tau2 pos) norm=Nome: Can be used to select the normalisation. Options are: None, ‘SNRpShot’,’SNR’

Parameters:

pos (tuple)

value_at_time(pos, norm=None)[source]

Function that finds the closest value in this 2D experiment for specified delay times Parameters: pos(tuple): (tau1 time, tau2 time) norm=Nome: Can be used to select the normalisation. Options are: None, ‘SNRpShot’,’SNR’

Parameters:

pos (tuple)