uxarray.UxDataArray.remap.to_rectilinear

uxarray.UxDataArray.remap.to_rectilinear#

UxDataArray.remap.to_rectilinear(lon, lat, backend='uxarray', yac_method=None, yac_options=None, **kwargs)#

Remap onto a rectilinear longitude/latitude grid.

This convenience method targets 1-D longitude and latitude coordinate arrays and returns a plain xarray object with lat and lon axes, making the output suitable for downstream structured-grid workflows.

Parameters:
  • lon (array-like or xarray.DataArray) – 1-D target longitude cell-center coordinate in degrees.

  • lat (array-like or xarray.DataArray) – 1-D target latitude cell-center coordinate in degrees.

  • backend ({'uxarray', 'yac'}, default='uxarray') – Remapping backend to use. The UXarray backend builds a temporary structured destination grid and applies native nearest-neighbor remapping before reshaping the result to latitude/longitude axes. The YAC backend uses YAC’s rectilinear grid support directly and can be faster for large targets when YAC is installed.

  • yac_method ({'nnn', 'average', 'conservative'}, optional) – YAC interpolation method. When backend='yac', defaults to 'nnn' because nearest-neighbor works for node-, edge-, and face-centered source data. 'conservative' requires face-centered source data.

  • yac_options (dict, optional) – YAC interpolation configuration options forwarded to the selected YAC method.

Returns:

Remapped data with the source spatial dimension replaced by the provided latitude and longitude dimensions.

Return type:

xarray.DataArray or xarray.Dataset