xoa.cf.CFCoordSpecs.search¶
- CFCoordSpecs.search(dsa, name=None, loc='any', get='obj', single=True, errors='raise')¶
Search for a data_var or coord that maches given or any specs
- Parameters
dsa (DataArray or Dataset) –
name (str, dict) – A 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", "name"}) – 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 ignorewarn: emit a warningraise: raise an exception
- Returns
None or str or object