Page 1 of 1

Loading SpecMan files with EasySpin 5.0.0

Posted: Wed Jul 01, 2015 6:29 am
by collauto
Hello.
When trying to load a SpecMan file with EasySpin 5.0.0 I receive the following error messages:
[color=#FF0000]
Operands to the || and && operators must be convertible to logical scalar values.

Error in C:\Program
Files\MATLAB\R2012a\toolbox\easyspin-5.0.0\easyspin\private\eprload_specman.p>SpecManpar (line 151)

Error in C:\Program
Files\MATLAB\R2012a\toolbox\easyspin-5.0.0\easyspin\private\eprload_specman.p>eprload_specman (line
74)

Error in C:\Program Files\MATLAB\R2012a\toolbox\easyspin-5.0.0\easyspin\eprload.p>eprload (line
176)[/color]


By opening the same file with EasySpin 4.5.5, instead, no error messages were printed out and the operation could be successfully performed.
I'm using MATLAB R2012a for Windows.

Re: Loading SpecMan files with EasySpin 5.0.0

Posted: Wed Jul 01, 2015 8:51 am
by Stefan Stoll
Please post the Specman file that generates this error.

Re: Loading SpecMan files with EasySpin 5.0.0

Posted: Wed Jul 01, 2015 8:54 am
by Matt Krzyaniak
I had recently significantly updated the SpecMan import function and I thought I had covered most of the bases, at least it works on the files that we have to test with. Could you please attached the error generating file so I can troubleshoot it?

Re: Loading SpecMan files with EasySpin 5.0.0

Posted: Wed Jul 01, 2015 10:29 am
by arden13
I'm also having problems with loading *.d01 files. This is the error I receive:

Code: Select all

Invalid field name:
'SR830_lock-in_Sensitivity'.

Error in setfield (line 33)
    s.(deblank(strField)) = varargin{end};
    
Error in eprload_specman>SpecMandsc (line
130)



Error in eprload_specman (line 73)



Error in eprload (line 176)
I've included the file that is giving me this problem, albeit renamed as a *.m file. Previously in 4.5.5 I had built a *.d01 file import script that utilized the eprload function. The code is fairly simple and works for all of the *.d01 files that we've made in our lab.

Code: Select all

function [ColumnMatrix,ArrayofNames] = d01load(filename)
%Loads *.d01 files into convenient vectors
%   [ColumnMatrix,ArrayOfNames]=d01load(filename)

[~,data,~]=eprload(filename);
LD=length(data);

if exist([filename(1:end-3) 'exp']);
   %Import *.exp file as string to find param vals
   fullstr=fileread([filename(1:end-3) 'exp']);
   
   begpos=strfind(fullstr,'[aquisition]')+13;
   endpos=strfind(fullstr,'[params]')-3;
   
   searchstr=fullstr(begpos:endpos);
   clear fullstr
   
   %all of the stored vectors have ";a;" before their name
   allfields=strfind(searchstr,';a;')+3;
   LA=length(allfields);
   
   %Matrix with columns of data, start making zeros
   mat=zeros(LD/LA,LA);
   %Cell Array for names
   names=cell(1,LA);
   
   for i=1:length(allfields)-1
       names{1,i}=searchstr(allfields(i):allfields(i+1)-9);  
   end
   names{1,LA}=searchstr(allfields(end):end);
   
   %Find Field Axis & Build initial "mat" variable
   FieldNum=0;
   for i=1:length(names)
       if strfind(names{1,i},'@FLD')~=0
           FieldNum=i;
       end
       mat(:,i)=data((i-1)*LD/LA+1:i*LD/LA);
   end
   
   %Swap two columns if FLD axis exists
   if FieldNum~=0
       mat(:,[1,FieldNum])=mat(:,[FieldNum,1]);
       tstr1=names{1,1}; names{1,1}=[];
       tstr2=names{1,FieldNum}; names{1,FieldNum}=[];
       names{1,1}=tstr2;
       names{1,FieldNum}=tstr1;
%        names{[1,FieldNum],1}=names{[FieldNum,1],1};
   end
   
else
    if ~mod(LD,3)
        mat=zeros(LD/3,3);
        mat(:,1)=data(1:LD/3);
        mat(:,2)=data(LD/3+1:2*LD/3);
        mat(:,3)=data(2*LD/3+1:LD);
    elseif ~mod(LD,4)
        mat=zeros(LD/4,4);
        mat(:,1)=data(1:LD/4);
        mat(:,2)=data(LD/4+1:2*LD/4);
        mat(:,3)=data(2*LD/4+1:3*LD/4);
        mat(:,4)=data(3*LD/4+1:LD);
    elseif ~mod(LD,2)
        mat=zeros(LD/2,2);
        mat(:,1)=data(1:LD/2);
        mat(:,2)=data(LD/2+1:LD);
    else
        mat=data;
    end
    names='No *.exp File Given';
end

ColumnMatrix=mat;
ArrayofNames=names;

end

Re: Loading SpecMan files with EasySpin 5.0.0

Posted: Wed Jul 01, 2015 10:59 am
by arden13
Here is the associated *.exp file for the *.d01 I posted earlier.