arctichoke.dataset.field_mean ============================= .. py:module:: arctichoke.dataset.field_mean Attributes ---------- .. autoapisummary:: arctichoke.dataset.field_mean.cdo arctichoke.dataset.field_mean.cdo Functions --------- .. autoapisummary:: arctichoke.dataset.field_mean.get_field_mean Module Contents --------------- .. py:data:: cdo .. py:data:: cdo .. py:function:: get_field_mean(dataset: (str, [str], xarray.DataArray, xarray.Dataset), save_as: str = None, **kwargs) Get the field mean of the dataset. Use the `cdo` function `fldmean` to take the field mean (the mean over the geographic area) of the given dataset. :param dataset: The dataset of which to take the field mean. :type dataset: `str`, list of `str`, `xarray.DataArray`, `xarray.Dataset` :param save_as: The file name to pass to `cdo.fldmean(output=save_as)`. Default is `None`, which doesn't save the dataset to a file. :type save_as: `str`, `None`, optional :param \*\*kwargs: Keyword arguments to pass to `cdo.fldmean()`. :returns: **fldmean_xr** -- A dataset of the field mean of the input data. :rtype: `xarray.Dataset` .. rubric:: Examples >>> from arctichoke.dataset.field_mean import get_field_mean >>> fldmean_xr = get_field_mean('data/NWP_cdo_CLI_areacello_Ofx_EC-Earth3P-HR_highres-future_r2i1p2f1_gn.nc') >>> fldmean_xr['areacello'].values[0] (get_field_mean) `save_as`: None array([1.3731426e+08], dtype=float32)