Page 1 of 1
Unevenly spaced field-swept data
Posted: Fri Feb 17, 2023 3:24 am
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).
Re: Unevenly spaced field-swept data
Posted: Mon Feb 20, 2023 1:52 am
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.
Re: Unevenly spaced field-swept data
Posted: Thu Feb 23, 2023 2:32 pm
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!