xoa.core.plot.get_mesh

Contents

xoa.core.plot.get_mesh#

xoa.core.plot.get_mesh(lon, lat, stride=(1, 1))[source]#

Get the edges and centers of a grid for plotting, possibly under-sampled

Edges are computed from the centers with xoa.core.grid.centers2edges(). When the grid is under-sampled, the first and last edges are always kept, and the centers are the ones of the coarse cells that are delimited by the kept edges.

Parameters:
  • lon (array_like(ny, nx)) – Longitudes and latitudes of the centers in degrees

  • lat (array_like(ny, nx)) – Longitudes and latitudes of the centers in degrees

  • stride (int, tuple(int)) – Under-sampling strides along y and x

Returns:

  • list(array(n, 2)) – Polylines of the kept edges as (lon, lat) points, the ones that are constant along y first and the ones that are constant along x next

  • array – Longitudes of the centers

  • array – Latitudes of the centers