Skip to content

Commit

Permalink
Corrected the swapped axes for non-dm3/4 files at load_file.
Browse files Browse the repository at this point in the history
  • Loading branch information
etienne committed Mar 25, 2020
1 parent 5518f00 commit 0ed3ba3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion inpystem/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,11 +201,18 @@ def load_file(
# This is a matlab file
else:
# The data variable name
variable_name = config[section]['mat_variable_name']
if 'mat_variable_name' in config[section]:
variable_name = config[section]['mat_variable_name']
else:
raise ValueError('The mat_variable_name entry is necessary'
' for .mat files.')
mat_data = scio.loadmat(str(data_file),
variable_names=variable_name)
ndata = mat_data[variable_name]

# To prevent hsdata swap axes.
ndata = np.swapaxes(ndata, 0, 1)

if ndim == 2:
data = hs.signals.Signal2D(ndata)
else:
Expand Down
2 changes: 1 addition & 1 deletion inpystem/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
name = 'inpystem'

# Related PEP: https://www.python.org/dev/peps/pep-0440/
version = "0.1rc2"
version = "0.1.1"
description = "A python library for STEM acquisition inpainting."
license = 'MIT'

Expand Down

0 comments on commit 0ed3ba3

Please sign in to comment.