diff --git a/spc/spc.py b/spc/spc.py index cdd7cb1..b49865c 100644 --- a/spc/spc.py +++ b/spc/spc.py @@ -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) @@ -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