In order to integrate EasySpin into your research workflow, you need to be able to import experimental data into EasySpin for analysis and simulation, and then possibly export simulated data for further processing or plotting with other applications such as Origin, IgorPro, Excel, and Bruker Xepr.
Here, we look at how you can get your data in and out of EasySpin/Matlab.
To import experimental EPR spectral data acquired on commercial spectrometers, use the eprload function. eprload
supports a variety of file formats, including those used by Bruker, Active Spectrum, magnettech, Adani and JEOL spectrometers. (Thanks to all these vendors for sharing their file format specification with EasySpin!).
Data from modern Bruker spectrometers are stored in the BES3T format, in two separate files, a data file with extension DTA and a description
file with extension DSC. You can load both by calling easyspin
with either. You can even leave the extension out. The following three statements
are all equivalent:
[B,spc] = eprload('mydata.DTA'); % Bruker BES3T [B,spc] = eprload('mydata.DSC'); % Bruker BES3T [B,spc] = eprload('mydata'); % Bruker BES3T
eprload
using
[B,spc] = eprload('myolddata.spc'); % Bruker SPC/PAR
[B,spc] = eprload('myspectrum.esr'); % Active Spectrum [B,spc] = eprload('myspectrum.dat'); % Adani [B,spc] = eprload('myspectrum.spe'); % magnettech, old binary format [B,spc] = eprload('myspectrum.xml'); % magnettech, new XML format [B,spc] = eprload('myspectrum'); % JEOL
textread
.
For two columns:
[B,spc] = textread('mydata.txt','%f %f');Often, such text files contain a header, a series of lines at the beginning that contain parameter information. These can be skipped using
[B,spc] = textread('mydata.txt','%f %f','headerlines',17);
There are several ways to export data from EasySpin and Matlab in file formats that can be read by other applications.
If you want to use Bruker spectrometer software to look at the data, export the data in Bruker BES3T
format using eprsave
eprsave('myfile',B,spc);
This will store the magnetic field vector B
and the spectral vector
spc
in the files myfile.DSC
and myfile.DTA
.
It is also possible to set the title of the data (as displayed in the Bruker software), using a
fourth input:
eprsave('myfile',B,spc,'EasySpin simulation');
If you want to save the data in a two-column text format, with the first column containing the magnetic field and the second column containing the spectral intensity, use
data = [B(:) spc(:)]; save('myfile.txt','data','-ascii');
Data can also be exported to Microsoft Excel format. Here is how it works:
data = [B(:) spc(:)]; writetable('myfile',data);