[cctbxbb] Problem with direct_space_asu
Jan Marten Simons
marten at xtal.rwth-aachen.de
Tue Jun 26 09:16:42 PDT 2012
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
More information about the cctbxbb
mailing list