-
-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multidimensional Coordinate Variables (3D lats/lons) #73
Comments
Should have realized this earlier but this is related to: It's possible that we can get the interfaces to interpret 2d coordinate arrays correctly. The main issue is in plotting this data in bokeh since the data will have to be regridded before being rendered with bokeh. |
I've put together a notebook outlining how to work with datasets like this in GeoViews: https://anaconda.org/philippjfr/working_with_multi-dimensional_coordinates/notebook |
@philippjfr, the example you gave already starts with 1D x,y coordinates. Do you have an example for a dataset with only 2D coordinates? It would be nice to see a HoloViews version of this example: http://xarray.pydata.org/en/stable/examples/multidimensional-coords.html#plotting |
I'll try to put together an example. That said in the long term we should implement an actual interface for 2D coordinates, so you could easily do something like this: ds = hv.Dataset(xr.tutorial.load_dataset('rasm'), ['x', 'y', 'time'], 'Tair')
datashade(ds.groupby('time')) |
%%opts Overlay [width=600 height=400] Image (cmap='viridis') Feature (line_color='black')
sm_surf = gv.Dataset(sa_xds,
kdims=['cell_lon', 'cell_lat'],
group='Forecast_Data/sm_surface_forecast',
vdims=['Forecast_Data/sm_surface_forecast'],
crs=ccrs.PlateCarree())
sm_img = sm_surf.to(gv.Image, ['cell_lon', 'cell_lat'], 'Forecast_Data/sm_surface_forecast', dynamic=True)
|
This is an example of a solution that may help with the error: |
Getting somewhere here, once #116 is merged you'll be able to do something like this: %%opts Image [width=700 height=350 clipping_colors={'NaN': (0,0,0,0)} colorbar=True]
tiles = gv.WMTS('https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{Z}/{Y}/{X}.jpg')
xrds = xr.tutorial.load_dataset('RASM_example_data')
qmesh = gv.Dataset(xrds, ['time', 'xc', 'yc']).to(gv.QuadMesh, ['xc', 'yc'])
tiles * rasterize(gv.operation.project(qmesh), aggregator=ds.mean('Tair'),
precompute=True) |
This is now merged, closing. |
We have been working on CF-compliant netcdf formats to provide flexible multi resolution (but gridded) input to unstructured hydrodynamic and wave models.
xarray
appears to support dealing with these files/groups relatively painlessly, and it would be great if we could get support ingeoviews
which would allow us to demonstrate the capabilities of the format nicely.Here is an example of a group within a test file:
This is the test I was attempting:
Here is the full traceback (although I understand from Gitter that there are probably bigger issues at play to support a structure like this):
Versions I am currently using if it's relevant:
The text was updated successfully, but these errors were encountered: