Page 1 of 1

Exp.Ordering function

Posted: Fri Mar 19, 2021 3:21 pm
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.


Re: Exp.Ordering function

Posted: Thu May 20, 2021 5:04 pm
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)