2cbf: Difference between revisions

From XDSwiki
Jump to navigation Jump to search
No edit summary
m (add hint to the fact that .h5 files can be read without LIB=)
Line 1: Line 1:
[http://xds.mpimf-heidelberg.mpg.de/html_doc/2cbf_program.html 2cbf] is part of the [[XDS]] distribution. It converts any image file format that is known to XDS to a miniCBF file. This program is also used by [[XDSGUI]].
[http://xds.mpimf-heidelberg.mpg.de/html_doc/2cbf_program.html 2cbf] is part of the [[XDS]] distribution. It converts any image file format that is known to XDS to a miniCBF file. This program is also used by [[XDSGUI]].


Line 15: Line 16:
To convert frames stored in Dectris-format .h5 files, one should replace "master" with a 6-digit framenumber, and use the [https://xds.mr.mpg.de/html_doc/xds_parameters.html#LIB= LIB=] keyword:  
To convert frames stored in Dectris-format .h5 files, one should replace "master" with a 6-digit framenumber, and use the [https://xds.mr.mpg.de/html_doc/xds_parameters.html#LIB= LIB=] keyword:  
  echo collect_01_000001.h5 collect_1.cbf LIB=/usr/local/lib64/dectris-neggia.so | 2cbf
  echo collect_01_000001.h5 collect_1.cbf LIB=/usr/local/lib64/dectris-neggia.so | 2cbf
It should work without LIB=, but then H5ToXds is required.

Revision as of 10:10, 22 March 2021

2cbf is part of the XDS distribution. It converts any image file format that is known to XDS to a miniCBF file. This program is also used by XDSGUI.

Single-line example (bash shell):

for i in ../images/*img ; do echo $i; echo $i `basename $i`.cbf | 2cbf ; done

This converts all .img files in ../images to miniCBF files with the extension .img.cbf in the current directory.

To have control over the number of digits encoding the frame number, one can use bash's printf command. Example:

#!/bin/bash
for j in $(seq 1 120); do
  echo Data_02_$(printf "%04d" "$j").sfrm 
done

To convert frames stored in Dectris-format .h5 files, one should replace "master" with a 6-digit framenumber, and use the LIB= keyword:

echo collect_01_000001.h5 collect_1.cbf LIB=/usr/local/lib64/dectris-neggia.so | 2cbf

It should work without LIB=, but then H5ToXds is required.