Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

automatically removing ionization information from cif element information #53

Open
sbillinge opened this issue Jan 5, 2019 · 2 comments

Comments

@sbillinge
Copy link
Contributor

The issue is that our database of elements doesn't have structure factors for ions, such as Ba2+ but element info is often stored in cif files this way.

We are currently cleaning these manually or using the pavol trick:

from diffpy.structure import loadStructure
batio3 = loadStructure('BaTiO3.cif')
batio3.element = batio3.element.rstrip('+-012345678')

We don't want "magic" in the program which will confuse users, e.g. having hte code automatically change element information, however, I think that when we make a call to the existing database of element scattering factors, it would be ok to automatically strip the ion information before making the call to the db, without permanently resetting the element information. In the future, if we get a new database, this is easy to revert.

We could also try and be a bit clever and do our best effort to parse the element info, so if we find Ba2+ we could get the scattering factor for Xe (which is the neutral element with the same number of electrons as Ba2+. This may or may not work well, so should of course be tested.

I am just saving this here to return to in future if we need to.

@pavoljuhas
Copy link
Member

We can easily add a new class for X-ray scattering factors table, say SFTXrayNeutral, which will ignore charge information and always return scattering factors for neutral elements.

As for the second option - we can add mapping for missing ions, such as Ba2+ --> Xe, to the standard SFTXray class. The only downside is there would be no way to tell (apart from reading the code) if returned value is from a published approximation formula or from a mapped element.

As for the f(Q) behavior - would the one for Ba2+ be closer to 54/56 * f_Ba(Q) or to f_Xe(Q)?

@sbillinge
Copy link
Contributor Author

sbillinge commented Jan 6, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants