pyepr.EPRAccessor

class pyepr.EPRAccessor(xarray_obj)[source]

Xarray accessor for EPR datasets. Provides methods for saving, phase correction, normalization, FFT, and more. These can be accessed via the .epr attribute of an xarray DataArray object. E.g. dataset.epr.save(‘filename.h5’)

Attributes

property correctphase: xarray.DataArray

Correct the phase of the dataset using the DeerLab correctphase function.

Return type:

xarray.DataArray

property normalise

In-place normalisation of the dataset to the maximum absolute value of the data.

property correctphasefull: xarray.DataArray

Correct the phase of the dataset using the DeerLab correctphase function and keeps the real and imaginary parts of the data.

Return type:

xarray.DataArray

property SNR: float

Calculate the signal-to-noise ratio of the dataset using the DeerLab der_snr function.

Return type:

float

property fft

Calculate the FFT of the dataset and returns a new dataset with the FFT applied.

property MeasurementTime

Calculate the total measurement time in seconds

property sequence: pyepr.sequences.Sequence

Extracts the PyEPR Sequence object from the dataset attributes and coordinates.

Return type:

pyepr.sequences.Sequence

Methods

save(filename, type='netCDF', overwrite=True)[source]

Save the dataset to a hdf5 file

Parameters:
filenamestr, file-like object

The name of the file to save the dataset

typestr, optional

The type of file to save, by default ‘netCDF’ (including .h5)

overwritebool, optional

Overwrite the file if it exists, by default True

merge(other, ignore_errors=True)[source]

Merge two datasets into one dataset.

Handles the following cases: 1. Both datasets have the same parameters but different axes and are 1D