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