daplis_rtp.gui.widgets.peak_stats module
What the peak in view is doing, in numbers.
Aligning a setup means maximising something, and until now the only figure on screen was which pixel was brightest. That tells you a peak moved but not whether it got better: a peak that doubles in height while doubling in width has gained nothing, and one that shifts by half a pixel is invisible against the sample spacing.
So four numbers, over the x-limits currently shown - which is what makes them useful, since narrowing the limits onto the signal is how you stop a hot pixel elsewhere on the sensor dominating the answer:
the brightest pixel and its rate - where the peak is,
the centroid - where it is to better than a pixel,
the FWHM - how tight it is,
the sum over the view - how much light is getting through at all.
The arithmetic is a plain function so that it can be tested without a window; the group box below only displays what it returns.
- class daplis_rtp.gui.widgets.peak_stats.PeakStatsPanel(parent=None)[source]
Bases:
QGroupBoxThe four figures, in the control column.
Checkable, like the other two status boxes, and for the same reason: the tick is a row of the column saved over a check box of its own. Cleared, it stops the host asking for the arithmetic at all.
- property enabled
- daplis_rtp.gui.widgets.peak_stats.peak_stats(rates, x_lim=None)[source]
Describe the peak in
ratesbetween the given x-limits.- Parameters:
rates (array-like) – Photon rate per pixel, indexed by pixel number.
x_lim (tuple, optional) –
(low, high)pixel numbers, inclusive, as shown on the plot. The whole array when omitted.
- Returns:
Nonewhen the window holds nothing to describe - no pixels, or every one of them at zero. Otherwisepeak_pixel,peak_rate,centroid,fwhmandtotal, any of which except the first two may beNonewhere the window does not support the figure.- Return type:
dict or None