NEDAS.utils.spatial_operation module
- NEDAS.utils.spatial_operation.gradx(fld, dx, cyclic_dim=None)
Gradient of input field in x direction
- Parameters:
fld (np.ndarray) – input field, last two dimensions (ny, nx)
dx (int) – grid spacing in x, fld.shape
cyclic_dim (str, optional) – string ‘x’, ‘y’, ‘xy’, indicating the dimension(s) that are cyclic.
- Returns:
gradx of fld with same shape
- Return type:
np.ndarray
- NEDAS.utils.spatial_operation.grady(fld, dy, cyclic_dim=None)
gradient of input fld in y direction, similar to gradx
- NEDAS.utils.spatial_operation.gradx2(fld, dx, cyclic_dim=None)
- NEDAS.utils.spatial_operation.grady2(fld, dy, cyclic_dim=None)
- NEDAS.utils.spatial_operation.gradxy(fld, dx, dy, cyclic_dim=None)
- NEDAS.utils.spatial_operation.laplacian(fld, dx, dy, cyclic_dim=None)
- NEDAS.utils.spatial_operation.coarsen(grid, fld, nlevel)[source]
Coarsen the image by downsampling the grid points by factors of 1/2,
- NEDAS.utils.spatial_operation.refine(grid, mask, fld, nlevel)[source]
Refine the image by upsampling the grid points by factors of 2,
- NEDAS.utils.spatial_operation.warp(grid, fld, u, v)[source]
Warp the image with input vector field
- Parameters:
grid (Grid) – the grid on which the image is defined
fld (np.ndarray) – input image
u (np.ndarray) – displacement vector x component, in
grid.xunitsv (np.ndarray) – displacement vector y component, in
grid.yunits
- Returns:
the warped image
- Return type:
np.ndarray