daplis_rtp.gui.tdc_occupancy_panel module
Status box: how close the readout is to filling its TDC memory.
Each TDC holds ‘Timestamps’ slots per acquisition cycle, shared by its four pixels. Once they are full the rest of the cycle is thrown away, and the data file gives no sign of it - it is exactly the size it would have been. This box puts that on screen while the stream runs, so the setting can be chosen to fit the measurement instead of guessed, and so that a long run cannot truncate unnoticed.
Two rows are shown, and both are needed:
‘Signal’ - the busiest TDC among the pixels being measured. This is the one that says whether this measurement is affected.
‘Sensor’ - the busiest TDC anywhere on the half. This is usually a hot pixel nobody is looking at, but it says whether the board is near the edge at all.
The pixels being measured are taken, by default, from what the tab already knows: every pixel that is not masked and lies inside the current x-limits. A TDC counts as “of interest” when it holds at least one such pixel, and all of that TDC’s traffic is counted - including that of a hot pixel sharing it, which is exactly the case that eats the memory the signal needs. Where the mask is not the whole story, the pixels can be typed in instead.
‘Both boards in step’ is the model for the LED colours and the once-per-run alert. Both tabs that have this box keep it in the same place - last panel of the control column, above the two buttons - so that what is read during a run is read in the same place on either.
That column’s minimum height is the sum of the panels stacked in it, and the tallest tab is what decides how tall the whole application opens, so the rows here are counted. Hence the tick in the group-box title rather than a check box of its own, and the heading sharing a row with the first radio button.
- class daplis_rtp.gui.tdc_occupancy_panel.BoardOccupancy(label, occupancy, tdcs)[source]
Bases:
objectOne board’s occupancy, ready for the panel to render.
‘tdcs’ holds the TDCs of interest - the ones carrying the pixels being measured - as read out by the board, so a caller using ‘pix_add_fix’ must have mapped its pixels through ‘tdc_occupancy.pixel_to_tdc_map’ with the same flag. Callers hand over one entry per pixel, four of which share a TDC, so the list is reduced to the TDCs themselves here.
- class daplis_rtp.gui.tdc_occupancy_panel.TdcOccupancyPanel(parent=None, font=None, n_pixels=256)[source]
Bases:
QGroupBoxThe status box, and the pixel selection that feeds it.
- LED_COLORS = {'bad': 'red', 'idle': 'grey', 'ok': 'limegreen', 'waiting': 'goldenrod', 'warn': 'orange'}
- property enabled
Whether the host should ask for the occupancy at all.
- explicit_pixels()[source]
The typed-in pixels, or None when the mask is to be used.
- Raises:
ValueError – If the text cannot be read as pixels; the caller decides whether to report it or to carry on with the mask.
- problem
str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Type:
pyqtSignal(*types, name
- show_result(boards)[source]
Render one refresh.
- Parameters:
boards (list of BoardOccupancy) – One entry per board plotted. The worst ‘Signal’ figure across the boards is the one shown, and likewise the worst ‘Sensor’ one - a full-sensor run is only as good as its worse half.
- daplis_rtp.gui.tdc_occupancy_panel.pixels_of_interest(explicit, mask_valid, x_lim, offset=0, n_pixels=256)[source]
Which of one board’s pixels are worth watching.
- Parameters:
explicit (ndarray or None) – Pixels typed in by hand, in the coordinates of the plot’s x-axis. None to fall back on the mask and the x-limits.
mask_valid (array-like) – The tab’s mask array for this board, one entry per pixel, nonzero where the pixel is not masked.
x_lim (tuple) – Current x-axis limits, in the coordinates of the plot.
offset (int, optional) – Where this board starts on that x-axis: 0 for a single board or for board 1 of the full-sensor tab, 256 for board 2.
n_pixels (int, optional) – Pixels on the board, by default 256.
- Returns:
Pixel indices local to the board, 0..n_pixels-1. Empty when the board lies wholly outside the x-limits, or when every pixel of it is masked.
- Return type:
ndarray