Problem with direct_space_asu
Hi, as there seems to be no documentation on the direct_space_asu module I just tried to use it like I thought the function names imply. The task I want to accomplish is checking whether a point in direct space is inside the asymmetric unit of a given unit cell. A small testcase I wrote reveals that apparently .is_inside(point) only uses fractional coordinates instead of cartesian coordinates. Is there a nice/easy way to get the desired behaviour? # -*- coding: utf-8 -*- from __future__ import division from cctbx import xray from cctbx import crystal from cctbx.array_family import flex import numpy as np asu = xray.structure( crystal_symmetry=crystal.symmetry( unit_cell=(5.01,5.01,5.47,95,85,90), space_group_symbol="P 1")).direct_space_asu() print(asu.show_comprehensive_summary()) print(asu.is_inside((0.0, 0.0, 0.0))) #should be True OK print(asu.is_inside((0.5, 0.5, 0.5))) #should be True OK print(asu.is_inside((0.9, 0.9, 0.9))) #should be True OK print(asu.is_inside((1.0, 0.9, 0.9))) #should be True is False! print(asu.is_inside((1.0, 1.0, 1.0))) #should be True is False! print(asu.is_inside((2.0, 2.0, 2.0))) #should be True is False! print(asu.is_inside((3.0, 3.0, 3.0))) #should be True is False! print(asu.is_inside((4.0, 4.0, 4.0))) #should be True is False! print(asu.is_inside((5.0, 5.0, 5.0))) #should be True is False! print(asu.is_inside((5.0, 5.0, 6.0))) #should be False OK print(asu.is_inside((6.0, 6.0, 6.0))) #should be False OK Cheers, Jan
On Tue, Jun 26, 2012 at 9:16 AM, Jan Marten Simons
as there seems to be no documentation on the direct_space_asu module I just tried to use it like I thought the function names imply.
The task I want to accomplish is checking whether a point in direct space is inside the asymmetric unit of a given unit cell.
A small testcase I wrote reveals that apparently .is_inside(point) only uses fractional coordinates instead of cartesian coordinates. Is there a nice/easy way to get the desired behaviour?
Yes, given a unit_cell object, you can do this: asu.is_inside(unit_cell.fractionalize(site_cart)) -Nat
participants (2)
-
Jan Marten Simons
-
Nathaniel Echols