daplis_rtp.gui.widgets.pixel_mask module

The per-pixel mask, in a window of its own.

The mask is 256 check boxes per board. Kept inside the tab they need a scroll area about 250 px tall, which is both too small to work in - a few rows of pixels visible at a time, out of 64 - and large enough to set the minimum height of the whole application, since a control column’s minimum is the sum of everything stacked in it.

So they live here instead. The tab keeps a button and a count, and the boxes open in a window that can be dragged next to the plot and left there: it is not modal, so the stream keeps running and the plot keeps refreshing while pixels are ticked off, which is the way masking is actually done - look at the peak, mask it, watch what is left.

The check boxes are created here but belong to the host tab, which reads them through boxes: boxes[b][i] is the box for pixel i of board b, whatever order the grid is laid out in, and that is what the preset-mask and reset paths walk. grids exposes the layouts themselves, for anything that needs to reach a cell by position.

class daplis_rtp.gui.widgets.pixel_mask.PixelMaskWindow(parent=None, boards=(('', 4, 64),), title='Pixel mask', n_pixels=256)[source]

Bases: QDialog

Non-modal window holding one grid of check boxes per board.

Parameters:
  • parent (QWidget) – The host tab. The window is a top-level one all the same, so it can be moved away from the application and left beside it.

  • boards (sequence) – One (label, columns, rows) per board; columns * rows must come to n_pixels. The grid is filled across, so the first row is pixels 0 to columns - 1.

  • title (str, optional) – Window title.

  • n_pixels (int, optional) – Pixels per board, by default 256.

__init__(parent=None, boards=(('', 4, 64),), title='Pixel mask', n_pixels=256)[source]
changed

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

clear_requested

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

masked_counts()[source]

Masked pixels per board, for the host’s summary label.

open_beside()[source]

Show the window, raising it if it is already open.

refresh_counts()[source]

Update the ‘n masked’ line under each board’s grid.

set_all(masked=False)[source]

Tick or untick every box on every board, with one changed.

set_pixels(board, pixels, masked=True)[source]

Tick or untick many boxes at once, with one changed.

The preset mask ticks a couple of hundred boxes in a row, and each one emitting for itself would be a couple of hundred redraws of the plot - which is what masking now triggers, since a tick is meant to take effect on the trace immediately rather than at the next data file.

daplis_rtp.gui.widgets.pixel_mask.mask_summary(counts)[source]

‘18 masked’, or ‘b1: 18, b2: 0’ for two boards.

daplis_rtp.gui.widgets.pixel_mask.masked_array(boxes, n_pixels=256)[source]

1 where the pixel is not masked, as the tabs’ mask arrays are.