def test_apply_user_filt(self): '''Test apply user filts.''' def user_fun(scanset): return scanset['barytime'] - np.floor(scanset['barytime']) scanset = ScanSet('test.hdf5') scanset.barycenter_times() phase_in_sec = scanset.apply_user_filter(user_fun, 'Phase_in_sec') assert np.min(phase_in_sec) >= 0 assert np.max(phase_in_sec) <= 1 assert np.all(phase_in_sec == scanset['Phase_in_sec'])
def test_apply_bad_user_filt(self): scanset = ScanSet('test.hdf5') with pytest.raises(ValueError): scanset.apply_user_filter()