From e6bb50c00ec75f2eb23797363d1a4b47e4433f24 Mon Sep 17 00:00:00 2001 From: Chris Leaman Date: Wed, 19 Dec 2018 16:25:23 +1100 Subject: [PATCH] Fix bug when calculating R_high lat/lon geojson --- src/data/csv_to_geojson.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/data/csv_to_geojson.py b/src/data/csv_to_geojson.py index 301f419..e7ca651 100644 --- a/src/data/csv_to_geojson.py +++ b/src/data/csv_to_geojson.py @@ -76,7 +76,8 @@ def R_high_to_geojson(sites_csv, profiles_csv, crest_toes_csv, impacts_csv, outp # Take the intersection closest to the dune face. try: - dune_face_x = np.mean(df_crest_toes.loc[(site_id, "prestorm"), :].x) + x_cols = [x for x in df_crest_toes.columns if '_x' in x] + dune_face_x = np.mean(df_crest_toes.loc[(site_id, "prestorm"),x_cols].tolist()) int_x = min(int_x, key=lambda x: abs(x - dune_face_x)) except: continue