Skip to content

Commit

Permalink
Hacking at dlsnxs2cbf
Browse files Browse the repository at this point in the history
Looks like the module dimensions contain much weirdness, if I squash all
references to the module slices it creates correct CBF files

Looking at #712

Do not expect to merge
  • Loading branch information
graeme-winter committed Mar 20, 2024
1 parent 080b599 commit 569f325
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/dxtbx/nexus/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,7 @@ def get_static_mask(nxdetector: nxmx.NXdetector) -> tuple[flex.bool, ...] | None
all_slices = get_detector_module_slices(nxdetector)
all_mask_slices = []
for slices in all_slices:
slices = ()
mask_slice = flumpy.from_numpy(np.ascontiguousarray(pixel_mask[slices])) == 0
mask_slice.reshape(
flex.grid(mask_slice.all()[-2:])
Expand Down Expand Up @@ -577,9 +578,7 @@ def get_raw_data(
all_data = []
sliced_outer = data[index]
for module_slices in get_detector_module_slices(nxdetector):
data_as_flex = _dataset_as_flex(
sliced_outer, tuple(module_slices), bit_depth=bit_depth
)
data_as_flex = _dataset_as_flex(sliced_outer, None, bit_depth=bit_depth)
data_as_flex.reshape(
flex.grid(data_as_flex.all()[-2:])
) # handle 3 or 4 dimension arrays
Expand Down

0 comments on commit 569f325

Please sign in to comment.