xoa.grid.get_lonlat_2d#
- xoa.grid.get_lonlat_2d(obj)[source]#
Get 2D longitudes and latitudes with (y, x) dimensions
1D longitudes and latitudes of a rectilinear grid are broadcasted against each other, and 2D ones of a curvilinear grid are returned as is. In both cases, the arrays are transposed to (y, x).
- Parameters:
obj (xarray.DataArray, xarray.Dataset) – Object with longitude and latitude coordinates, that may be 1D or 2D
- Returns:
xarray.DataArray – 2D longitudes with (y, x) dimensions
xarray.DataArray – 2D latitudes with (y, x) dimensions
- Raises:
xoa.exceptions.XoaError – When the broadcasted longitudes and latitudes are not 2D
See also