Missing gaussians for some ions?
Hi, I did some more tests using cif files from cod and found out that some of those trigger errors like this for http://www.crystallography.net/cif/1/1000029.cif: Traceback (most recent call last): File "Check_F_calc.py", line 29, in <module> f_calc = structure.structure_factors(d_min=1.0).f_calc() File "/home/marten/Arbeit/cctbx- latest/cctbx_sources/cctbx/xray/structure.py", line 813, in structure_factors algorithm=algorithm) File "/home/marten/Arbeit/cctbx- latest/cctbx_sources/cctbx/xray/structure_factors/from_scatterers.py", line 53, in __call__ miller_set=miller_set) File "/home/marten/Arbeit/cctbx- latest/cctbx_sources/cctbx/xray/structure_factors/from_scatterers_fft.py", line 32, in __init__ tolerance_positive_definite=manager.tolerance_positive_definite()) RuntimeError: gaussian not defined for scattering_type "Y4+". The cif file itself can be read and gives a valid summary: Number of scatterers: 13 At special positions: 5 Unit cell: (7.82927, 7.82927, 5.70757, 90, 90, 120) Space group: P 3 1 c (No. 159) Label, Scattering, Multiplicity, Coordinates, Occupancy, Uiso, Ustar as Uiso Y1 Y4+ 2 ( 0.3333 0.6667 0.2420) 0.27 0.0000 [ - ] Si1 Si4+ 6 ( 0.5087 0.0819 0.2130) 0.77 0.0000 [ - ] Al1 Al3+ 6 ( 0.5087 0.0819 0.2130) 0.23 0.0000 [ - ] Si2 Si4+ 6 ( 0.1706 0.2533 0.0020) 0.77 0.0000 [ - ] Al2 Al3+ 6 ( 0.1706 0.2533 0.0020) 0.23 0.0000 [ - ] N1 N3- 2 ( 0.0000 0.0000 0.0000) 0.94 0.0000 [ - ] O1 O2- 2 ( 0.0000 0.0000 0.0000) 0.06 0.0000 [ - ] N2 N3- 2 ( 0.3333 0.6667 0.6530) 0.94 0.0000 [ - ] O2 O2- 2 ( 0.3333 0.6667 0.6530) 0.06 0.0000 [ - ] N3 N3- 6 ( 0.3458 -0.0472 -0.0050) 0.94 0.0000 [ - ] O3 O2- 6 ( 0.3458 -0.0472 -0.0050) 0.06 0.0000 [ - ] N4 N3- 6 ( 0.3219 0.3180 0.2460) 0.94 0.0000 [ - ] O4 O2- 6 ( 0.3219 0.3180 0.2460) 0.06 0.0000 [ - ] Y1: 0.3333 0.6667 0.2420 point group type: 3 special position operator: 1/3,2/3,z Si1: 0.5087 0.0819 0.2130 point group type: 1 special position operator: x,y,z Al1: 0.5087 0.0819 0.2130 point group type: 1 special position operator: x,y,z Si2: 0.1706 0.2533 0.0020 point group type: 1 special position operator: x,y,z Al2: 0.1706 0.2533 0.0020 point group type: 1 special position operator: x,y,z N1: 0.0000 0.0000 0.0000 point group type: 3 special position operator: 0,0,z O1: 0.0000 0.0000 0.0000 point group type: 3 special position operator: 0,0,z N2: 0.3333 0.6667 0.6530 point group type: 3 special position operator: 1/3,2/3,z O2: 0.3333 0.6667 0.6530 point group type: 3 special position operator: 1/3,2/3,z N3: 0.3458 -0.0472 -0.0050 point group type: 1 special position operator: x,y,z O3: 0.3458 -0.0472 -0.0050 point group type: 1 special position operator: x,y,z N4: 0.3219 0.3180 0.2460 point group type: 1 special position operator: x,y,z O4: 0.3219 0.3180 0.2460 point group type: 1 special position operator: x,y,z Other cif files give other missing gaussians: http://www.crystallography.net/cif/1/1000145.cif:
RuntimeError: gaussian not defined for scattering_type "V4+".
http://www.crystallography.net/cif/1/1000181.cif:
RuntimeError: gaussian not defined for scattering_type "H1+".
http://www.crystallography.net/cif/1/1000353.cif:
RuntimeError: gaussian not defined for scattering_type "H1+".
I'm not sure if this is a problem related to the notation used in those cif files or if cctbx is missing some data here that should be added to it. With regards, Dipl. Pyhs. Jan M. Simons Institute of Crystallography RWTH Aachen University
Hi Jan, We have the N-Gaussians for all ions that appear in the International Tables Volume C. You can find the source code for the compiled-in tables here: cctbx/eltbx/xray_scattering
RuntimeError: gaussian not defined for scattering_type "Y4+".
RuntimeError: gaussian not defined for scattering_type "V4+". RuntimeError: gaussian not defined for scattering_type "H1+".
These three do not appear in the Int. Tables. We'd need to find out what form factors were actually used in the refinement. I see the structures are from 1981-1993. It could be very difficult to find out for sure. We already have an option to make the form factor lookup less strict. The critical line is this in cctbx/xray/structure.py: std_lbl = eltbx.xray_scattering.get_standard_label( label=t_undef, exact=True, optional=True) I think your script should run if you set exact=False, but it will use plain Y, V, H form factors for the unknown ions. Is that good enough for your purposes? Ralf
Am Mittwoch 22 Dezember 2010 23:48:21 schrieb Ralf W. Grosse-Kunstleve:
Hi Jan,
We have the N-Gaussians for all ions that appear in the International Tables Volume C. You can find the source code for the compiled-in tables here:
cctbx/eltbx/xray_scattering
RuntimeError: gaussian not defined for scattering_type "Y4+".
RuntimeError: gaussian not defined for scattering_type "V4+". RuntimeError: gaussian not defined for scattering_type "H1+".
These three do not appear in the Int. Tables. We'd need to find out what form factors were actually used in the refinement. I see the structures are from 1981-1993. It could be very difficult to find out for sure.
I just checked Int. Tables Vol C from 2006 and those are not there as well.
We already have an option to make the form factor lookup less strict. The critical line is this in cctbx/xray/structure.py:
std_lbl = eltbx.xray_scattering.get_standard_label( label=t_undef, exact=True, optional=True)
I think your script should run if you set exact=False, but it will use plain Y, V, H form factors for the unknown ions. Is that good enough for your purposes?
I think it should be enough, but how can I activate it with structure.structure_factors().f_calc()? According to documentation there's only structure_factors(self, d_min), and f_calc = structure.structure_factors(d_min=1.0, exact=False).f_calc() yields a "TypeError: structure_factors() got an unexpected keyword argument 'exact'" So, do I have to edit/patch cctbx/xray/structure.py: to achieve the desired behaviour or is there a better way? (Imho best way would be to have more optional parameters for structure.structure_factors().f_calc().) With regards, Dipl. Pyhs. Jan M. Simons Institute of Crystallography RWTH Aachen University
Hi Jan,
So, do I have to edit/patch cctbx/xray/structure.py: to achieve the desired behaviour
Yes, just to test if it does what you need.
or is there a better way? (Imho best way would be to have more optional parameters for structure.structure_factors().f_calc().)
It would fit better to expose the "exact" setting as an optional parameter of xray.structure.scattering_type_registry(), under some more telling name, maybe "exact_table_lookup". The idea is that you call this method before doing any structure factor calculations if the settings need to be customized. The last explicit call determines the state of the registry. (I know this mechanism isn't obvious, but I was trying to avoid introducing even deeper object hierarchies.) Ralf
Am Donnerstag 23 Dezember 2010 17:06:00 schrieb Ralf W. Grosse-Kunstleve:
Hi Jan,
So, do I have to edit/patch cctbx/xray/structure.py: to achieve the desired behaviour
Yes, just to test if it does what you need.
Ok, after this change those cif files can be used to calculate f and d values as well. As far as I understand the code (in /eltbx/xray_scattering.h) setting exact=False leads to using the form factor of the bare atom from the form factor coefficient table, so in case an ion is in the table it will still be using the optimised form factor for this, right?
or is there a better way? (Imho best way would be to have more optional parameters for structure.structure_factors().f_calc().)
It would fit better to expose the "exact" setting as an optional parameter of xray.structure.scattering_type_registry(), under some more telling name, maybe "exact_table_lookup". The idea is that you call this method before doing any structure factor calculations if the settings need to be customized. The last explicit call determines the state of the registry. (I know this mechanism isn't obvious, but I was trying to avoid introducing even deeper object hierarchies.)
That mechanism would definatly need some documentation then (with a hit to the docs in structure.structure_factors() docstring [1]). I'm willing to work on inducing verbose docstrings to the python interface (after xmas break), i'f you're OK with this. [1] http://tovid.wikia.com/wiki/Python_tips/Docstrings With regards, Dipl. Pyhs. Jan M. Simons Institute of Crystallography RWTH Aachen University
According to documentation there's only (correction, as I was looking at cctbx.neutron.structure and for xray it is:) structure_factors(self, anomalous_flag=None, d_min=None, algorithm=None, cos_sin_table=False, quality_factor=None, u_base=None, b_base=None, wing_cutoff=None), and f_calc = structure.structure_factors(d_min=1.0, exact=False).f_calc() yields a "TypeError: structure_factors() got an unexpected keyword argument 'exact'" Where can I find documentation (like possible values etc.) on the other
Am Donnerstag 23 Dezember 2010 15:24:50 schrieb Jan Marten Simons: parameters? [1] is not verbose enough on those. Do I have to edit/patch cctbx/xray/structure.py: to achieve the desired behaviour (using plain atomic form factors) or is there a better way? (Imho best way would be to have an optional parameters for this if there is not already one in structure.structure_factors().f_calc().) [1] http://cctbx.sourceforge.net/current/python/cctbx.xray.structure.html With regards, Dipl. Pyhs. Jan M. Simons Institute of Crystallography RWTH Aachen University
participants (2)
-
Jan Marten Simons
-
Ralf W. Grosse-Kunstleve