pydda.cost_functions.calculate_mass_continuity#

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

Calculates the mass continuity cost function by taking the divergence 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

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

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

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

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

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

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

Returns:

J (float) – value of mass continuity cost function