pydda.cost_functions.calculate_smoothness_gradient#
- pydda.cost_functions.calculate_smoothness_gradient(u, v, w, dx, dy, dz, Cx=1e-05, Cy=1e-05, Cz=1e-05, upper_bc=1, upper_bc_mask=None)[source]#
Calculates the gradient of the smoothness cost function by taking the Laplacian of the Laplacian of the wind field. All arrays in the given lists must have the same dimensions and represent the same spatial coordinates. :Parameters: * u (Float array) – Float array with u component of wind field
v (Float array) – Float array with v component of wind field
w (Float array) – Float array with w component of wind field
Cx (float) – Constant controlling smoothness in x-direction
Cy (float) – Constant controlling smoothness in y-direction
Cz (float) – Constant controlling smoothness in z-direction
upper_bc (int) – Upper boundary (impermeability) condition. 0 disables it, 1 enforces w = 0 at the top of the domain, and 2 enforces w = 0 above the echo top as given by upper_bc_mask. The legacy booleans True and False are equivalent to 1 and 0.
upper_bc_mask (3D bool array or None) – The grid points at which w is held fixed when upper_bc is 2, as returned by
pydda.cost_functions.calculate_echo_top_mask().
- Returns:
y (float array) – value of gradient of smoothness cost function