- pysteps.motion.vet.vet_cost_function(sector_displacement_1d, input_images, blocks_shape, mask, smooth_gain, debug=False, gradient=False)#
Variational Echo Tracking Cost Function.
This function is designed to be used with the scipy minimization. The function first argument is the variable to be used in the minimization procedure.
The sector displacement must be a flat array compatible with the dimensions of the input image and sectors shape (see parameters section below for more details).
sector_displacement_1d (ndarray) – Array of displacements to apply to each sector. The dimensions are: sector_displacement_2d [ x (0) or y (1) displacement, i index of sector, j index of sector ]. The shape of the sector displacements must be compatible with the input image and the block shape. The shape should be (2, mx, my) where mx and my are the numbers of sectors in the x and the y dimension.
input_images (ndarray) –
Input images, sequence of 2D arrays, or 3D arrays. The first dimension represents the images time dimension.
The template_image (first element in first dimensions) denotes the reference image used to obtain the displacement (2D array). The second is the target image.
The expected dimensions are (2,nx,ny). Be aware the the 2D images dimensions correspond to (lon,lat) or (x,y).
blocks_shape (ndarray (ndim=2)) – Number of sectors in each dimension (x and y). blocks_shape.shape = (mx,my)
mask (ndarray (ndim=2)) – Data mask. If is True, the data is marked as not valid and is not used in the computations.
smooth_gain (float) – Smoothness constrain gain
debug (bool, optional) – If True, print debugging information.
gradient (bool, optional) – If True, the gradient of the morphing function is returned.
penalty or gradient values.
penalty (float) – Value of the cost function
gradient_values (ndarray (float64 ,ndim = 3), optional) – If gradient keyword is True, the gradient of the function is also returned.