util
adjust_shape #
Pad or crop array such that its new dimensions are evenly divisible by a set of integers.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
array |
ndarray
|
Array that will be padded. |
required |
scale_factors |
Sequence of ints
|
The output array is guaranteed to have dimensions that are each evenly divisible by the corresponding scale factor, and chunks that are smaller than or equal to the scale factor (if the array has chunks) |
required |
Returns:
Type | Description |
---|---|
DataArray
|
|
Source code in src/xarray_multiscale/util.py
logn #
Compute the logarithm of x base n.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x |
float or int.
|
|
required |
n |
ArrayLike
|
|
required |
Returns:
Type | Description |
---|---|
float
|
np.log(x) / np.log(n) |