Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion src/PyMca5/PyMcaIO/HDF5Stack1D.py
Original file line number Diff line number Diff line change
Expand Up @@ -728,6 +728,13 @@ def loadFileList(self, filelist, selection, scanlist=None):
xpath = scan + xSelection
xDataset = hdf[xpath][()]
xDatasetList.append(xDataset)
try:
yDataset = hdf[path][()]
IN_MEMORY = True
except (MemoryError, ValueError):
_logger.info("Dynamic loading of images")
yDataset = hdf[path]
IN_MEMORY = False
if mSelection is not None:
nMonitorData = mDataset.size
case = -1
Expand All @@ -750,7 +757,11 @@ def loadFileList(self, filelist, selection, scanlist=None):
for i in range(yDataset.shape[0]):
self.data[i] += yDataset[i] / mDataset
else:
self.data += yDataset
if IN_MEMORY:
self.data += yDataset
else:
for i in range(yDataset.shape[0]):
self.data[i:i+1] += yDataset[i:i+1]
else:
self.info["McaIndex"] = mcaIndex
if _time:
Expand Down