xoa.grid.get_fingerprint

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:
Returns:

str

Example

fingerprint = xoa.grid.get_fingerprint(ds)
xoa.weights.find_groups("weights.nc", fingerprint)