Only save selected profiles

master
Dan Howe 3 years ago
parent 21cadfd589
commit af56cbe031

@ -485,8 +485,7 @@ def process(beach_name, beach_scenario, n_runs, start_year, end_year,
df_out = df_out.assign(omit_from_shp=False)
for b, p in zip(omit_from_shp['block'],
omit_from_shp['profile']):
idx = (df_out['block'] == str(b)) & (df_out['profile']
== p)
idx = (df_out['block'] == b) & (df_out['profile'] == p)
df_out.loc[idx, 'omit_from_shp'] = True
# Specify additional points to be included in shapefiles
@ -558,9 +557,6 @@ def process(beach_name, beach_scenario, n_runs, start_year, end_year,
storm_demand_dist = zero_chainage - storm_demand_chainage
# Plot statistics once for each profile
year_idx = year == years
# Include additional points for shapefile
df_csv = df_out[df_out['beach'] == beach_name]
@ -573,6 +569,9 @@ def process(beach_name, beach_scenario, n_runs, start_year, end_year,
if df_out[df_out['beach'] == beach_name].index[0] == i:
df_csv.loc[[], :].to_csv(csv_name, index=False)
# Only save points if they are going into shapefile
df_csv = df_csv[~df_csv['omit_from_shp'].astype(bool)]
# Append data for current profile
df_csv[df_csv.index == i].to_csv(csv_name,
mode='a',

Loading…
Cancel
Save