xoa.meta.MetaSpecs.get

Contents

xoa.meta.MetaSpecs.get#

MetaSpecs.get(obj, meta_name, get='obj', within=None, errors='ignore')[source]#

A shortcut to search() with an explicit generic meta name or a list of them

Parameters:
  • obj (xarray.DataArray, xarray.Dataset) – Array or dataset to scan

  • meta_name (str, list(str)) – Generic meta name to search for. When a list, loop over possible meta_names and stop at the first found.

  • get ({"obj", "name"}) – “Getthe object or its meta_name.

  • within (str, None) – Object types to search within: “coords”, “data_vars”. Data vars are searched only with “data_vars” and coordinates are both in “coords” and “data_vars”.

  • errors ({'ignore', 'warn', 'raise'}) –

    In case of errors

    • 'ignore': silently ignore

    • 'warn': emit a warning

    • 'raise': raise an exception

A single element is searched for into all categories and errors are ignored.