You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi
I can see structures within spinw objects ok. For example:
from transplant import Matlab
from transplant import MatlabStruct
m=Matlab('/Applications/pyspinw.app/pyspinw.sh')
gto=m.spinw()
Flist = MatlabStruct(gto.mag_str)['F']
What I haven't figured out yet is how to write to the spinw object structures directly. (I would like to - in this case - manually change some of the spins in the 'F' array)
Cheers
Ross
The text was updated successfully, but these errors were encountered:
MatlabStruct() is used to make sure that a Python list is converted into a struct type in MATLAB, by default a Python list is converted into containers.Map in MATLAB. This might change in the future, as we are dicsussing this issue with the author of transplant. For more details check the transplant repo: https://github.com/bastibe/transplant.
Now, you can still modify the spinw structure, with the limitation that you can assign values of field down to 1 level. Let me show what this means:
The above example showed how to change the magnetic propagation vector. You might try to change the k-vector directly: tri.mag_str['k'][2,0] = 1. but this will not work, you can check by calling tri.mag_str['k'][2,0] and you will get the original unmodified value. In any case I suggest to change the spinw properties via its methods, the equivalent to the above code is
{mac OS 10.12.6, pyspinw}
Hi
I can see structures within spinw objects ok. For example:
What I haven't figured out yet is how to write to the spinw object structures directly. (I would like to - in this case - manually change some of the spins in the 'F' array)
Cheers
Ross
The text was updated successfully, but these errors were encountered: