xoa.core.regrid.linear1d#
- xoa.core.regrid.linear1d(vari, yi, yo, axis=-1, extrap='no', drop_na=False, maxgap=0)[source]#
Linear interpolation of nD data along an axis with varying coordinates
The arrays are broadcasted against each other except along axis, like with numpy, so the coordinates may vary along the other axes, or not, without a copy. See
xoa.core.num.broadcast_along_axis(). The coordinates may increase or decrease, and their direction may change from a column to another, the extrapolations to the bottom and top referring to the smallest and largest values.- Parameters:
vari (array_like) – Input data
yi (array_like) – Input coordinates, monotonic along axis
yo (array_like) – Output coordinates, monotonic along axis
axis (int) – Working axis, which is kept in place, relative to the array of greatest number of dimensions
extrap ({"no", "bottom", "top", "both"}) – Extrapolation mode
drop_na (bool) – Interpolate across the inner NaNs of the input data
maxgap (int) – Maximal number of consecutive NaNs to interpolate across when drop_na is True, which is not checked when it is zero
- Returns:
numpy.ndarray – Output data with the broadcasted shape of the arrays, and the size of yo along axis