geodata.cutout.Cutout.mask
==========================

.. py:method:: geodata.cutout.Cutout.mask(dataset: xarray.Dataset, true_area: bool = True, merged_mask: bool = True, shape_mask: bool = True)

   Mask a converted `xarray.Dataset` from cutout with previously added mask attribute
   with optional area inclusion, and return a dictionary of xarray Dataset.

   The program will search for 'merged_mask' and 'shape_mask' attributes in the
   cutout object, these Xarray data can be generate through 'add_mask', unless the user
   specify 'merged_mask = False' or 'shape_mask = False', the masks in shape_mask
   will have the same key in the dictionary returned, and the mask for merged_mask will
   have the key name "merged_mask".

   :param dataset: The dataset to be masked.
   :type dataset: xr.Dataset
   :param true_area: Whether the returned masks will have the area variable. Defaults to True.
   :type true_area: bool
   :param merged_mask: If true, the program will try to
                       include the merged_mask from the cutout object. Defaults to True.
   :type merged_mask: bool
   :param shape_mask: If true, the program will try to
                      include the extracted dictionary of shape_mask from the cutout object. Defaults to True.
   :type shape_mask: bool

   :returns: A dictionary of xarray Dataset with masks combined with the dataset.
   :rtype: dict[xr.Dataset]

