xarray.Dataset.argo.filter_data_mode

xarray.Dataset.argo.filter_data_mode

Dataset.argo.filter_data_mode(keep_error: bool = True, errors: str = 'raise')

Filter variables according to their data mode

This filter applies to <PARAM> and <PARAM_QC>

For data mode ‘R’ and ‘A’: keep <PARAM> (eg: ‘PRES’, ‘TEMP’ and ‘PSAL’)

For data mode ‘D’: keep <PARAM_ADJUSTED> (eg: ‘PRES_ADJUSTED’, ‘TEMP_ADJUSTED’ and ‘PSAL_ADJUSTED’)

Since ADJUSTED variables are not required anymore after the filter, all ADJUSTED variables are dropped in order to avoid confusion wrt variable content. DATA_MODE is preserved for the record.

Parameters
  • keep_error (bool, optional) – If true (default) keep the measurements error fields or not.

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

Return type

xarray.Dataset