def test_no_precipitation(optflow_method_name, num_times):
    """
    Test that the motion methods work well with a zero precipitation in the
    domain.

    The expected result is a zero motion vector.

    Parameters
    ----------

    optflow_method_name: str
        Optical flow method name

    num_times : int
        Number of precipitation frames (times) used as input for the optical
        flow methods.
    """
    if optflow_method_name == "lk":
        pytest.importorskip("cv2")
    zero_precip = np.zeros((num_times,) + reference_field.shape)
    motion_method = motion.get_method(optflow_method_name)
    uv_motion = motion_method(zero_precip, verbose=False)

    assert np.abs(uv_motion).max() < 0.01
Test that the motion methods work well with a zero precipitation in the
domain.

The expected result is a zero motion vector.

Parameters
----------

optflow_method_name: str
Optical flow method name

num_times : int
Number of precipitation frames (times) used as input for the optical
flow methods.
pysteps/tests/test_motion.py