Page 1 of 1

Saffron returns an error for a single orientation

Posted: Wed Jan 11, 2017 9:40 am
by YuryKutin
Dear Developers,
I'm getting the following error when I try to run Saffron simulations for a single crystal:
Attempted to access Exp.OriWeights(2); index out of bounds because
numel(Exp.OriWeights)=1.
Error in C:\Users\Yu\Downloads\easyspin-5.1.8\easyspin\saffron.p>saffron (line
1226)
Error in C:\Users\Yu\Downloads\easyspin-5.1.8\easyspin\saffron.p>saffron (line
91)
The error appears when I set the Exp.CrystalOrientation parameter. This happens for any of the built-in sequences (ESEEM, HYSCORE, MimsENDOR) and for custom sequences as well. I've tried changing various Opt. parameters from their default values, explicitly setting MolFrame, etc. Am I still missing something?

As an example I'm using the hyscoresimple.m file from the website:

Code: Select all

clear, clf

Sys.Nucs = '14N';
Sys.A_ = [0.8 0.5];
Sys.Q = [-1 -1 2]*0.1;
Exp.Sequence = 'HYSCORE';
Exp.Field = 330;
Exp.tau = 0.080;
Exp.dt = 0.120;
Exp.nPoints = 256;

Opt.nKnots = 181;

Exp.CrystalSymmetry = 'P212121'; 
Exp.CrystalOrientation = [pi/9 pi/5];

saffron(Sys,Exp,Opt);
As soon as the Exp.CrystalOrientation line is included, the script returns the error.

Easyspin: 5.1.8, 5.0.2
Matlab: R2011b, R2013b

Thank you very much for your time!
Yury

Re: Saffron returns an error for a single orientation

Posted: Thu Jan 12, 2017 10:14 am
by Stefan Stoll
This is a bug. Thanks for reporting. We just posted a new version 5.1.9 where this should be fixed.

Re: Saffron returns an error for a single orientation

Posted: Fri Jan 13, 2017 7:58 am
by YuryKutin
Dear Stefan, thank you very much for the quick response! It is working now.