pyepr.relaxation_analysis.CarrPurcellAnalysis

class pyepr.relaxation_analysis.CarrPurcellAnalysis(dataset, sequence=None)

Analysis and calculation of Carr Purcell decay.

Parameters:
dataset

_description_

Attributes:
axisxr.DataArray

The time axis representing the interpulse delay.

Parameters:

sequence (pyepr.sequences.Sequence)

data
dataset
noise
fit(type='mono', **kwargs)

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, ci=50, axs=None, fig=None)

Plot the carr purcell decay with fit, if avaliable.

Parameters:
normbool, optional

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

ciint, optional

The percentage confidence interval to plot, by default 50

Returns:
Figure

The figure.

Parameters:

norm (bool)

Return type:

matplotlib.figure.Figure

check_decay(level=0.1)

Checks that the data has decayed by over 90% in the first half, and less than 90% in the first quarter.

Parameters:
levelfloat, optional

The level to check the decay, by default 0.05

Returns:
int

0 if both conditions are met, 1 if a longer decay is needed, and -1 if the decay is too long.

find_optimal(SNR_target, target_time, target_step, averages=None)

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

__call__(x, norm=True, SNR=False, source=None)

Evaluate the fit or data at a given x value.

Parameters:
xfloat

The x value to evaluate the data at.

normbool, optional

Normalise the data to the maximum, by default True

SNRbool, optional

Return the SNR_per_sqrt(shot) for this data point, by default False If True, the data is normalised to the maximum of the data.

sourcestr, optional

The source of the data, either ‘fit’ or ‘data’, by default None If None, the source is determined by the presence of a fit result.