xoa.regrid.isoslice

xoa.regrid.isoslice(da, values, isoval, dim, reverse=False, dask='parallelized', **kwargs)[source]

Extract data from var where values==isoval

Parameters:
  • da (xarray.DataArray) – array from which the data are extracted

  • values (array_like) – array on which a research of isoval is made

  • isoval (float) – value of interest on which we perform research in values array

  • dim (str) – dimension shared by da and values on which the slice is made

  • dask (str) – See xarray.apply_ufunc().

Returns:

isovar (array_like) – Sliced array based on data where values==isoval

Example

Let’s define depth and temperature variables both in 3 dimensions (i,j,k) where i and j are horizontal dimension and k the vertical one:

dep_at_t20 = isoslice(dep, temp, 20, "z")   # depth at temperature=20°C
temp_at_z15 = isoslice(temp, dep, -15, "z") # temperature at depth=-15m

See also

xoa.interp.isoslice, xarray.apply_ufunc