I am simulating some Hyscore experiments, is there an easy way to export the results to Bruker and/or text (in the format that bruker exports Hyscore - t1, t2, real, imag)?
Thanks,
Eric
2D data export
-
- EasySpin Creator
- Posts: 1120
- Joined: Mon Jul 21, 2014 10:11 pm
- Location: University of Washington
Re: 2D data export
Have you tried
eprsave
?-
- User
- Posts: 13
- Joined: Mon Dec 28, 2015 3:49 pm
Re: 2D data export
I tried eprsave, but am not sure if the format will adapt to hyscore, the documentation only shows x-y input - eprsave(FileName,x,y,TitleString,mwFreq). I tried:
eprsave('hysc',t1,t2,spc, '-ascii'); and got this error:
Error using horzcat
The following error occurred converting from double to char:
Error using char
Complex values cannot be converted to chars
So it doesn't take two axes (it expects the third to be text), so I tried:
eprsave('hysc',t1,spc, '-ascii'); and got:
Error using eprsave (line 37)
Cannot save two-dimensional data.
I did cobble together a loop to create a text file that can be read by NMR NUTS (it wants slice #, not delay time):
[t1,t2,spc,out]=saffron(Sys,Exp,Opt);
n=Exp.nPoints;
data=[];
ni=[];
for i = 1:n
ni(i)=i;
end
for i = 1:n
f=i*n;
s=f+1-n;
data(s:f , 1 ) = ni';
data(s:f , 2 ) = i;
data(s:f , 3 ) = real (spc(1:n , i));
data(s:f , 4 ) = imag (spc(1:n , i));
end
save('hsc1.txt','data','-ascii');
mesh(out.fd)
eprsave('hysc',t1,t2,spc, '-ascii'); and got this error:
Error using horzcat
The following error occurred converting from double to char:
Error using char
Complex values cannot be converted to chars
So it doesn't take two axes (it expects the third to be text), so I tried:
eprsave('hysc',t1,spc, '-ascii'); and got:
Error using eprsave (line 37)
Cannot save two-dimensional data.
I did cobble together a loop to create a text file that can be read by NMR NUTS (it wants slice #, not delay time):
[t1,t2,spc,out]=saffron(Sys,Exp,Opt);
n=Exp.nPoints;
data=[];
ni=[];
for i = 1:n
ni(i)=i;
end
for i = 1:n
f=i*n;
s=f+1-n;
data(s:f , 1 ) = ni';
data(s:f , 2 ) = i;
data(s:f , 3 ) = real (spc(1:n , i));
data(s:f , 4 ) = imag (spc(1:n , i));
end
save('hsc1.txt','data','-ascii');
mesh(out.fd)
-
- EasySpin Creator
- Posts: 1120
- Joined: Mon Jul 21, 2014 10:11 pm
- Location: University of Washington
Re: 2D data export
I see. We'll work on implementing 2D data export with
Meanwhile, here is a more compact version of your script:
eprsave
.Meanwhile, here is a more compact version of your script:
Code: Select all
n = Exp.nPoints;
clear data
[idx1,idx2] = find(ones(n));
data(:,1) = idx1(:);
data(:,2) = idx2(:);
data(:,3) = real(spc(:));
data(:,4) = imag(spc(:));
save('hsc1.txt','data','-ascii');