Add grain size as required runup parameter

Used by Power et al. (2018), but not required for other models
develop
Chris Leaman 6 years ago
parent 1830d06e40
commit 4ea435a814

@ -100,6 +100,7 @@ impacts: ./data/interim/impacts_forecasted_foreshore_slope_sto06.csv ./data/inte
--tides-csv "./data/interim/tides.csv" \
--profiles-csv "./data/interim/profiles.csv" \
--profile-features-csv "./data/interim/profile_features_crest_toes.csv" \
--grain-size-csv "./data/interim/sites_grain_size.csv" \
--runup-function "sto06" \
--slope "foreshore" \
--profile-type "prestorm" \
@ -111,6 +112,7 @@ impacts: ./data/interim/impacts_forecasted_foreshore_slope_sto06.csv ./data/inte
--tides-csv "./data/interim/tides.csv" \
--profiles-csv "./data/interim/profiles.csv" \
--profile-features-csv "./data/interim/profile_features_crest_toes.csv" \
--grain-size-csv "./data/interim/sites_grain_size.csv" \
--runup-function "sto06" \
--slope "mean" \
--profile-type "prestorm" \
@ -122,6 +124,7 @@ impacts: ./data/interim/impacts_forecasted_foreshore_slope_sto06.csv ./data/inte
--tides-csv "./data/interim/tides.csv" \
--profiles-csv "./data/interim/profiles.csv" \
--profile-features-csv "./data/interim/profile_features_crest_toes.csv" \
--grain-size-csv "./data/interim/sites_grain_size.csv" \
--runup-function "hol86" \
--slope "mean" \
--profile-type "prestorm" \
@ -133,6 +136,7 @@ impacts: ./data/interim/impacts_forecasted_foreshore_slope_sto06.csv ./data/inte
--tides-csv "./data/interim/tides.csv" \
--profiles-csv "./data/interim/profiles.csv" \
--profile-features-csv "./data/interim/profile_features_crest_toes.csv" \
--grain-size-csv "./data/interim/sites_grain_size.csv" \
--runup-function "nie91" \
--slope "mean" \
--profile-type "prestorm" \

@ -20,6 +20,7 @@ def forecast_twl(
df_profiles,
df_waves,
df_profile_features,
df_grain_size,
runup_function,
n_processes=MULTIPROCESS_THREADS,
slope="foreshore",
@ -82,6 +83,7 @@ def forecast_twl(
Hs0=df_twl["Hs0"].tolist(),
Tp=df_twl["Tp"].tolist(),
beta=df_twl["beta"].tolist(),
r=df_twl.merge(df_grain_size, on="site_id").r.tolist(),
)
df_twl["R2"] = R2
@ -340,6 +342,7 @@ def slope_from_profile(
type=click.Choice(["prestorm", "poststorm"]),
)
@click.option("--output-file", required=True, help="")
@click.option("--grain-size-csv", required=False, help="")
def create_twl_forecast(
waves_csv,
tides_csv,
@ -349,6 +352,7 @@ def create_twl_forecast(
slope,
profile_type,
output_file,
grain_size_csv,
):
logger.info("Creating forecast of total water levels")
logger.info("Importing data")
@ -356,6 +360,7 @@ def create_twl_forecast(
df_tides = pd.read_csv(tides_csv, index_col=[0, 1])
df_profiles = pd.read_csv(profiles_csv, index_col=[0, 1, 2])
df_profile_features = pd.read_csv(profile_features_csv, index_col=[0, 1])
df_grain_size = pd.read_csv(grain_size_csv, index_col=[0])
logger.info("Forecasting TWL")
df_twl = forecast_twl(
@ -363,6 +368,7 @@ def create_twl_forecast(
df_profiles,
df_waves,
df_profile_features,
df_grain_size,
runup_function=getattr(runup_models, runup_function),
slope=slope,
profile_type=profile_type,

@ -2,7 +2,8 @@ import numpy as np
import pandas as pd
def sto06(Hs0, Tp, beta):
def sto06(Hs0, Tp, beta, **kwargs):
"""
:param Hs0: List or float of offshore significant wave height values
:param Tp: List or float of peak wave period
@ -43,8 +44,7 @@ def sto06(Hs0, Tp, beta):
)
def hol86(Hs0, Tp, beta):
def hol86(Hs0, Tp, beta, **kwargs):
df = pd.DataFrame(
{"Hs0": Hs0, "Tp": Tp, "beta": beta}, index=[x for x in range(0, np.size(Hs0))]
)
@ -67,8 +67,7 @@ def hol86(Hs0, Tp, beta):
)
def nie91(Hs0, Tp, beta):
def nie91(Hs0, Tp, beta, **kwargs):
df = pd.DataFrame(
{"Hs0": Hs0, "Tp": Tp, "beta": beta}, index=[x for x in range(0, np.size(Hs0))]
)

Loading…
Cancel
Save