def test_generate_bps():
    """Tests generation BPS velocity perturbation method."""
    seed = 42
    timestep = 1
    pixelsperkm = 1
    v = np.ones((8, 8))
    velocity = np.stack([v, v])
    perturbator = initialize_bps(velocity, pixelsperkm, timestep, seed=seed)
    new_vv = generate_bps(perturbator, timestep)
    expected = np.stack([v * -0.066401, v * 0.050992])
    assert_array_almost_equal(new_vv, expected)
Tests generation BPS velocity perturbation method.
pysteps/tests/test_noise_motion.py