Skip to content

Commit 318e4ef

Browse files
committed
Fix for #1530
"xUnits" is only used in Versions 1, 2, 3 of .pxp files; Version 5 uses "dimUnits" - see https://github.com/AFM-analysis/igor2/blob/43fccf51714661fb96372e8119c59e17ce01f683/igor2/binarywave.py#L501
1 parent ac881dd commit 318e4ef

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

neo/io/igorproio.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,12 @@ def _wave_to_analogsignal(self, content, dirpath):
133133
header = content["wave_header"]
134134
name = str(header["bname"].decode("utf-8"))
135135
units = "".join([x.decode() for x in header["dataUnits"]])
136-
time_units = "".join([x.decode() for x in header["xUnits"]])
136+
if "xUnits" in header:
137+
time_units = "".join([x.decode() for x in header["xUnits"]])
138+
elif "dimUnits" in header:
139+
time_units = header["dimUnits"].ravel()[0].decode()
140+
else:
141+
time_units = ""
137142
if len(time_units) == 0:
138143
time_units = "s"
139144
try:

0 commit comments

Comments
 (0)