# Path: wradlib/qual.py
# def pulse_volume(ranges, h, theta):
# def beam_block_frac(th, bh, a):
# def cum_beam_block_frac(pbb):
# def get_bb_ratio(bb_height, bb_width, quality, zp_r):


import numpy as np
from wradlib import qual
        )
        ratio_out = np.array(
            [
                [[0.0, 0.5, 1.0, -3.5], [-1.5, 0.3, 0.7, 4.5]],
                [[0.0, 0.5, 1.0, -3.5], [-1.5, 0.3, 0.7, 4.5]],
                [[0.0, 0.5, 1.0, -3.5], [-1.5, 0.3, 0.7, 4.5]],
                [[0.0, 0.5, 1.0, -3.5], [-1.5, 0.3, 0.7, 4.5]],
            ]
        )
        index_out = np.array([[True, True], [True, True], [True, False], [False, True]])
        ratio, index = qual.get_bb_ratio(heights, widths, quality, z)
        np.testing.assert_array_equal(ratio, ratio_out)
        np.testing.assert_array_equal(index, index_out)

    def test_pulse_volume(self):
        vol_out = np.array(
            [
                0.00000000e00,
                2.39258109e06,
                9.57032436e06,
                2.15332298e07,
                3.82812974e07,
                5.98145272e07,
                8.61329192e07,
                1.17236473e08,
                1.53125190e08,
                1.93799068e08,
            ]
        )
        np.testing.assert_allclose(

# Path: wradlib/qual.py
# def pulse_volume(ranges, h, theta):
# def beam_block_frac(th, bh, a):
# def cum_beam_block_frac(pbb):
# def get_bb_ratio(bb_height, bb_width, quality, zp_r):


# Path: wradlib/tests/test_qual.py
import numpy as np
from wradlib import qual

        )
        ratio_out = np.array(
            [
                [[0.0, 0.5, 1.0, -3.5], [-1.5, 0.3, 0.7, 4.5]],
                [[0.0, 0.5, 1.0, -3.5], [-1.5, 0.3, 0.7, 4.5]],
                [[0.0, 0.5, 1.0, -3.5], [-1.5, 0.3, 0.7, 4.5]],
                [[0.0, 0.5, 1.0, -3.5], [-1.5, 0.3, 0.7, 4.5]],
            ]
        )
        index_out = np.array([[True, True], [True, True], [True, False], [False, True]])
        ratio, index = qual.get_bb_ratio(heights, widths, quality, z)
        np.testing.assert_array_equal(ratio, ratio_out)
        np.testing.assert_array_equal(index, index_out)

    def test_pulse_volume(self):
        vol_out = np.array(
            [
                0.00000000e00,
                2.39258109e06,
                9.57032436e06,
                2.15332298e07,
                3.82812974e07,
                5.98145272e07,
                8.61329192e07,
                1.17236473e08,
                1.53125190e08,
                1.93799068e08,
            ]
        )
        np.testing.assert_allclose(

            qual.pulse_volume(np.arange(0.0, 100000.0, 10000.0), 100.0, 1.0), vol_out