Exp.Ordering function

General forum for EasySpin: questions, how to's, etc.
Post Reply
mh2417
Newbie
Posts: 1
Joined: Fri Mar 19, 2021 3:12 pm

Exp.Ordering function

Post by mh2417 »

Hi everyone,

I have noticed that the user defined distribution function is called twice with pepper Exp.Ordering. I would like to know why it is the case and how is P handled internally?

I am trying to shift the mean of my distribution to simualte a rotation, because SampleOrientation/ CrystalOrientation/ MolFrame are overwritten. On the other hand, it seems that gFrame and AFrame are not (at least the orientation difference between them).
I have managed to do it for rotation around y (so I ignore phi completly), as long as the gFrame and AFrame are both [0 0 0].

Thanks

Maxime

ps: It would be nice to be able to pass on option to this user define function, because I have to use global variables to do my rotations.

Stefan Stoll
EasySpin Creator
Posts: 1057
Joined: Mon Jul 21, 2014 10:11 pm
Location: University of Washington

Re: Exp.Ordering function

Post by Stefan Stoll »

To see how the function in Exp.Ordering is called, have a look at the source code of pepper on GitHub.

To pass extra parameters, use a function handle. Let's say your function is defined as

Code: Select all

function w = myfun(phi,theta,params)

Then you can use

Code: Select all

params = ...  % your parameters here
Exp.Ordering = @(phi,theta) myfun(phi,theta,params)
Post Reply