From 2a64c17353f4dfa70344d58e4ee02cd937bff721 Mon Sep 17 00:00:00 2001 From: Chris Leaman Date: Fri, 23 Nov 2018 10:11:07 +1100 Subject: [PATCH] Fix bug with how observed storm impacts are were calculated --- src/analysis/observed_storm_impacts.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/analysis/observed_storm_impacts.py b/src/analysis/observed_storm_impacts.py index 7c12d6a..0aadbbe 100644 --- a/src/analysis/observed_storm_impacts.py +++ b/src/analysis/observed_storm_impacts.py @@ -85,6 +85,10 @@ def volume_change(df_profiles, df_profile_features, zone): x_max=x_max, ) + # No point keeping so many decimal places, let's round them + prestorm_vol = np.round(prestorm_vol, 2) + poststorm_vol = np.round(poststorm_vol, 2) + df_vol_changes.loc[site_id, "prestorm_{}_vol".format(zone)] = prestorm_vol df_vol_changes.loc[site_id, "poststorm_{}_vol".format(zone)] = poststorm_vol df_vol_changes.loc[site_id, "{}_vol_change".format(zone)] = prestorm_vol - poststorm_vol @@ -119,8 +123,8 @@ def storm_regime(df_observed_impacts): :return: """ logger.info("Getting observed storm regimes") - df_observed_impacts.loc[df_observed_impacts.swash_vol_change < 3, "storm_regime"] = "swash" - df_observed_impacts.loc[df_observed_impacts.dune_face_vol_change > 3, "storm_regime"] = "collision" + df_observed_impacts.loc[df_observed_impacts.dune_face_vol_change <= 5, "storm_regime"] = "swash" + df_observed_impacts.loc[df_observed_impacts.dune_face_vol_change > 5, "storm_regime"] = "collision" return df_observed_impacts