Example #1
0
 def test_remove_dynamic_background_pattern_raises(self, dummy_signal):
     p = dummy_signal.inav[0, 0].data
     filter_domain = "Taldorei"
     with pytest.raises(ValueError, match=f"{filter_domain} must be "):
         _ = remove_dynamic_background(
             pattern=p, filter_domain=filter_domain,
         )
Example #2
0
    def test_remove_dynamic_background_spatial(self, dummy_signal, std,
                                               operation, dtype_out, answer):
        p = dummy_signal.inav[0, 0].data.astype(np.float32)

        p2 = remove_dynamic_background(
            pattern=p,
            operation=operation,
            filter_domain="spatial",
            std=std,
            dtype_out=dtype_out,  # np.dtype("uint8").type
        )

        assert np.allclose(p2, answer, atol=1e-4)
Example #3
0
    def test_remove_dynamic_background_frequency(self, dummy_signal, std,
                                                 truncate, answer):
        p = dummy_signal.inav[0, 0].data.astype(np.float32)

        p2 = remove_dynamic_background(
            pattern=p,
            operation="subtract",
            filter_domain="frequency",
            std=std,
            truncate=truncate,
            dtype_out=np.uint8,
        )

        assert np.allclose(p2, answer)