Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explicit arguments in TropCyclone.apply_climate_scenario_knu #991

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ CLIMADA tutorials. [#872](https://github.com/CLIMADA-project/climada_python/pull
- `Impact.from_hdf5` now calls `str` on `event_name` data that is not strings, and issue a warning then [#894](https://github.com/CLIMADA-project/climada_python/pull/894)
- `Impact.write_hdf5` now throws an error if `event_name` is does not contain strings exclusively [#894](https://github.com/CLIMADA-project/climada_python/pull/894)
- Split `climada.hazard.trop_cyclone` module into smaller submodules without affecting module usage [#911](https://github.com/CLIMADA-project/climada_python/pull/911)
- `yearly_steps` parameter of `TropCyclone.apply_climate_scenario_knu` has been made explicit [#991](https://github.com/CLIMADA-project/climada_python/pull/991)

### Fixed

Expand Down
9 changes: 6 additions & 3 deletions climada/hazard/trop_cyclone/trop_cyclone.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ def apply_climate_scenario_knu(
percentile: str = "50",
scenario: str = "4.5",
target_year: int = 2050,
**kwargs,
yearly_steps: int = 5,
):
"""
From current TC hazard instance, return new hazard set with future events
Expand Down Expand Up @@ -422,6 +422,9 @@ def apply_climate_scenario_knu(
'8.5' for RCP 8.5
target_year : int
future year to be simulated, between 2000 and 2100. Default: 2050.
yearly_steps : int
yearly resolution at which projections are provided. Default is 5 years.

Returns
-------
haz_cc : climada.hazard.TropCyclone
Expand Down Expand Up @@ -450,11 +453,11 @@ def apply_climate_scenario_knu(
for basin in np.unique(tc_cc.basin):
scale_year_rcp_05, scale_year_rcp_45 = [
get_knutson_scaling_factor(
percentile=percentile,
variable=variable,
percentile=percentile,
basin=basin,
baseline=(np.min(years), np.max(years)),
**kwargs,
yearly_steps=yearly_steps,
).loc[target_year, scenario]
for variable in ["cat05", "cat45"]
]
Expand Down
Loading