xoa.meta.MetaCoordSpecs.search#
- MetaCoordSpecs.search(obj, meta_name=None, loc=None, get='obj', single=True, within=None, errors='raise')#
Search for a data_var or coord that maches given or any specs
- Parameters:
obj (DataArray or Dataset)
meta_name (str, dict) – A generic Meta name. If not provided, all Meta names are scaned.
loc (str, {"any", None}, {"", False}) –
str: one of these locations
None or “any”: any
False or ‘””: no location
get ({"obj", "meta_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.
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
- Returns:
None or str or object