xoa.cf.CFCoordSpecs.search
- CFCoordSpecs.search(obj, cf_name=None, loc=None, get='obj', single=True, errors='raise')
Search for a data_var or coord that maches given or any specs
- Parameters:
obj (DataArray or Dataset) –
cf_name (str, dict) – A generic CF name. If not provided, all CF names are scaned.
loc (str, {"any", None}, {"", False}) –
str: one of these locations
None or “any”: any
False or ‘””: no location
get ({"obj", "cf_name", "both"}) – When found, get the object found or its name.
single (bool) – If True, return the first item found or None. If False, return a possible empty list of found items. A warning is emitted when set to True and multiple item are found.
errors ({'ignore', 'warn', 'raise'}) –
In case of errors
'ignore'
: silently ignore'warn'
: emit a warning'raise'
: raise an exception
- Returns:
None or str or object