You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I can confirm the plot directly using matplotlib
fig, ax = plt.subplots(nrows=1, ncols=1, subplot_kw={'projection': crs})
ax.barbs(lon, lat, u10, v10)
However, error AttributeError: 'NumpySource' object has no attribute 'u_values' is encountered using earthkit,plots
chart = ekt.plots.Map(domain=domain_bounds, crs=crs)
chart.barbs(lon, lat, u10, v10)
Shouldn't the ekt.plots.barbs method also accept the arrays? Also, is it necessary to perform to_xarray() on the earthkit.data object for plots.barbs()?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
chart.barbs() produces error NumpySource' object has no attribute 'u_values'
import earthkit as ekt
import matplotlib.pyplot as plt
import cartopy.crs as ccrs
ds = ekt.data.from_source("ecmwf-open-data",
source='aws',
model='ifs',
param=["10u", "10v"],
step=[24],
)
crs = ccrs.PlateCarree()
domain_bounds = [-107,-89,32,50]
ds_xr = ds.to_xarray()
ds_xr = ds_xr.coarsen(latitude=4, longitude=4, boundary='trim').mean()
lon = ds_xr.longitude.values
lat = ds_xr.latitude.values
u10 = ds_xr['10u'].values
v10 = ds_xr['10v'].values
I can confirm the plot directly using matplotlib
fig, ax = plt.subplots(nrows=1, ncols=1, subplot_kw={'projection': crs})
ax.barbs(lon, lat, u10, v10)
However, error AttributeError: 'NumpySource' object has no attribute 'u_values' is encountered using earthkit,plots
chart = ekt.plots.Map(domain=domain_bounds, crs=crs)
chart.barbs(lon, lat, u10, v10)
Shouldn't the ekt.plots.barbs method also accept the arrays? Also, is it necessary to perform to_xarray() on the earthkit.data object for plots.barbs()?
Beta Was this translation helpful? Give feedback.
All reactions