Skip to content

Commit 5da9d6a

Browse files
committed
Return type is type of v_wind
1 parent d54c1c7 commit 5da9d6a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

windpowerlib/wind_speed.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ def logarithmic_wind_profile(v_wind, v_wind_height, hub_height, z_0,
7878
raise ValueError("To take an obstacle height of {0} m".format(
7979
obstacle_height) + " into consideration, wind" +
8080
" speed data of a greater height is needed.")
81+
# Return np.array if v_wind is np.array
82+
if isinstance(v_wind, np.ndarray):
83+
z_0 = np.array(z_0)
8184
return (v_wind * np.log((hub_height - 0.7 * obstacle_height) / z_0) /
8285
np.log((v_wind_height - 0.7 * obstacle_height) / z_0))
8386

@@ -149,6 +152,9 @@ def v_wind_hellman(v_wind, v_wind_height, hub_height, z_0=None,
149152
"""
150153
if hellman_exp is None:
151154
if z_0 is not None:
155+
# Return np.array if v_wind is np.array
156+
if isinstance(v_wind, np.ndarray):
157+
z_0 = np.array(z_0)
152158
hellman_exp = 1 / np.log(hub_height / z_0)
153159
else:
154160
hellman_exp = 1/7

0 commit comments

Comments
 (0)