FABLE-3DXRD / xrd_simulator

Tools for simulating x-ray diffraction. Detailed documentation is found at the below link.
https://fable-3dxrd.github.io/xrd_simulator/
MIT License
21 stars 7 forks source link

Struggling to run any .cif files #3

Closed EricShmeric closed 1 year ago

EricShmeric commented 1 year ago

Hi Alex,

First off, thank you so much for supporting this code base! I'm a computer scientist attempting to learn about x-ray diffraction and being able to step through this code has been a godsend. A lot of topics that were very confusing to me in the textbook now make perfect sense.

I'm working on a research project around finding new (and hopefully more accurate) ways of doing molecule structure prediction using diffraction data. On that note, I'd like to run a .cif file through the simulator and get intensity values that I can hopefully try to invert using my method.

I am however having an issue getting .cif files taken randomly from the Crystallography Open Database to run. Specifically, the .cif files I'm finding on the internet contain isotopes and it seems the atomlib.py file does not support that? In any case, I'm getting errors that the program does not recognize the atom's name (for example, "SR2+" is the current error I'm getting from a random .cif file).

By chance am I misunderstanding something?

I couldn't find much documentation recommending how to properly use .cif files. By chance would you happen to have any .cif files to share which you know will work? For my purposes I don't really care what the molecule is, as long as its sufficiently large and complex that finding its structure is non-trivial.

Many Thanks! Eric

AxelHenningsson commented 1 year ago

Hi Eric, glad to hear the code is helpful 😃

Here are two links to .cif files that are used by the native unit test suite of xrd_simulator and known to work: 1. Cif file for iron (FE) 2. Cif file for alpha-quartz These can also be found in the data folder of the test archive.. For more complicated molecules I have little experience. As far as I am aware it should work for arbitrary molecules. The handling of .cif files in xrd_simulator is primarily thanks to the dependency of xfab.

You can find more in depth mathematical background on the model xrd_simulator uses in the journal paper associated to the release of this code:

xrd_simulator: 3D X-ray diffraction simulation software supporting 3D polycrystalline microstructure morphology descriptions Henningsson, A. & Hall, S. A. (2023). J. Appl. Cryst. 56, 282-292.

If you find xrd_simulator useful in your research we would love ❤️ for you to cite us.

Cheers Axel Henningsson