pydda.cost_functions.grad_J

pydda.cost_functions.grad_J(winds, parameters)[source]

Calculates the gradient of the cost function. This typically does not need to be called directly as get_dd_wind_field is a wrapper around this function and pydda.cost_functions.J_function(). In order to add more terms to the cost function, modify this function and pydda.cost_functions.grad_J().

Parameters
winds: 1-D float array

The wind field, flattened to 1-D for f_min

parameters: DDParameters

The parameters for the cost function evaluation as specified by the pydda.retrieve.DDParameters() class.

Returns
grad: 1D float array

Gradient vector of cost function