geodata.cutout.coarsen

geodata.cutout.coarsen#

geodata.cutout.coarsen(ori: xarray.Dataset, tar: xarray.Dataset, func: Literal['sum', 'mean'] = 'mean')#

This function will reindex the original xarray dataset according to the coordiantes of the target. There might be a bias for lattitudes and longitudes. The bias are normally within 0.01 degrees. In order to not lose too much data, a threshold for bias in degree could be given. When threshold = 0, it means that the function is going to find the best place with smallest bias.

Parameters:
  • ori (xr.Dataset) – The original xarray dataset.

  • tar (xr.Dataset) – The target xarray dataset.

  • func (Literal['sum', 'mean']) – The function to be used for reduction. Defaults to “mean”.

Returns:

The reindexed xarray dataset.

Return type:

xr.Dataset

Raises:

ValueError – reduction method can only be ‘mean’ or ‘sum’.