[cctbxbb] unexpected behaviour of unit_cell.fractionalize

Pavel Afonine pafonine at lbl.gov
Wed Feb 13 08:01:37 PST 2013


Hi Jan,

can this method work for you: sites_mod_positive ? I don't remember what 
exactly it does but I think it either what you need or at least very close.

Pavel

On 2/13/13 7:17 AM, Jan Marten Simons wrote:
> Hi,
>
> When I try to convert a list of direct space coordinates into fractional
> coordinates like this:
>
> from cctbx import xray
> from cctbx import crystal
> from cctbx.array_family import flex
>
> structure = xray.structure(
>    special_position_settings=crystal.special_position_settings(
>      crystal_symmetry=crystal.symmetry(
>        unit_cell=(3.14098, 4.08327, 5.33966, 83, 109, 129),
>        space_group_symbol="P1")))
>
> sites = flex.vec3_double( ((0.0, 0.1, 0.2), (1.3, 3.0, 2.3), (5.3, 0.1, 7.3)) )
> sites_frac = structure.unit_cell().fractionalize(sites)
> print(list(sites_frac))
>
> Now this returns a list of coordinates where x,y,z may be outside ot the
> interval [0,1[. ... quite unexpected.
>
> It would be very nice to have at least an option like "restrict_to_asu" in
> unit_cell.fractionalize which would enforce (x,y,z) to be inside the
> asymmetric unit and/or "restrict_to_cell" which would enforce (x,y,z) to be
> inside the unit cell.
>
> Could any of you more into the inner workings of the cctbx add this
> functionality, please?
>
> Thanks in advance,
>
> Jan
> _______________________________________________
> cctbxbb mailing list
> cctbxbb at phenix-online.org
> http://phenix-online.org/mailman/listinfo/cctbxbb



More information about the cctbxbb mailing list