JiaweiZhuang / xESMF

Universal Regridder for Geospatial Data
http://xesmf.readthedocs.io/
MIT License
269 stars 49 forks source link

Check if grid coordinate values have discontinuity #16

Open JiaweiZhuang opened 6 years ago

JiaweiZhuang commented 6 years ago

To make issues like #14 easier to discover, xESMF should check if the input grid coordinates are well-defined, monotonically increasing ("smoothly-changing" would be more appropriate), single-tile quadrilateral grids. Basic steps would be:

  1. Convert grid coordinate to Cartesian (x-y-z) space so that polar singularities and periodic boundaries can pass the check.
  2. Compute grid sizes by something like np.diff()
  3. If there's an abrupt change in grid size (criteria to be decided), throw a warning with element index.

Make it an option if it incurs visible slow-down.

JiaweiZhuang commented 6 years ago

Mainly for bilinear and conservative that need to know connectivity. Nearest neighbor methods should be OK with disconnected tiles.