xoa.cf.CFSpecs.get_loc_mapping
- CFSpecs.get_loc_mapping(obj, cf_names=None, loc=None, categories=['coords', 'data_vars'])[source]
Associate a location to each identified variables, coordinates and dimensions of obj
- Parameters:
obj (xarray.DataArray, xarray.Dataset) –
cf_names (dict, None) – Dict with names as keys and generic CF names as values. If not provided,
match()
is used to guess CF names.
- Returns:
dict – Keys are item names and values are location. This dict is also stored in the cf_locs key of the encoding attribute of obj.