2020"""
2121
2222import logging
23+ import warnings
2324from typing import Optional , Tuple , Union
2425
2526import numpy as np
@@ -99,8 +100,8 @@ def compute_angular_windspeeds(
99100 d_centr : np .ndarray ,
100101 mask_centr_close : np .ndarray ,
101102 model : int ,
103+ cyclostrophic : Optional [bool ] = False ,
102104 model_kwargs : Optional [dict ] = None ,
103- cyclostrophic : bool = False ,
104105):
105106 """Compute (absolute) angular wind speeds according to a parametric wind profile
106107
@@ -117,16 +118,25 @@ def compute_angular_windspeeds(
117118 Wind profile model selection according to MODEL_VANG.
118119 model_kwargs: dict, optional
119120 If given, forward these kwargs to the selected model. Default: None
120- cyclostrophic : bool, optional
121- If True, do not apply the influence of the Coriolis force (set the Coriolis terms to 0) .
122- Default: False
121+ cyclostrophic: bool, optional, deprecated
122+ This argument is deprecated and will be removed in a future release .
123+ Include `cyclostrophic` as `model_kwargs` instead.
123124
124125 Returns
125126 -------
126127 ndarray of shape (npositions, ncentroids)
127128 containing the magnitude of the angular windspeed per track position per centroid location
128129 """
129130 model_kwargs = {} if model_kwargs is None else model_kwargs
131+
132+ if cyclostrophic is not None :
133+ warnings .warn (
134+ "The 'cyclostrophic' argument is deprecated and will be removed in a future"
135+ "release. Include it in 'model_kwargs' instead." ,
136+ DeprecationWarning ,
137+ )
138+ model_kwargs ["cyclostrophic" ] = cyclostrophic
139+
130140 compute_funs = {
131141 MODEL_VANG ["H1980" ]: _compute_angular_windspeeds_h1980 ,
132142 MODEL_VANG ["H08" ]: _compute_angular_windspeeds_h08 ,
@@ -139,7 +149,6 @@ def compute_angular_windspeeds(
139149 si_track ,
140150 d_centr ,
141151 mask_centr_close ,
142- cyclostrophic = cyclostrophic ,
143152 ** model_kwargs ,
144153 )
145154 result [0 , :] *= 0
@@ -241,11 +250,11 @@ def _compute_angular_windspeeds_h10(
241250 si_track : xr .Dataset ,
242251 d_centr : np .ndarray ,
243252 close_centr_msk : np .ndarray ,
244- cyclostrophic : bool = True ,
245253 gradient_to_surface_winds : float = DEF_GRADIENT_TO_SURFACE_WINDS ,
246254 rho_air_const : float = DEF_RHO_AIR ,
247255 vmax_from_cen : bool = True ,
248256 vmax_in_brackets : bool = False ,
257+ ** kwargs ,
249258):
250259 """Compute (absolute) angular wind speeds according to the Holland et al. 2010 model
251260
@@ -285,8 +294,8 @@ def _compute_angular_windspeeds_h10(
285294 ndarray of shape (npositions, ncentroids)
286295 containing the magnitude of the angular windspeed per track position per centroid location
287296 """
288- if not cyclostrophic :
289- LOGGER .debug (
297+ if not kwargs . get ( " cyclostrophic" , True ) :
298+ LOGGER .warning (
290299 "The function _compute_angular_windspeeds_h10 was called with parameter "
291300 '"cyclostrophic" equal to false. Please be aware that this setting is ignored as the'
292301 " Holland et al. 2010 model is always cyclostrophic."
@@ -1203,7 +1212,6 @@ def _compute_windfields(
12031212 mask_centr_close ,
12041213 model ,
12051214 model_kwargs = model_kwargs ,
1206- cyclostrophic = False ,
12071215 )
12081216
12091217 # Influence of translational speed decreases with distance from eye.
0 commit comments