Skip to content
Snippets Groups Projects
Commit 6d0252f6 authored by Francois POLACK's avatar Francois POLACK
Browse files

fix: Bug in reading Alba XYZ files due to a spurious empty line before the last #

parent 09278c09
Branches
No related tags found
No related merge requests found
......@@ -277,12 +277,13 @@ class XYZfile(object):
if line[0]=='#':
print("No data")
while line[0]!='#':
#skip empty line (anomalous lines in Alba data)
if line!='\n':
elem=line.rstrip('\n').split(None,2)
if elem[2]== "No Data" :
Data[int(elem[1])-self.PhaseRect[1], int(elem[0])-self.PhaseRect[0]] =np.nan
else :
Data[int(elem[1])-self.PhaseRect[1], int(elem[0])-self.PhaseRect[0]] =multiplier*float(elem[2])
line=file.readline()
return Data
else: #ASCII file
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment