geocat.comp.gc_util._find_var#
- geocat.comp.gc_util._find_var(ds, standard_name=None, long_name=None, possible_names=None, description='variable')#
Find a variable using CF-compliant checks.
Searches in priority order: 1. CF standard_name attribute match (if standard_names provided) 2. Name attribute match (if long_names provided) 3. Direct variable name match (if possible_names provided)
- Parameters:
ds (
xr.Datasetorux.UxDataset) – The dataset to searchstandard_name (
str, optional) – CF standard_name to check in attrslong_name (
str, optional) – long_name to check in attrspossible_names (
listofstr, optional) – List of possible variable names to check firstdescription (
str, optional) – String for descriptive Error message
- Returns:
str– The name of the found variable- Raises:
KeyError – If no matching variable is found