xoa.grid.get_fingerprint#
- xoa.grid.get_fingerprint(obj, mask=None)[source]#
Get the fingerprint of a horizontal grid
The fingerprint depends on the longitudes, latitudes and mask of the grid, whatever their dimensions are. Equal grids have the same fingerprint, so it is the way to recognise a grid, for instance in a weights file, where the weights of a regridding or an interpolation are stored in a group that is named after the fingerprints of the grids. See
xoa.weights.- Parameters:
obj (xarray.DataArray, xarray.Dataset, dict) – Object with longitude and latitude coordinates, that may be 1D or 2D, or a grid dictionary like the one of
ds2grid_dict()mask (str, xarray.DataArray, array_like, None) – Valid points of the grid, which is ignored for a dictionary
- Returns:
str
Example
fingerprint = xoa.grid.get_fingerprint(ds) xoa.weights.find_groups("weights.nc", fingerprint)