LaurentRDC / crystals

Data structures, algorithms, and parsing for crystallography
https://crystals.readthedocs.io/
GNU General Public License v3.0
42 stars 12 forks source link

Reading the site-occupancy data from CIF files #3

Closed azkhadiev closed 4 years ago

azkhadiev commented 4 years ago

Looks like "crystals" package is not able to read a site-occupancy data from the CIF files. I tried to load the CIF file and read the occupancy of the atom by the lines: arb_crystal = crystals.Crystal.from_cif('Arb_cry.cif') list(arb_crystal)[0].occupancy

It shows 1.0 occupancy of all atoms in unit cell, whereas several of them have occupancy smaller than 1.0. How one can fix that?

LaurentRDC commented 4 years ago

Hello!

As of version 1.1.1, the occupancy of each site defaults to 1 (as you saw). I wrote the CIF parser a while ago, and never updated it.

I can update the parser today. Can you point me to a CIF file which has occupancies that are not 1.0?

azkhadiev commented 4 years ago

Thank you for the fast answer! Iy would be good to have this parser. Please, find in attached the CIF file (just change the .docx NiMnCoO4.docx to .cif)

LaurentRDC commented 4 years ago

Thank you for this file!

Is it yours? If so, do you give me permission to include it in crystals' test suite?

Otherwise I will create an artificial CIF file.

Edit: Don't worry about it, I used an artificially-modified file.

LaurentRDC commented 4 years ago

Allright, I have released a new version (1.1.2) that addresses your concerns. It will be available via conda tomorrow. If you prefer to use pip, you can already install it:

pip install --upgrade crystals

Let me know if it works for you.

azkhadiev commented 4 years ago

Dear Laurent,

Thank you for your corrections. Unfortunately, I took this CIF file from ICSD database (https://icsd.fiz-karlsruhe.de/) and I am not sure that this file could be used freely without ICSD permission. But there are several open databases, where CIF files are absolutely available. Here is an example of Anorthite CIF file (http://rruff.geo.arizona.edu/AMS/CIF_text_files/00012_cif.txt) where occupancies are also presented. I am not absolutely sure, but maybe somebody will also ask you to include the possibility of parsing "anisotropic atomic displacement parameters" from CIF files.

Everything is working now, "crystals" takes occupancies from CIF files.

Thank you again for your work!