wakatools.base.DataArrayAccessor.grid_coordinates_scaled#

DataArrayAccessor.grid_coordinates_scaled(bbox: tuple = None) ndarray[source]#

Get an array of all grid coordinates in the DataArray in the shape (N, 2), scaled to between 0 and 1 based on the bounding box of the grid (xmin, ymin, xmax, ymax) or on a specified bounding box.

Parameters:

bbox (tuple, optional) – A tuple specifying the bounding box (xmin, ymin, xmax, ymax) to use for scaling. If None, the bounding box of the DataArray is used. The default is None.

Returns:

An array of shape (N, 2) containing all scaled grid coordinates.

Return type:

np.ndarray