Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions spc/spc.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ def __init__(self, filename):
if x.find(b'=') >= 0:
# stop it from breaking if there is more than 1 =
key, value = x.split(b'=')[:2]
self.log_dict[key] = value
self.log_dict[key.decode()] = value.decode()
else:
self.log_other.append(x)

Expand Down Expand Up @@ -596,12 +596,15 @@ def write_file(self, path, delimiter='\t', newline='\n'):
f.write(self.data_txt(delimiter, newline))

def print_metadata(self):
""" Print out select metadata"""
print("Scan: ", self.log_dict['Comment'], "\n",
float(self.log_dict['Start']), "to ",
float(self.log_dict['End']), "; ",
float(self.log_dict['Increment']), "cm-1;",
float(self.log_dict['Integration Time']), "s integration time")
""" Try print out select metadata"""
try:
print("Scan: ", self.log_dict['Comment'], "\n",
float(self.log_dict['Start']), "to ",
float(self.log_dict['End']), "; ",
float(self.log_dict['Increment']), "cm-1;",
float(self.log_dict['Integration Time']), "s integration time")
except:
print("")

def plot(self):
""" Plots data, and use column headers, returns figure object plotted
Expand Down