Cleaned up Pedestal (#370)
Build on RHEL9 / build (push) Successful in 2m52s
Build on RHEL8 / build (push) Successful in 3m33s
Run tests using data on local RHEL8 / build (push) Successful in 4m31s
Build on local RHEL8 / build (push) Successful in 3m4s

- renamed pedestal.hpp to bind_Pedestal.hpp for python bindings
- variance is now always calculated in double and made private
- cost correctness in a few places
- removed push_fast and explicit updates of mean from Pedestal. If
performance is needed use FastPedestal
- Pedestal no longer caches std
This commit is contained in:
Erik Fröjdh authored and GitHub committed 2026-09-14 16:27:53 +02:00
1 parent b0875106e3
commit 8551281eb7
18 files changed
+670 -350

No files matched your search

+14
View File
@@ -143,3 +143,17 @@ def test_fast_pedestal_rejects_wrong_shape():
with pytest.raises(RuntimeError, match="shape"):
pedestal.add_init_frame(np.zeros((2, 2), dtype=np.uint16))
@pytest.mark.parametrize("dtype", [np.float64, np.float32, np.int16])
def test_fast_pedestal_std_uses_double_variance(dtype):
pedestal = FastPedestal(1, 1, n_samples=2, dtype=dtype)
pedestal.add_init_frame(np.array([[0]], dtype=np.uint16))
pedestal.add_init_frame(np.array([[1000]], dtype=np.uint16))
assert pedestal.std().dtype == dtype
np.testing.assert_array_equal(pedestal.std(), [[500]])
pedestal.push_ema(np.array([[1000]], dtype=np.uint16))
expected = np.array([[np.sqrt(187500.0)]], dtype=dtype)
np.testing.assert_array_equal(pedestal.std(), expected)