xarray-spatial
xarray-spatial copied to clipboard
Add Degrees -> Zonal and meridional flow
I want to be able to create the input dataset necessary for the ipyleaflet velocity layer.
Here is an example of what we want to get to:
from ipyleaflet import Map, TileLayer, basemaps
from ipyleaflet.velocity import Velocity
import xarray as xr
import os
if not os.path.exists('wind-global.nc'):
url = 'https://github.com/benbovy/xvelmap/raw/master/notebooks/wind-global.nc'
import requests
r = requests.get(url)
wind_data = r.content
with open('wind-global.nc', 'wb') as f:
f.write(wind_data)
center = [0, 0]
zoom = 1
m = Map(center=center, zoom=zoom, interpolation='nearest', basemap=basemaps.CartoDB.DarkMatter)
ds = xr.open_dataset('wind-global.nc')
display_options = {
'velocityType': 'Global Wind',
'displayPosition': 'bottomleft',
'displayEmptyString': 'No wind data'
}
@brendancol, will this issue be worked on?