xoa.interp.isoslice#
- xoa.interp.isoslice(da, values, isoval, dim, reverse=False, dask='parallelized', **kwargs)[source]#
Extract a slice of
dawherevaluesequalsisovalInterpolates
daalongdimat the position wherevaluescrossesisoval.- Parameters:
da (xarray.DataArray) – Array from which the data are extracted.
values (xarray.DataArray) – Array in which
isovalis searched for.isoval (float, xarray.DataArray) – Target value to locate in
values.dim (str) – Dimension shared by
daandvaluesalong which the slice is performed.reverse (bool) – If True, search from the end of the
dimaxis instead of from the beginning.dask (str) – Unused, kept for compatibility.
kwargs (dict) – Unused, kept for compatibility.
- Returns:
xarray.DataArray – Sliced array with
dimremoved.
Example
Extract depth at a given temperature and temperature at a given depth:
dep_at_t20 = isoslice(dep, temp, 20, "z") # depth at temperature=20 temp_at_z15 = isoslice(temp, dep, -15, "z") # temperature at depth=-15m