Skip to content

Commit 20a844c

Browse files
committed
Improve vet docstrings
1 parent 21bc18b commit 20a844c

File tree

1 file changed

+21
-16
lines changed

1 file changed

+21
-16
lines changed

pysteps/motion/vet.py

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -337,25 +337,30 @@ def vet(input_images,
337337
338338
This algorithm computes the displacement field between two images
339339
( the input_image with respect to the template image).
340-
The displacement is sought by minimizing sum of the residuals of the
340+
The displacement is sought by minimizing the sum of the residuals of the
341341
squared differences of the images pixels and the contribution of a
342-
smoothness constrain.
342+
smoothness constraint.
343+
In the case that a MaskedArray is used as input, the residuals term in
344+
the cost function is only computed over areas with non-masked values.
345+
Otherwise, it is computed over the entire domain.
343346
344-
In order to find the minimum an scaling guess procedure is applied,
345-
from larger scales
346-
to a finer scale. This reduces the changes that the minimization procedure
347-
converges to a local minimum. The scaling guess is defined by the scaling
348-
sectors (see **sectors** keyword).
347+
To find the minimum, a scaling guess procedure is applied,
348+
from larger to smaller scales.
349+
This reduces the chances that the minimization procedure
350+
converges to a local minimum.
351+
The first scaling guess is defined by the scaling sectors keyword.
349352
350353
The smoothness of the returned displacement field is controlled by the
351-
smoothness constrain gain (**smooth_gain** keyword).
354+
smoothness constraint gain (**smooth_gain** keyword).
352355
353-
If a first guess is not given, zero displacements are used as first guess.
356+
If a first guess is not given, zero displacements are used as the first
357+
guess.
354358
355-
To minimize the cost function, the `scipy minimization`_ function is used
356-
with the 'CG' method. This method proved to give the best results under
357-
any different conditions and is the most similar one to the original VET
358-
implementation in `Laroche and Zawadzki (1995)`_.
359+
The cost function is minimized using the `scipy minimization`_ function,
360+
with the 'CG' method by default.
361+
This method proved to give the best results under many different conditions
362+
and is the most similar one to the original VET implementation in
363+
`Laroche and Zawadzki (1995)`_.
359364
360365
361366
The method CG uses a nonlinear conjugate gradient algorithm by Polak and
@@ -385,10 +390,10 @@ def vet(input_images,
385390
The expected dimensions are (2,ni,nj).
386391
387392
sectors : list or array, optional
388-
The number of sectors for each dimension used in the scaling procedure.
393+
Number of sectors on each dimension used in the scaling procedure.
389394
If dimension is 1, the same sectors will be used both image dimensions
390-
(x and y). If is 2D, the each row determines the sectors of the
391-
each dimension.
395+
(x and y). If **sectors** is a 1D array, the same number of sectors
396+
is used in both dimensions.
392397
393398
smooth_gain : float, optional
394399
Smooth gain factor

0 commit comments

Comments
 (0)