Skip to content

Commit

Permalink
Merge pull request #2 from chris3edwards3/master
Browse files Browse the repository at this point in the history
Change rp20 to rp50
  • Loading branch information
msouff authored Jul 10, 2020
2 parents 4ef12b2 + cb69342 commit a68a96d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ecflow/spt_extract_plain_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@ def extract_summary_table(workspace):

# creating pandas dataframe with return periods
era_type = str(sys.argv[4])
rp_path = glob(os.path.join(os.path.split(workspace)[0], f'return_periods_{era_type}*.nc'))[0]
rp_path = glob(os.path.join(os.path.split(workspace)[0], f'*return_periods_{era_type}*.nc*'))[0]
rp_ncfile = nc.Dataset(rp_path, 'r')

# extract values
rp_comid = rp_ncfile.variables['rivid'][:]
data = {
'return_2': rp_ncfile.variables['return_period_2'][:],
'return_10': rp_ncfile.variables['return_period_10'][:],
'return_20': rp_ncfile.variables['return_period_20'][:]
'return_50': rp_ncfile.variables['return_period_50'][:]
}

# creates dataframe
Expand Down Expand Up @@ -91,7 +91,7 @@ def extract_summary_table(workspace):
for index, comid in enumerate(comids):
for f_date, f_max, f_mean in zip(dates, maxlist[index], meanlist[index]):
# define reach color based on return periods
if f_mean > rp_df.loc[comid, 'return_20']:
if f_mean > rp_df.loc[comid, 'return_50']:
color = 'purple'
elif f_mean > rp_df.loc[comid, 'return_10']:
color = 'red'
Expand Down

0 comments on commit a68a96d

Please sign in to comment.