def convert_to_degspd(u,v):
"""Convert arrays of u,v vectors to arrays of direction (in met.deg) and speed
Arguments:
u - np array of the u (east) part of the vector
v - np array of the v (north) part of the vector
"""
dir_spd = []
wind_direction = (np.rad2deg(np.arctan2(-u,-v))) % 360.0
wind_speed = np.sqrt(u ** 2 + v ** 2)
dir_spd.append(wind_direction)
dir_spd.append(wind_speed)
return np.array(dir_spd) #[[list of wind dirs], [list of wind spds]]
评论列表
文章目录