MCPcopy Create free account
hub / github.com/NSLS2/PyXRF / _get_slice

Function _get_slice

pyxrf/core/map_processing.py:271–279  ·  view source on GitHub ↗
(n1, n2)

Source from the content-addressed store, hash-verified

269 chunk_y, chunk_x = min(chunk_y, ny), min(chunk_x, nx)
270
271 def _get_slice(n1, n2):
272 data_slice = data[
273 slice(n1 * chunk_y, min(n1 * chunk_y + chunk_y, ny)),
274 slice(n2 * chunk_x, min(n2 * chunk_x + chunk_x, nx)),
275 ]
276 # Wrap the slice into a list wiht appropriate dimensions
277 for _ in range(2, data.ndim):
278 data_slice = [data_slice]
279 return data_slice
280
281 # Chunk the numpy array and assemble it as a dask array
282 data_dask = da.block(

Callers 1

_chunk_numpy_arrayFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected