[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Reply to: [list | sender only]
Re: [Imgcif-l] Reading CBF files from Python
- To: <imgcif-l@iucr.org>
- Subject: Re: [Imgcif-l] Reading CBF files from Python
- From: <Graeme.Winter@Diamond.ac.uk>
- Date: Fri, 25 Jun 2010 06:16:59 +0000
- References: <4854F2500EA8C4478A508D2D92973E5206D6B5F9@EXCHANGE25.fed.cclrc.ac.uk><4C1F2B5C.30400@esrf.fr><4854F2500EA8C4478A508D2D92973E5206D6B5FA@EXCHANGE25.fed.cclrc.ac.uk><4C1F8A65.2020504@lbl.gov><4854F2500EA8C4478A508D2D92973E5206D6B604@EXCHANGE25.fed.cclrc.ac.uk><4C224E02.1060304@lbl.gov><4854F2500EA8C4478A508D2D92973E5206D6B610@EXCHANGE25.fed.cclrc.ac.uk><4C23A9CB.2020001@lbl.gov>
Hi Nick, You are of course correct - I was trying to think about this in 'C' terms - however it also occurs to me that the char * is a NULL terminated string... the API below would be broken then :o) So strCompressedImage = compress(integerArray) and the inverse with flex_ints would be correct. And much cleaner. I didn't think byte offset worked with anything other than integers? I would be aiming for compression and decompression of integer maps much faster than my python implementation, which is clearly not hard! How does this sound? I could see that this would be more generally useful... Best wishes, Graeme -----Original Message----- From: imgcif-l-bounces@iucr.org on behalf of Nicholas K. Sauter Sent: Thu 6/24/2010 7:54 PM To: The Crystallographic Binary File and its imgCIF application to image data Subject: 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 -- This e-mail and any attachments may contain confidential, copyright and or privileged material, and are for the use of the intended addressee only. If you are not the intended addressee or an authorised recipient of the addressee please notify us of receipt by returning the e-mail and do not use, copy, retain, distribute or disclose the information in or attached to the e-mail. Any opinions expressed within this e-mail are those of the individual and not necessarily of Diamond Light Source Ltd. Diamond Light Source Ltd. cannot guarantee that this e-mail or any attachments are free from viruses and we cannot accept liability for any damage which you may sustain as a result of software viruses which may be transmitted in or with the message. Diamond Light Source Limited (company no. 4375679). Registered in England and Wales with its registered office at Diamond House, Harwell Science and Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United Kingdom _______________________________________________ imgcif-l mailing list imgcif-l@iucr.org http://scripts.iucr.org/mailman/listinfo/imgcif-l
Reply to: [list | sender only]
- References:
- [Imgcif-l] Reading CBF files from Python (Graeme.Winter)
- Re: [Imgcif-l] Reading CBF files from Python (Jon Wright)
- Re: [Imgcif-l] Reading CBF files from Python (Graeme.Winter)
- Re: [Imgcif-l] Reading CBF files from Python (Nicholas K. Sauter)
- Re: [Imgcif-l] Reading CBF files from Python (Graeme.Winter)
- Re: [Imgcif-l] Reading CBF files from Python (Nicholas K. Sauter)
- Re: [Imgcif-l] Reading CBF files from Python (Graeme.Winter)
- Re: [Imgcif-l] Reading CBF files from Python (Nicholas K. Sauter)
- Prev by Date: Re: [Imgcif-l] Reading CBF files from Python
- Next by Date: Re: [Imgcif-l] Reading CBF files from Python
- Prev by thread: Re: [Imgcif-l] Reading CBF files from Python
- Next by thread: Re: [Imgcif-l] Reading CBF files from Python
- Index(es):