[Imgcif-l] Reading CBF files from Python
Nicholas K. Sauter
nksauter at lbl.gov
Wed Jun 23 19:13:54 BST 2010
Graeme,
Just found this myself. The trick is adding the following line to the
top of the file:
from scitbx.array_family import flex
Note to self: reorganize the cbflib_adaptbx so that this import is done
transparently.
Nick
Graeme.Winter at Diamond.ac.uk wrote:
> Hi Nick,
>
> Not sure I have things built quite right then:
>
> [gw56 at ws050 tmp]$ labelit.python
> Python 2.6.5 (r265_cci:79063, Jun 2 2010, 06:13:15)
> [GCC 4.1.2 20080704 (Red Hat 4.1.2-48)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
>
>>>> from cbflib_ext import MiniCBFAdaptor
>>>> a = MiniCBFAdaptor("image.cbf")
>>>> r = a.optimized_read_data(3072, 3072)
>>>>
> Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> TypeError: No to_python (by-value) converter found for C++ type: scitbx::af::versa<int, scitbx::af::flex_grid<scitbx::af::small<long, 10u> > >
>
> However, API's such as this would be just the ticket. The tricky thing about the compression will of course be constructing all of the rest of the CBF structure around it....
>
> Best wishes,
>
> Graeme
>
More information about the imgcif-l
mailing list