Discussion List Archives

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Imgcif-l] Reading CBF files from Python

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@Diamond.ac.uk wrote:
> Hi Nick,
>
> Not sure I have things built quite right then:
>
> [gw56@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
>   
_______________________________________________
imgcif-l mailing list
imgcif-l@iucr.org
http://scripts.iucr.org/mailman/listinfo/imgcif-l

Reply to: [list | sender only]
International Union of Crystallography

Scientific Union Member of the International Science Council (admitted 1947). Member of CODATA, the ISC Committee on Data. Partner with UNESCO, the United Nations Educational, Scientific and Cultural Organization in the International Year of Crystallography 2014.

International Science Council Scientific Freedom Policy

The IUCr observes the basic policy of non-discrimination and affirms the right and freedom of scientists to associate in international scientific activity without regard to such factors as ethnic origin, religion, citizenship, language, political stance, gender, sex or age, in accordance with the Statutes of the International Council for Science.