.. py:class:: TwoDExperimentAnalysis This is a class for loading and processing 2D Decoherence experiments .. !! processed by numpydoc !! .. py:attribute:: snr_target :value: '20' .. py:attribute:: time_target :value: '2' .. py:attribute:: trace_length :value: '512' .. py:attribute:: noise_frac :value: '0.75' .. py:method:: load(file) 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: **file** : str This is the full file path for the datafile .. !! processed by numpydoc !! .. py:method:: import_data(time, data, scans, shots, shrt) The loads all the import infomation directly from python variables and arrays :Parameters: **time** : _type_ [timex,timey] **data** : _type_ _description_ **scans** : int Number of scans done **shots** : int Number of shots per point **shrt** : int The shot repetition time in us .. !! processed by numpydoc !! .. py:method:: import_dataset(dataset) .. py:method:: create_bahrenberg_plots() Returns a matplotlib figure object for the standard bahrenberg figure. .. !! processed by numpydoc !! .. py:method:: _stability_check() 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 .. !! processed by numpydoc !! .. py:method:: calculate_optimal() This function calculates and finds the optimal timing pairs for both 4 pulse and 5 pulse DEER. .. !! processed by numpydoc !! .. py:method:: calculate_snr_threshold() Quick script to calculate the SNR threshold from imported values .. !! processed by numpydoc !! .. py:method:: set_snr_threshold(value) Sets the SNR_threshold .. !! processed by numpydoc !! .. py:method:: set_snr_target(value) .. py:method:: set_time_target(value) .. py:method:: estimated_snr(exp) .. py:method:: snr_normalize(shots='auto') 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 .. !! processed by numpydoc !! .. py:method:: calculate_noise_level() 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 .. !! processed by numpydoc !! .. py:method:: create_twoD_plot(norm=None, contour=None, optimal=False, **kwargs) 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 .. !! processed by numpydoc !! .. py:method:: create_slice_plot(axis, target, norm=None, **kwargs) 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. .. !! processed by numpydoc !! .. py:method:: optimal_slice_plot(norm=None, **kwargs) optimal_slice_plot Creates a plot of along the optimal decay time for 4 & 5 pulse DEER. :Parameters: **norm** : str, optional The normalisation of the data. Options include = ['Tau2','SNR','SNRpShot','None'], by default None .. !! processed by numpydoc !! .. py:method:: invert_signal() 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 .. !! processed by numpydoc !! .. py:method:: _data_transpose() This is an internal method that flips the data along the diagnal. .. !! processed by numpydoc !! .. py:method:: value_at_pos(pos, norm=None) 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' .. !! processed by numpydoc !! .. py:method:: value_at_time(pos, norm=None) 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' .. !! processed by numpydoc !!