Resample an array with ``steps - 1`` points between original point pairs. Along each column of *a*, ``(steps - 1)`` points are introduced between each original values; the values are linearly interpolated. Parameters ---------- a : array, shape (n, ...) steps : int
(a, steps)
| 947 | |
| 948 | |
| 949 | def simple_linear_interpolation(a, steps): |
| 950 | """ |
| 951 | Resample an array with ``steps - 1`` points between original point pairs. |
| 952 | |
| 953 | Along each column of *a*, ``(steps - 1)`` points are introduced between |
| 954 | each original values; the values are linearly interpolated. |
| 955 | |
| 956 | Parameters |
| 957 | ---------- |
| 958 | a : array, shape (n, ...) |
| 959 | steps : int |
| 960 | |
| 961 | Returns |
| 962 | ------- |
| 963 | array |
| 964 | shape ``((n - 1) * steps + 1, ...)`` |
| 965 | """ |
| 966 | fps = a.reshape((len(a), -1)) |
| 967 | xp = np.arange(len(a)) * steps |
| 968 | x = np.arange((len(a) - 1) * steps + 1) |
| 969 | return (np.column_stack([np.interp(x, xp, fp) for fp in fps.T]) |
| 970 | .reshape((len(x),) + a.shape[1:])) |
| 971 | |
| 972 | |
| 973 | def delete_masked_points(*args): |
no outgoing calls
no test coverage detected
searching dependent graphs…