xarray.Dataset.argo.datamode.filter

xarray.Dataset.argo.datamode.filter#

Dataset.argo.datamode.filter(dm: str | List[str] = ['R', 'A', 'D'], params: str | List[str] = 'all', logical: str = 'and', mask: bool = False, errors: str = 'raise')#

Filter measurements according to parameters data mode

Filter the dataset to keep points where all or some of the parameters are in any of the data mode specified.

This method can return the filtered dataset or the filter mask.

Parameters:
  • dm (str, List[str], optional, default=[R, A, D]) – List of data mode values (string) to keep

  • params (str, List[str], optional, default='all') – List of parameters to apply the filter to. By default, we use all parameters for which a data mode can be found

  • logical (str, optional, default='and') – Reduce parameter filters with a logical and or or. With and the filter shall be True if all parameters match the data mode requested, while with or it will be True for at least one parameter.

  • mask (bool, optional, default=False) – Determine if we should return the filter mask or the filtered dataset

  • errors (str, optional, default='raise') – If raise, raises a argopy.errors.InvalidDatasetStructure error if any of the expected variables is not found. If ignore, fails silently and return unmodified dataset.

Return type:

xarray.Dataset

Notes

  • Method compatible with core, deep and BGC datasets

  • Can be applied after merge()

See also

merge()