Skip to content

Commit

Permalink
DECTRIS/Merlin: tweak tile shape adjustment
Browse files Browse the repository at this point in the history
Don't change the max I/O size, and be sure to select a full-frame
tileshape via the base shape. This should be more robust, even if it can
lead to non-optimal tiles (especially in the GPU case), which has to be
properly fixed in a different way.
  • Loading branch information
sk1p committed Jul 24, 2024
1 parent 15eeaf1 commit 6f653c4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 23 deletions.
12 changes: 0 additions & 12 deletions src/libertem_live/detectors/dectris/acquisition.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,18 +299,6 @@ def need_decode(self, read_dtype, roi, corrections):
''
return True

def adjust_tileshape(self, tileshape, roi):
''
depth = 12 # FIXME: hardcoded, hmm...
return (depth, *self.meta.shape.sig)
# return Shape((self._end_idx - self._start_idx, 256, 256), sig_dims=2)

def get_max_io_size(self):
''
# return 12*256*256*8
# FIXME magic numbers?
return 12*np.prod(self.meta.shape.sig)*8

def get_base_shape(self, roi):
''
return (1, *self.meta.shape.sig)
Expand Down
14 changes: 3 additions & 11 deletions src/libertem_live/detectors/merlin/acquisition.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,19 +176,11 @@ def check_valid(self):

def need_decode(self, read_dtype, roi, corrections):
''
return True # FIXME: we just do this to get a large tile size

def get_max_io_size(self):
''
# return 12*256*256*8
# FIXME magic numbers?
return 128 * np.prod(self.meta.shape.sig) * 8
return True

def get_base_shape(self, roi):
return (1, 1, self.meta.shape.sig[-1])

def adjust_tileshape(self, tile_shape, roi):
return (tuple(tile_shape)[0], *self.meta.shape.sig)
''
return (1, *self.meta.shape.sig)

def get_partitions(self):
''
Expand Down

0 comments on commit 6f653c4

Please sign in to comment.