Include grain size inputs

develop
Chris Leaman 6 years ago
parent 6c13fc389c
commit 821e5c34cf

@ -86,6 +86,11 @@ impacts: ./data/interim/impacts_forecasted_foreshore_slope_sto06.csv ./data/inte
--profiles-csv "./data/interim/profiles.csv" \
--output-file "./data/interim/profile_features_crest_toes.csv" \
./data/interim/sites_grain_size.csv : ./data/raw/grain_size/sites_grain_size.csv
$(PYTHON_CLI) create-grain-size-csv \
--grain-size-csv "./data/raw/grain_size/sites_grain_size.csv" \
--output-file "./data/interim/sites_grain_size.csv" \
### TWLs

@ -33,4 +33,5 @@ if __name__ == "__main__":
cli.add_command(parse_mat.create_sites_and_profiles_csv)
cli.add_command(parse_mat.create_tides_csv)
cli.add_command(parse_mat.create_waves_csv)
cli.add_command(parse_mat.create_grain_size_csv)
cli()

@ -546,6 +546,23 @@ def create_tides_csv(tides_mat, sites_csv, output_file):
logger.info("Created %s", output_file)
@click.command(short_help="create sites_grain_size.csv")
@click.option(
"--grain-size-csv",
required=True,
help=".csv file description of cross section sites",
)
@click.option("--output-file", required=True, help="where to save sites_grain_size.csv")
def create_grain_size_csv(grain_size_csv, output_file):
logger.info("Creating %s", output_file)
df_sites_grain_size = pd.read_csv(grain_size_csv, index_col=[0])
# Calculate roughness, refer to Power et al (2018)
df_sites_grain_size["r"] = 2.5 * df_sites_grain_size["d_50"]
df_sites_grain_size.to_csv(output_file)
logger.info("Created %s", output_file)
@click.group()
def cli():
pass

Loading…
Cancel
Save