Skip to content

Commit

Permalink
Support 32 bit in nxs2cbf conversion (cctbx#759)
Browse files Browse the repository at this point in the history
Working around issues we fixed elsewhere - but never rolled over to the conversion tool

Co-authored-by: @noemifrisina
  • Loading branch information
graeme-winter authored Oct 15, 2024
1 parent 87993c9 commit 3f0cbf7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions newsfragments/759.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
``dxtbx.dlsnxs2cbf``: add bit_depth_image explicitly to work around issues with data recorded at 32 bit
2 changes: 1 addition & 1 deletion src/dxtbx/util/dlsnxs2cbf.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ def make_cbf(
print(f"Writing images to {template}{'#' * num_digits}.cbf:")
for j in tqdm(range(num_images), unit=" images"):
header = compute_cbf_header(nxmx_obj, j)
(data,) = dxtbx.nexus.get_raw_data(nxdata, nxdetector, j)
(data,) = dxtbx.nexus.get_raw_data(nxdata, nxdetector, j, bit_depth_readout)
if bit_depth_readout:
# if 32 bit then it is a signed int, I think if 8, 16 then it is
# unsigned with the highest two values assigned as masking values
Expand Down

0 comments on commit 3f0cbf7

Please sign in to comment.