Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deerload: Fix bug when loading BES3T files with entries in manipulation history layer #164

Merged
merged 8 commits into from
Apr 27, 2021
14 changes: 8 additions & 6 deletions deerlab/deerload.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def deerload(fullbasename, plot=False, full_output=False, *args,**kwargs):
index = AxisNames.index(a)
axisname = a+'TYP'
axistype = parDESC[axisname]
if Dimensions[index] > 1:
if Dimensions[index] == 1:
pass
else:
if 'IGD'== axistype:
Expand All @@ -149,11 +149,11 @@ def deerload(fullbasename, plot=False, full_output=False, *args,**kwargs):

dt_axis = dt_axis.newbyteorder(byteorder)
# Open and read companion file
with open(companionfilename,'rb') as fp:
if fp > 0:
try:
with open(companionfilename,'rb') as fp:
abscissa[:Dimensions[index],index] = np.frombuffer(fp.read(),dtype=dt_axis)
else:
warn(f'Could not read companion file {companionfilename} for nonlinear axis. Assuming linear axis.')
except:
warn(f'Could not read companion file {companionfilename} for nonlinear axis. Assuming linear axis.')
axistype='IDX'
if axistype == 'IDX':
minimum = float(parDESC[str(a+'MIN')])
Expand Down Expand Up @@ -280,7 +280,9 @@ def read_description_file(DSCFileName):
reKeyValue = re.compile(r"(\w+)\W+(.*)")

for line in allLines:


if 'MANIPULATION HISTORY LAYER' in line:
break
# Layer/section header (possible values: #DESC, #SPL, #DSL, #MHL)
mo1 = reSectionHeader.search(line)
if mo1:
Expand Down
Loading