PixelHistogram (#317)
Build on RHEL9 / build (push) Successful in 2m31s
Build on RHEL8 / build (push) Successful in 3m6s
Run tests using data on local RHEL8 / build (push) Successful in 3m55s
Build on local RHEL8 / build (push) Successful in 2m42s

Multi threaded filling of per pixel histograms for example for detector calibration

1. PixelHistogram - Generic variant expects already pedestal subtracted
data
2. PedestalTrackingHistogram - Terrible name, useful class. Keeps it's
own pedestal and does conversion and pedestal tracking in the worker
threads.

---------

Co-authored-by: Lars Erik Fröjd <froejdh_e@pc-jungfrau-02.psi.ch>
This commit is contained in:
Erik Fröjdh
2026-06-09 09:08:48 +02:00
committed by GitHub
co-authored by Lars Erik Fröjd
parent 8e69b498e5
commit f670ba77a2
19 changed files with 2231 additions and 9 deletions
+9
View File
@@ -0,0 +1,9 @@
Histogram
=========
.. toctree::
:caption: Histogram
:maxdepth: 1
pyPixelHistogram
pyPedestalTrackingPixelHistogram
@@ -0,0 +1,24 @@
PedestalTrackingPixelHistogram
==============================
.. warning::
``PedestalTrackingPixelHistogram`` is specifically designed for use in the Jungfrau calibration
pipeline. Make sure you understand the behaviour before using it in other contexts.
``PedestalTrackingPixelHistogram`` accumulates a pixel-wise histogram of
``frame - pedestal`` residuals while maintaining a running per-pixel pedestal
estimate.
Use ``push_pedestal_no_update()`` to seed the pedestal estimate, then
``update_mean()`` before submitting frames with ``fill_async()``. Pending
asynchronous fills are drained by ``flush()``, and snapshot methods such as
``values()`` and ``pedestal_mean()`` return numpy arrays.
.. py:currentmodule:: aare
.. autoclass:: PedestalTrackingPixelHistogram
:members:
:undoc-members:
:show-inheritance:
:inherited-members:
@@ -0,0 +1,41 @@
PixelHistogram
==============
``PixelHistogram`` accumulates one histogram per detector pixel from 2D
``float64`` images. The public ``PixelHistogram`` name is an alias for
``PixelHistogram_d``, which stores bin counts as ``float64``.
.. note::
``PixelHistogram`` is designed for fast filling from 2D images, utilizing multiple threads,
and contiguous storage of a specific type. No over/underflow bins are provided. For generic use cases consider
boost-histogram. (https://boost-histogram.readthedocs.io/en/latest/)
Storage-specific variants are also available when a smaller or integer count
type is preferred:
* ``PixelHistogram_d``: ``float64`` storage
* ``PixelHistogram_f``: ``float32`` storage
* ``PixelHistogram_u64``: ``uint64`` storage
* ``PixelHistogram_u32``: ``uint32`` storage
* ``PixelHistogram_u16``: ``uint16`` storage
* ``PixelHistogram_u8``: ``uint8`` storage
.. py:currentmodule:: aare
.. autoclass:: PixelHistogram
:members:
:undoc-members:
:show-inheritance:
:inherited-members:
Showing API for PixelHistogram_d, all variant share the same API.
.. autoclass:: aare._aare.PixelHistogram_d
:members:
:undoc-members:
:show-inheritance:
:inherited-members:
:noindex: