Discussion List Archives

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

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

Hi Graeme,

What would be the overall goal here?  Normally within CCTBX, the return 
values and argument values are Python types, so instead of char * and 
unsigned short * we use Python string and scitbx.flex_int.  It may be 
possible to wrap raw pointers with Boost Python such that they are 
treated opaquely by Python, but we don't usually use this procedure. 

Then again, cctbx::cbflib_adaptbx specializes the byte offset 
compression (optimized_byte_offset) so that integer arrays can be 
compressed extra fast, above what is possible with the generic low-level 
routine. 

Are we aiming here to compress non-integer types, mixing of multiple 
types, better performance, or something else?

Best,
Nick


Graeme.Winter@Diamond.ac.uk wrote:
> Hi Nick,
>
> Many thanks - this is rather quicker than my pure Python implementation
> (just over two orders of magnitude!)
>
> Would it be straightforward to boost the lower level compression /
> decompression routines? It's not clear from the cbflib docs that these
> would be easily extracted - for instance:
>
>  char * compressed = cbf_byte_offset_compress(unsigned short * array,
> int nx, int ny)
>
>  - and - 
>
>  unsigned short * array = cbf_byte_offset_decompress(char * compressed,
> int nx, int ny)
>
> Are not really exported in a stand alone fashion?
>
> Still - this is *much* better than what I have right now.
>
> 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.