Command-line tool for diffraction data processing, merging, and phasing on rotation diffraction datasets collected using JUNGFRAU detector and JfGUI [1]. This tool calls XDS [2], XSCALE [3], DIALS [4], xia2 [5], SHELXT [6], and ShelXle [7].
The implementation draws inspiration from the dectris2xds.py of SinglaGUI [8] and ed_scripts [9].
Data processing setup for PETS2[10] is supported by the Python script hdf2tif.py, which prepares TIFF images and .pts format input file. Integration with the online mode of JfGUI is not yet available.
To process with XDS, prepare your template of XDS.INP, which includes LIB= /[...]/neggia/build/src/dectris/neggia/plugin/dectris-neggia.so to load the HDF file using Neggia [11] plugin. Then, replace the filepath in postprocess.py with yours.
XDS_TEMPLATE = '[your_file_path]/XDS-TEMPLATE.INP'
To process with DIALS, install the Format class to read experimental values from HDF:
dxtbx.install_format -u FormatHDFJungfrau1MJFJVIE02_multipanel.py
$ python postprocess_server.py -h
usage: postprocess_server.py [-h] [-b] [-c CENTER_MASK] [-d PATH_PROCESS] [-j] [-o] [-q] [-r] [-v] [-p PROCESSOR] [-f FILEPATH]
options:
-h, --help show this help message and exit
-b, --feedback send post-process results to GUI
-c CENTER_MASK, --center_mask CENTER_MASK
centre mask radius [px] in XDS.INP (10). deactivate with 0.
-d PATH_PROCESS, --path_process PATH_PROCESS
root directory path for data-processing (.). file-writing permission is necessary.
-j, --json write a summary of postprocess as a JSON'L' file (process_result.jsonl)
-o, --exoscillation use measured oscillation value for postprocess
-q, --quiet suppress outputs of external programs
-r, --refinecenter force post-refine beamcenter position
-v, --version display version information
-p PROCESSOR, --processor PROCESSOR
enable post-processing. 'x' for XDS, 'd' for dials and 'xd' for both
-f FILEPATH, --filepath FILEPATH
offline analysis. identify the full-filepath to be processed/entry/data/data_000001, _000002, ...
/entry/instrument/detector/frame_time
/entry/instrument/detector/detectorSpecific/nimages_written
/entry/instrument/detector/detector_distance
/entry/instrument/detector/x_pixel_size
/entry/instrument/detector/y_pixel_size
/entry/instrument/stage/stage_tx_start
/entry/instrument/stage/stage_tx_axis
/entry/instrument/stage/stage_tx_speed_measured
/entry/instrument/stage/velocity_data_collection
/entry/instrument/optics/accelerationVoltage
/entry/instrument/optics/optical_axis_center_x
/entry/instrument/optics/optical_axis_center_y
$ python -i /home/ktakaba/postprocess_jfed/postprocess_server.py -b -d [data_saving_path] -o -q -r -j -p xd$ python -i /home/ktakaba/postprocess_jfed/postprocess_server.py -d [data_saving_path] -o -q -r -j -p xd -f [hdf_filepath]
Postprocessing-server for diffraction datasets recorded by Jungfrau / Jungfrau-joch: ver. 2025.09.07 for JF_GUI/v2025.09.xx or later
10:47:49 - WARNING - No session-data loaded.
10:47:49 - INFO - Refined beam center: X = 546; Y = 559
10:47:49 - INFO - Subdirname: [data_saving_path]/XDS/026-2232
10:47:49 - INFO - XDS runs at [data_saving_path]/XDS/026-2232...
10:47:49 - INFO - Quiet mode:
10:47:55 - INFO - Indexing succeeded.
10:47:55 - INFO - {'gui_id': 1026, 'dataid': '026-2232', 'filepath': '[hdf_filepath_prefix]_2232_master.h5', 'processor': 'XDS', 'init': 'Succeeded', 'colspot': 'Succeeded', 'idxref': 'Succeeded', 'lattice': ['7.603', '12.007', '15.167', '89.494', '85.764', '89.834'], 'spots': ['2313', '2782'], 'cell axes': array([ -4.256, 6.3 , -0.066, 9.921, 6.739, -0.57 , -1.04 ,
0.49 , -15.124]), 'space group': 1, 'completeness': 0, 'beamcenter_used': array([546, 559]), 'position': array([ 35773., -580060., -26730.]), 'ht': 200.0, 'spot_size': 5, 'magnification': 15000, 'brightness': 46831, 'distance_nominal': 600, 'rotation_speed_idx': 1.0, 'rotation_speed_nominal': 2.0, 'rotation_speed_measured': 2.009962230113042, 'e_per_A2_sample': 0.08402489015960184, 'status': 'measured'}
10:47:55 - INFO - Item 026-2232 is added.
10:47:55 - INFO - [data_saving_path]/process_result.jsonl is updated.
10:47:55 - INFO - Now DIALS runs for [hdf_filepath_prefix]_2232_master.h5...
10:48:47 - INFO - {'gui_id': 1026, 'dataid': '026-2232', 'filepath': '[hdf_filepath_prefix]_2232_master.h5', 'import_dials': 'Succeeded', 'findspots_dials': 'Succeeded', 'index_dials': 'Succeeded', 'lattice_dials': array([ 7.601, 12.046, 14.959, 89.107, 86.094, 89.738]), 'spots_dials': [1380, 2060], 'cell axes_dials': array([ 0.666, -0.635, 0.391, -0.586, -0.121, 0.801, -0.461, -0.763,
-0.453]), 'space group_dials': 1, 'position': array([ 35773., -580060., -26730.]), 'status': 'measured', 'lattice std_1e3x': [2.098, 3.645, 4.45, 25.051, 31.169, 22.924]}
10:48:47 - INFO - Item 026-2232 is updated
10:48:47 - INFO - [data_saving_path]/process_result.jsonl is updated.python hdf2tif.py -h
usage: Convert diffraction images from HDF to Tiff, with .pts for PETS2 [-h] [-i ITYPE] [-f FLIMIT] [-d DEG] filepath
positional arguments:
filepath full-path of input HDF
options:
-h, --help show this help message and exit
-i ITYPE, --itype ITYPE
int data type (16)
-f FLIMIT, --flimit FLIMIT
maximum number of generated frame, for test-use (999)
-d DEG, --deg DEG degree per frame_summed (1)Development undergoes as part of the SNF/FWF project, EPOC[12].
[1] https://github.com/epoc-ed/GUI
[2] Kabsch, W. Acta Cryst. D (2010). 66, 125–132. http://doi.org/10.1107/S0907444909047337
[3] Kabsch, W. Acta Cryst. D (2010). 66, 133–144. http://doi.org/10.1107/S0907444909047374
[4] Winter, G. et al. Acta Cryst. D (2018). 74, 85–97. http://doi.org/10.1107/S2059798317017235
[5] Winter, G. Acta Cryst. D (2010). 43, 186–190. http://doi.org/10.1107/S0021889809045701
[6] Sheldrick, G. M. Acta Cryst. A (2015b). 71, 3–8. http://doi.org/10.1107/S2053273314026370
[7] Hübschle, C. B., Sheldrick, G. M. & Dittrich, B. J. Appl. Cryst. (2011). 44, 1281–1284. http://doi.org/10.1107/S0021889811043202
[8] https://github.com/tgruene/SinglaGUI/blob/master/dectris2xds/dectris2xds.py
[9] https://github.com/huwjenkins/ed_scripts
[10] Palatinus, L. et al. Acta Cryst. B (2019). 75, 512-522. https://doi.org/10.1107/S2052520619007534