Deltares / xugrid

Xarray and unstructured grids
https://deltares.github.io/xugrid/
MIT License
62 stars 8 forks source link

regridder from_dataset should restore the original mesh name #133

Open Huite opened 1 year ago

Huite commented 1 year ago

This came up with debugging structured -> unstructured regridding. This requires getting the source dimensions (that we use in the xarray apply_ufunc call). Ideally, we can get this from the regridder._source and then check whether these dimensions occur in the object to regrid. However, if the .to_dataset() replaces the mesh name by "_source", this fails.

It should be a relatively easy fix, by storing the original name, and re-replacing the _source substitution.