libera_utils.scene_id.calculate_surface_wind#
- libera_utils.scene_id.calculate_surface_wind(surface_wind_u: float | ndarray[Any, dtype[floating]], surface_wind_v: float | ndarray[Any, dtype[floating]]) float | ndarray[Any, dtype[floating]]#
Calculate total surface wind speed from u and v vector components.
- Parameters:
- Returns:
Total wind speed magnitude (m/s), or np.nan where input components are NaN
- Return type:
float or ndarray
Notes
Wind speed is calculated using the Pythagorean theorem: sqrt(u^2 + v^2). NaN values in either component result in NaN output for that position.
Examples
>>> calculate_surface_wind(3.0, 4.0) 5.0 >>> calculate_surface_wind(np.array([3, np.nan]), np.array([4, 5])) array([5., nan])