xoa.cf.SGLocator.get_loc_from_da

SGLocator.get_loc_from_da(da, errors='warn')[source]

Parse a data array name and attributes to find a unique location

Parameters
  • da (xarray.DataArray) – Data array to scan

  • errors ({'ignore', 'warn', 'raise'}) –

    In case of errors

    • ignore: silently ignore

    • warn: emit a warning

    • raise: raise an exception

Returns

None, strNone if no location is found, else the corresponding string

Raises

XoaCFError – When locations parsed from name and attributes are conflicting. Thus, this method method is a way to check location consistency.