Skip to content

Commit

Permalink
WIP: try work around quad gap issues
Browse files Browse the repository at this point in the history
  • Loading branch information
sk1p committed Apr 25, 2024
1 parent 6102496 commit 16c6242
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/libertem_live/detectors/merlin/acquisition.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,16 +215,21 @@ def get_task_comm_handler(self) -> TaskCommHandler:
def get_frames_from_queue(
queue: WorkerQueue,
tiling_scheme: TilingScheme,

# this one is possibly borked, contains what the integer format would look like, probably?
sig_shape: tuple[int, ...],
dtype
) -> Generator[tuple[np.ndarray, int], None, None]:
out = np.zeros((tiling_scheme.depth,) + sig_shape, dtype=dtype)
out_flat = out.reshape((tiling_scheme.depth, -1,))
out = out_flat = None
while True:
with queue.get() as msg:
header, payload = msg
header_type = header["type"]
if header_type == "FRAME":
if out is None:
fixed_sig_shape = header['first_frame_header'].image_size_eff
out = np.zeros((tiling_scheme.depth,) + fixed_sig_shape, dtype=dtype)
out_flat = out.reshape((tiling_scheme.depth, -1,))
raw_frames = MerlinRawFrames(
buffer=payload,
start_idx=header['start_idx'],
Expand Down

0 comments on commit 16c6242

Please sign in to comment.