def test_spectrum_bin_preserve_power_false(): s = Spectrum([1, 2, 3, 4, 5], [2, 2, 2, 2, 2]) assert np.array_equal(s.bin([2, 3], preserve_power=False), [1, 3])
def test_spectrum_bin_preserve_power_true(): s = Spectrum([1, 2, 3, 4, 5], [2, 2, 2, 2, 2]) assert np.array_equal(s.bin([2, 3]), [0.5, 1.5])