Unevenly spaced field-swept data

General forum for EasySpin: questions, how to's, etc.
Post Reply
christiansen
User
Posts: 21
Joined: Thu Apr 08, 2021 7:38 am

Unevenly spaced field-swept data

Post by christiansen »

Dear Easyspin community

I am trying to fit some data where my data points (intensity vs. field) are not equally spaced along the field axis. Can pepper/esfit coomodate that? As far as I can tell from the documentation, it is only possible to define a number of point (Exp.nPoints) and either a range (Exp.Range) or a centre+width (Exp.CenterSweep).

christiansen
User
Posts: 21
Joined: Thu Apr 08, 2021 7:38 am

Re: Unevenly spaced field-swept data

Post by christiansen »

I found a solution for this: Write a custom function that interpolates a simulated spectrum using a spline and evaluate it at the unevenly spaced field values:

Code: Select all

function [B, spc] = splinespc(Sys, Exp, Opt)
Exp.nPoints = 10e4; %some arbitrary number

%Exp.XData contains the field values at which your data was measured
Exp.Range = [min(Exp.XData) max(Exp.XData)];

if exist('Opt','var')
    [Btemp,spctemp] = pepper(Sys,Exp,Opt);
else
    [Btemp,spctemp] = pepper(Sys,Exp);
end

B = Exp.XData;
spc = spline(Btemp,spctemp,B);

end

However, I think it could still be very convenient if it was possible to give a user-defined range for field values instead of simply using "Exp.Range" or "Exp.CenterRange", which gives linearly spaced points.

Stefan Stoll
EasySpin Creator
Posts: 1050
Joined: Mon Jul 21, 2014 10:11 pm
Location: University of Washington

Re: Unevenly spaced field-swept data

Post by Stefan Stoll »

Supporting unevenly (but still strictly monotonically increasing) field values could in principle be implemented, but it seems that you found an excellent and not too complicated solution for this!

Post Reply