polaris.cf.add_cf_conventions

polaris.cf.add_cf_conventions(ds: Dataset) → Dataset[source]

Add CF-<version> to the Conventions global attribute of a dataset that has no CF entry. Any other conventions already listed (MPAS from the MPAS-Tools mesh converter and cell culler) are kept, since the attribute lists every convention a file follows.

Parameters:

ds (xarray.Dataset) – A dataset about to be written

Returns:

ds (xarray.Dataset) – A shallow copy of the dataset with the Conventions attribute set, or the dataset itself if it already names a CF version