Skip to content

Commit

Permalink
Merge pull request #88 from pycroscopy/chunking
Browse files Browse the repository at this point in the history
Update emd_reader.py
  • Loading branch information
gduscher authored Dec 17, 2022
2 parents fef578c + 05387bb commit f1a9d0c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
4 changes: 2 additions & 2 deletions SciFiReaders/__version__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
version = '0.0.5'
time = '2022-04-25 12:43:00'
version = '0.0.6'
time = '2022-12-16 12:43:00'
9 changes: 8 additions & 1 deletion SciFiReaders/readers/microscopy/em/tem/emd_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,14 @@ def get_image(self):
quantity='distance',
dimension_type='spatial'))
else:
self.data_array = np.moveaxis(self.data_array, source=[0, 1, 2], destination=[1, 2, 0])
# There is a problem with random access of data due to chunking in hdf5 files
# Speed-up copied from hyperspy.ioplugins.EMDReader.FEIEMDReader

data_array = np.empty(self.data_array.shape)
self.data_array.read_direct(data_array)
self.data_array = np.rollaxis(data_array, axis=2)
# np.moveaxis(data_array, source=[0, 1, 2], destination=[2, 0, 1])

self.datasets.append(sidpy.Dataset.from_array(self.data_array))
self.datasets[-1].data_type = 'image_stack'
self.datasets[-1].set_dimension(0, sidpy.Dimension(np.arange(self.data_array.shape[0]),
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@
'Natural Language :: English',
'Operating System :: OS Independent',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: Implementation :: CPython',
'Topic :: Scientific/Engineering :: Information Analysis'],
keywords=['imaging', 'spectra', 'multidimensional', 'scientific'],
Expand Down

0 comments on commit f1a9d0c

Please sign in to comment.