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

+2 -2
View File
@@ -22,7 +22,7 @@ def FastPedestal(rows, cols, n_samples=1000, dtype=np.float64):
cols: Number of image columns.
n_samples: Initialization frame count and steady-state update-weight
denominator.
dtype: Output dtype for the mean, variance, and standard deviation.
dtype: Output dtype for the mean and standard deviation.
Supported values are ``np.float64``, ``np.float32``, and
``np.int16``.
"""
@@ -41,7 +41,7 @@ def from_file(filename, n_samples=1000, skip_first=0, dtype=np.float64):
filename: Input image file.
n_samples: Number of frames used for initialization.
skip_first: Number of leading frames to ignore.
dtype: Output dtype for the mean, variance, and standard deviation.
dtype: Output dtype for the mean and standard deviation.
Raises:
RuntimeError: If fewer than ``n_samples`` frames remain after
+26
View File
@@ -0,0 +1,26 @@
# SPDX-License-Identifier: MPL-2.0
import numpy as np
from .factory import _get_typed_class
def Pedestal(rows, cols, n_samples=1000, dtype=np.float64):
"""Create an empty per-pixel running pedestal.
This factory hides the dtype suffix used by the templated C++ bindings.
Call ``push()`` to update the statistics and cached mean for each frame.
Statistics are available during initialization and are zero for empty pixels.
Internal moments and variance always use double precision.
Args:
rows: Number of image rows.
cols: Number of image columns.
n_samples: Number of samples accumulated before switching to
steady-state updates with weight ``1 / n_samples``.
dtype: Output dtype for the mean and standard deviation.
Supported values are ``np.float64``, ``np.float32``, and
``np.int16``.
"""
cls = _get_typed_class("Pedestal", dtype)
return cls(rows, cols, n_samples)
+1
View File
@@ -33,6 +33,7 @@ from ._aare import UDPPortPosition
from ._version import __version__
from .FastPedestal import FastPedestal
from .Pedestal import Pedestal
from .ClusterFinder import ClusterFinder, ClusterCollector, ClusterFinderMT, ClusterFileSink, ClusterFile
from .ClusterVector import ClusterVector
from .Cluster import Cluster