Skip to content

Commit 7abe210

Browse files
committed
worstsurge -> potential height
1 parent bb4197e commit 7abe210

4 files changed

Lines changed: 32 additions & 14 deletions

File tree

‎CITATION.cff‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ authors:
44
- family-names: Thomas
55
given-names: Simon Donald Alistair
66
orcid: https://orcid.org/0000-0001-7911-1659
7-
title: WorstSurge - Finding the potential height of tropical cyclone storm surges in a changing climate using Bayesian Optimization
8-
version: v0.0.3
7+
title: Finding the potential height of tropical cyclone storm surges in a changing climate using Bayesian Optimization
8+
version: v0.1.1
99
doi: 10.5281/zenodo.15073504
1010
url: "https://github.com/sdat2/worstsurge"
11-
date-released: 2025-04-05
11+
date-released: 2025-09-15

‎README.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# WorstSurge: Finding the potential height of tropical cyclone storm surges in a changing climate using Bayesian optimization
1+
# Finding the potential height of tropical cyclone storm surges in a changing climate using Bayesian optimization
22
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)[![Code Style](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)[![Python package](https://github.com/sdat2/worstsurge/actions/workflows/python-package.yml/badge.svg)](https://github.com/sdat2/worstsurge/actions/workflows/python-package.yml)[![Documentation Status](https://readthedocs.org/projects/worstsurge/badge/?version=latest)](https://worstsurge.readthedocs.io/en/latest/?badge=latest)[![Code DOI](https://zenodo.org/badge/718141777.svg)](https://doi.org/10.5281/zenodo.15073504)[![EarthArXiv Preprint](https://img.shields.io/badge/EarthArXiv-doi:10.31223/X57T5R-blue?style=flat)](https://doi.org/10.31223/X57T5R)
33

44
EarthArxiv preprint now available <https://doi.org/10.31223/X57T5R>!
@@ -92,11 +92,11 @@ If you use this code, please cite the following paper:
9292
And cite the code as:
9393

9494
```bibtex
95-
@software{worstsurge_code,
95+
@software{potential_height_code,
9696
author = {Thomas, Simon D. A.},
9797
doi = {10.5281/zenodo.15073504},
9898
month = {Sep},
99-
title = {{WorstSurge - Finding the potential height of tropical cyclone storm surges in a changing climate using Bayesian Optimization}},
99+
title = {{Finding the potential height of tropical cyclone storm surges in a changing climate using Bayesian Optimization}},
100100
url = {https://github.com/sdat2/worstsurge},
101101
version = {v0.1.1},
102102
year = {2025}

‎setup.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737

3838

3939
setup(
40-
name="worstsurge",
40+
name="PotentialHeight",
4141
description="A set of tools to calculate the potential height of tropical cyclone storm surges",
4242
version="0.1.1",
4343
author_email="sdat2@cam.ac.uk",

‎w22/ps_runs.py‎

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,18 +78,21 @@ def get_regional_processed_data(place="new_orleans") -> xr.Dataset:
7878

7979

8080
@timeit
81-
def trimmed_cmip6_example(
81+
def spatial_example(
8282
pressure_assumption="isothermal",
8383
trial=1,
8484
pi_version=2,
8585
recalculate_pi: bool = True,
8686
place="new_orleans",
8787
) -> None:
88-
"""Run potential size calculations on CMIP6 data to get Gulf of Mexico data.
88+
"""Run potential size calculations on CMIP6 data to get a region.
8989
9090
Args:
91-
pressure_assumption (str, optional): pressure assumption. Defaults to "isopycnal".
91+
pressure_assumption (str, optional): pressure assumption. Defaults to "isothermal".
9292
trial (int, optional): trial number. Defaults to 1.
93+
pi_version (int, optional): pi_version of the pi calculation. Defaults to 2.
94+
recalculate_pi (bool, optional): whether to recalculate pi. Defaults to True.
95+
place (str, optional): place to get data for. Defaults to "new_orleans
9396
"""
9497
# print("input cmip6 data", xr.open_dataset(EX_DATA_PATH))
9598
# select roughly gulf of mexico
@@ -107,6 +110,7 @@ def trimmed_cmip6_example(
107110
print("ds_list", ds_list)
108111
ds = xr.merge(ds_list)
109112
ds = convert(ds)
113+
print("converted ds", ds)
110114
ds_pi = calculate_pi(
111115
ds,
112116
dim="p",
@@ -146,8 +150,9 @@ def trimmed_cmip6_example(
146150
"place must be one of new_orleans, galverston, miami, shanghai, hong_kong, hanoi"
147151
)
148152
print("trimmed input data", in_ds)
149-
rh = qtp2rh(in_ds["q"], in_ds["t"], in_ds["msl"])
150-
in_ds["rh"] = rh
153+
if "rh" not in in_ds:
154+
rh = qtp2rh(in_ds["q"], in_ds["t"], in_ds["msl"])
155+
in_ds["rh"] = rh
151156
in_ds = in_ds[["sst", "msl", "vmax", "t0", "rh", "otl"]]
152157

153158
if pi_version == 2:
@@ -546,7 +551,7 @@ def ps_for_place(
546551
if "ERA5" in models:
547552
point_era5_timeseries(place=place, pressure_assumption=pressure_assumption)
548553
if "CESM2" in models:
549-
trimmed_cmip6_example(
554+
spatial_example(
550555
pressure_assumption=pressure_assumption,
551556
trial=1,
552557
pi_version=4,
@@ -556,4 +561,17 @@ def ps_for_place(
556561
from tcpips.dask_utils import dask_cluster_wrapper
557562

558563
# dask_cluster_wrapper(ps_for_place, "new_orleans")
559-
dask_cluster_wrapper(ps_for_place, "hong_kong")
564+
# dask_cluster_wrapper(ps_for_place, "hong_kong")
565+
dask_cluster_wrapper(
566+
spatial_example,
567+
place="new_orleans",
568+
pressure_assumption="isothermal",
569+
trial=1,
570+
pi_version=4,
571+
)
572+
# spatial_example(
573+
# pressure_assumption="isothermal",
574+
# trial=1,
575+
# pi_version=4,
576+
# place="hong_kong",
577+
# )

0 commit comments

Comments
 (0)