pyepr.FieldSweepAnalysis

class pyepr.FieldSweepAnalysis(dataset)

Analysis and calculation of FieldSweep Experiment.

Parameters:
datasetxarray.Dataarray

_description_

Parameters:

dataset (xarray.DataArray)

data
find_max()

Calculates the maximum field

Returns:
float

Max field

Return type:

float

calc_gyro(freq=None, **kwargs)

Calculates the gyromagnetic ratio for a given frequency

Parameters:
det_frqfloat

The detection frequency for the field sweep.

Returns:
float

The gyromagnetic ratio in G/GHz.

Parameters:

freq (float)

Return type:

float

calc_noise_level(SNR_target=30)
smooth(smoothing_factor=0.01, *args, **kwargs)

Generates a smoothed version of the data using a 1D smoothing spline.

Parameters:
smoothing_factorfloat, optional

The smoothing factor of the spline, by default 0.01. A value of 0 will interpolate the data and None will set the smoothing factor to the number of points.

Returns:
np.ndarray

The smoothed data.

fit(spintype='N', **kwargs)
plot(norm=True, axis='field', bandwidth=False, axs=None, fig=None)

Generate a field sweep plot

Parameters:
normbool, optional

Nomarlisation of the plot to a maximum of 1, by default True

axisstr, optional

plot field sweep on either the “field” axis or “freq” axis

bandwidthbool, optional

If True, the bandwidth is calculated and displayed on the plot, by default False

axsMatplotlib.Axes, optional

Matplotlib axes to plot on, by default None

figMatplotlib.Figure, optional

Matplotlib figure to plot on, by default None

Returns:
Matplotlib.Figure

matplotlib figure

Parameters:
  • norm (bool)

  • axis (str)

Return type:

matplotlib.figure.Figure

calculate_bandwidth(level=20)

Calculates the bandwidth of the field sweep data at a given level in dB

Parameters:
levelint, optional

The level in dB to calculate the bandwidth, by default 20

Returns:
float

The lower frequency

float

The upper frequency

float

The bandwidth