Skip to content
Snippets Groups Projects
Commit be9eef87 authored by David Verelst's avatar David Verelst
Browse files

hawcstab2: induction output file number of columns depends on the version of...

hawcstab2: induction output file number of columns depends on the version of HAWCStab2. Assume 38, but fallback to 34
parent 749b1d47
No related branches found
No related tags found
No related merge requests found
......@@ -59,7 +59,10 @@ class InductionResults(object):
def read(self, fname):
self.data = np.loadtxt(fname)
self.wsp = int(fname.split('_u')[-1][:-4]) / 1000.0
self.df_data = pd.read_fwf(fname, header=0, widths=[14]*34)
try:
self.df_data = pd.read_fwf(fname, header=0, widths=[14]*38)
except:
self.df_data = pd.read_fwf(fname, header=0, widths=[14]*34)
# sanitize the headers
cols = self.df_data.columns
self.df_data.columns = [k[:-2].replace('#', '').strip() for k in cols]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment