def test_get_dynamic_background_frequency(self, dummy_signal, std, answer): p = dummy_signal.inav[0, 0].data.astype(answer.dtype) bg = get_dynamic_background(pattern=p, filter_domain="frequency", std=std) assert np.allclose(bg, answer, atol=1e-4)
def test_get_dynamic_background_pattern_spatial( self, dummy_signal, std, truncate, answer ): p = dummy_signal.inav[0, 0].data bg = get_dynamic_background( pattern=p, filter_domain="spatial", std=std, truncate=truncate ) assert np.allclose(bg, answer)
def test_get_dynamic_background_raises(self, dummy_signal): p = dummy_signal.inav[0, 0].data filter_domain = "emon" with pytest.raises(ValueError, match=f"{filter_domain} must be either"): _ = get_dynamic_background(pattern=p, filter_domain=filter_domain)