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
As per #225, visualization using Datashader expects our unstructured grid to be represented as a spatialpandas.GeoDataFrame with the following entries
Grid Representation: spatialpandas.geometry.MultiPolygonArray, collection of Polygons that are representative of the faces of our unstructured grid.
Data Variables: Values to color the polygons
Implementation
Given that all entries within a GeoDataFrame must be 1D arrays, the implementation will depend on where the to_gdf method is called.
Grid.to_gdf()
Implementation here will contain the bulk of the computations associated with represented our internal unstructured grid as a spatialpandas.geometry.MultiPolygonArray and will return a GeoDataFrame with only the Grid Representation populated (no data variables). It should handle all data-cleaning (Antimeridian Splitting, Coordinate Verification, Coordinate Transforms, etc.)
UxDataArray.to_gdf()
Will internally call Grid.to_gdf() to construct or return the cached version of the GeoDataFrame with the grid representation already populated. Additionally, will populate a column in the GeoDataFrame with a 1D entry representing the values we want to shade each Polygon (Face) with.
Below is an example showcasing how this would work considering the 1D limitation of the GeoDataFrame
# some grid with a multi-dimensional data variable ("T" with dimensions ['Time', 'Layer', 'nFace'])uxds=ux.open_dataset(grid_file, data_file)
# not supportedgdf=uxds['T'].to_gdf()
# a 1D slide is supported gdf=uxds['T'][0, 0].to_gdf()
UxDataDataset.to_gdf()
Converting the entire dataset, especially if it includes multi-dimensional data variables, is not recommended/plausible.
Activity