xoa.grid.to_rect

xoa.grid.to_rect(da, tol=1e-05, errors='warn')[source]

Convert the curvilinear coordinates of array/dataset to rectangular axis coordinates

It checks if the coordinates may be converted to 1D axis without loss of information.

Parameters:
  • da (xarray.DataArray, xarray.Dataset) – In case of a dataset, it must contain longitudes and latitudes.

  • to (float) – Absolute tolerance of the variability of a coordinate along its constant dimension to consider it as a 1D axis coordinate.

  • errors ({'ignore', 'warn', 'raise'}) –

    In case of errors

    • 'ignore': silently ignore

    • 'warn': emit a warning

    • 'raise': raise an exception

Returns:

xarray.DataArray, xarray.Dataset