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