I calculated the wind direction using Metpy. How can I extract the values and use the values as input in another part of my program?
In the sample code below, I would like to display the direction as a numpy variable, so I can use it in my program.
import metpy.calc as mpcalc
import numpy as np
# Make some fake data for us to work with
np.random.seed(19990503) # So we all have the same data
u = np.random.randint(0, 15, 10) * units('m/s')
v = np.random.randint(0, 15, 10) * units('m/s')
direction = mpcalc.wind_direction(u, v)
print(direction)