geodata.cutout.coarsen
======================

.. py:function:: 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.

   :param ori: The original xarray dataset.
   :type ori: xr.Dataset
   :param tar: The target xarray dataset.
   :type tar: xr.Dataset
   :param func: The function to be used for reduction. Defaults to "mean".
   :type func: Literal['sum', 'mean']

   :returns: The reindexed xarray dataset.
   :rtype: xr.Dataset

   :raises ValueError: reduction method can only be 'mean' or 'sum'.

