Saffron returns an error for a single orientation

General forum for EasySpin: questions, how to's, etc.
Post Reply
YuryKutin
Newbie
Posts: 3
Joined: Wed Jan 11, 2017 8:49 am

Saffron returns an error for a single orientation

Post 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
Stefan Stoll
EasySpin Creator
Posts: 1073
Joined: Mon Jul 21, 2014 10:11 pm
Location: University of Washington

Re: Saffron returns an error for a single orientation

Post by Stefan Stoll »

This is a bug. Thanks for reporting. We just posted a new version 5.1.9 where this should be fixed.
YuryKutin
Newbie
Posts: 3
Joined: Wed Jan 11, 2017 8:49 am

Re: Saffron returns an error for a single orientation

Post by YuryKutin »

Dear Stefan, thank you very much for the quick response! It is working now.
Post Reply