Skip to content

Commit 7982ea1

Browse files
committed
Add support for online raw JungFrau data
1 parent c278ce5 commit 7982ea1

File tree

1 file changed

+17
-9
lines changed

1 file changed

+17
-9
lines changed

extra_foam/pipeline/processors/image_assembler.py

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -527,11 +527,6 @@ class DsscImageAssembler(BaseAssembler):
527527
def _get_modules_bridge(self, data, src):
528528
"""Override.
529529
530-
In the file, the data is separated into arrays of different
531-
modules. The layout of data for each module is:
532-
- calibrated, (memory cells, x, y)
533-
- raw, (memory cells, 1, x, y)
534-
535530
- calibrated, "image.data", (modules, x, y, memory cells)
536531
- raw, "image.data", (modules, x, y, memory cells)
537532
-> (memory cells, modules, y, x)
@@ -541,6 +536,11 @@ def _get_modules_bridge(self, data, src):
541536
def _get_modules_file(self, data, src):
542537
"""Override.
543538
539+
In the file, the data is separated into arrays of different
540+
modules. The layout of data for each module is:
541+
- calibrated, (memory cells, x, y)
542+
- raw, (memory cells, 1, x, y)
543+
544544
- calibrated, "image.data", (memory cells, modules, y, x)
545545
- raw, "image.data", (memory cell, 1, modules, y, x)
546546
-> (memory cells, modules, y, x)
@@ -611,16 +611,24 @@ def _get_modules_bridge(self, data, src):
611611
612612
Calibrated data only.
613613
614-
- calibrated, "data.adc", TODO
615-
- raw, "data.adc", TODO
614+
- calibrated, "data.adc", (y, x, memory cells)
615+
- raw, "data.adc", (memory cells, y, x)
616616
-> (memory cells, modules, y, x)
617617
"""
618618
modules_data = data[src]
619619
shape = modules_data.shape
620+
dtype = modules_data.dtype
621+
620622
ndim = len(shape)
621623
if ndim == 3:
622-
# (y, x, memory cells) -> (memory cells, 1 module, y, x)
623-
return np.moveaxis(modules_data, -1, 0)[:, np.newaxis, ...]
624+
if dtype == _IMAGE_DTYPE:
625+
# (y, x, memory cells) -> (memory cells, 1 module, y, x)
626+
return np.moveaxis(modules_data, -1, 0)[:, np.newaxis, ...]
627+
628+
if dtype == _RAW_IMAGE_DTYPE:
629+
# (memory cells, y, x) -> (memory cells, 1 module, y, x)
630+
return modules_data[:, np.newaxis, ...]
631+
624632
# (modules, y, x, memory cells) -> (memory cells, modules, y, x)
625633
return np.moveaxis(modules_data, -1, 0)
626634

0 commit comments

Comments
 (0)