pydda.cost_functions.calculate_mass_continuity_gradient#

pydda.cost_functions.calculate_mass_continuity_gradient(u, v, w, z, dx, dy, dz, coeff=1500.0, anel=1, upper_bc=True)[source]#

Calculates the gradient of mass continuity cost function. This is done by taking the negative gradient of the divergence of the wind field. All grids must have the same grid specification. :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

  • z (Float array (1D)) – 1D Float array with heights of grid

  • dx (float) – Grid spacing in x direction.

  • dy (float) – Grid spacing in y direction.

  • dz (float) – Grid spacing in z direction.

  • coeff (float) – Constant controlling contribution of mass continuity to cost function

  • anel (int) – = 1 use anelastic approximation, 0=don’t

Returns:

y (float array) – value of gradient of mass continuity cost function