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

prepost.hawcstab2: rename duplicate columns in .pwr files with gradients

parent b83db7c6
No related branches found
No related tags found
No related merge requests found
...@@ -75,9 +75,18 @@ def ReadFileHAWCStab2Header(fname): ...@@ -75,9 +75,18 @@ def ReadFileHAWCStab2Header(fname):
line_header, line_data = get_lines(fname) line_header, line_data = get_lines(fname)
colwidths = get_col_widths(line_data) colwidths = get_col_widths(line_data)
# FIXME: gradients have duplicate columns: set for with wake updated
# and another with frozen wake assumption
columns = get_col_names(line_header, colwidths) columns = get_col_names(line_header, colwidths)
# gradients have duplicate columns: set for with wake updated
# and another with frozen wake assumption, append _fw to the columns
# used to indicate frozen wake gradients
if 'dQ/dt [kNm/deg]' in columns:
i1 = columns.index('dQ/dt [kNm/deg]')
if i1 > -1:
i2 = columns.index('dQ/dt [kNm/deg]', i1+1)
if i2 > i1:
for i in range(i2, len(columns)):
columns[i] = columns[i].replace(' [', '_fw [')
df = pd.read_fwf(fname, widths=colwidths, comment='#', header=None, df = pd.read_fwf(fname, widths=colwidths, comment='#', header=None,
names=columns) names=columns)
units = regex_units.findall(''.join(columns)) units = regex_units.findall(''.join(columns))
......
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