pydda.cost_functions.calculate_model_gradient#

pydda.cost_functions.calculate_model_gradient(u, v, w, weights, u_model, v_model, w_model, coeff=1.0)[source]#

Calculates the cost function for the model constraint. This is calculated simply as twice the differences between the model wind field and the analysis wind field for each u, v. Vertical velocities are not factored into this cost function as there is typically a high amount of uncertainty in model derived vertical velocities. Therefore, the gradient for all of the w’s will be 0. :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

  • weights (list of 3D float arrays) – Weights for each point to consider into cost function

  • u_model (list of 3D float arrays) – Zonal wind field from model

  • v_model (list of 3D float arrays) – Meridional wind field from model

  • w_model (list of 3D float arrays) – Vertical wind field from model

  • coeff (float) – Weight of background constraint to total cost function

Returns:

y (float array) – value of gradient of background cost function