8.5.5.1.8. pymodaq_gui.plotting.data_viewers.viewerND module

class pymodaq_gui.plotting.data_viewers.viewerND.BaseDataDisplayer(viewer0D: Viewer0D, viewer1D: Viewer1D, viewer2D: Viewer2D, navigator1D: Viewer1D, navigator2D: Viewer2D, axes_viewer: AxesViewer)[source]

Bases: QObject

Attributes:
data_shape
distribution

Methods

get_nav_data(data, x, y[, width, height])

Get filtered data

init()

init viewers or postprocessing once new data are loaded

init_rois(data)

Init crosshairs and ROIs in viewers if needed

update_nav_data(x, y[, width, height])

Display navigator data potentially postprocessed from filters in the signal viewers

update_viewer_data(**kwargs)

Update the signal display depending on the position of the crosshair in the navigation panels

updated_nav_integration()

Means the ROI select of the 2D viewer has been moved

data_dim_signal

get_out_of_range_limits

processor_changed

show_nav_integration

update_data

update_filter

update_nav_data_from_roi

update_nav_indexes

update_nav_limits

update_processor

static get_out_of_range_limits(x, y, width, height)[source]
abstractmethod get_nav_data(data: DataWithAxes, x, y, width=None, height=None) DataWithAxes[source]

Get filtered data

abstractmethod init()[source]

init viewers or postprocessing once new data are loaded

abstractmethod init_rois(data: DataRaw)[source]

Init crosshairs and ROIs in viewers if needed

show_nav_integration(show=True)[source]
update_data(data: DataRaw, force_update=False)[source]
update_filter(filter_type: str)[source]
abstractmethod update_nav_data(x, y, width=None, height=None)[source]

Display navigator data potentially postprocessed from filters in the signal viewers

update_nav_data_from_roi(roi: SimpleRectROI | LinearROI)[source]
update_nav_indexes(nav_indexes: List[int])[source]
update_nav_limits(x, y, width=None, height=None)[source]
update_processor(math_processor: DataProcessorFactory)[source]
abstractmethod update_viewer_data(**kwargs)[source]

Update the signal display depending on the position of the crosshair in the navigation panels

updated_nav_integration()[source]

Means the ROI select of the 2D viewer has been moved

data_dim_signal

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

Type:

str = …, revision

property data_shape
abstract property distribution
processor_changed

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

Type:

str = …, revision

class pymodaq_gui.plotting.data_viewers.viewerND.SpreadDataDisplayer(*args, **kwargs)[source]

Bases: BaseDataDisplayer

Specialized object to filter and plot non uniformly spaced data in dedicated viewers

Meant for any navigation axes and up to signal data dimensionality of 2 (images)

Methods

get_nav_data(data, x, y[, width, height])

Get filtered data

get_nav_position([posx, posy])

crosshair position from the "spread" data viewer.

init(data)

init viewers or postprocessing once new data are loaded

init_rois([nav_axes_limits, sig_axis_limits])

Init crosshairs and ROIs in viewers if needed

update_nav_data(x, y[, width, height])

Display navigator data potentially postprocessed from filters in the signal viewers

update_viewer_data([posx, posy])

Update the signal display depending on the position of the crosshair in the navigation panels

get_nav_data(data: DataRaw, x, y, width=None, height=None)[source]

Get filtered data

get_nav_position(posx=0, posy=None)[source]

crosshair position from the “spread” data viewer. Should return scan index where the scan was closest to posx, posy coordinates :param posx: :param posy:

init(data: DataWithAxes)[source]

init viewers or postprocessing once new data are loaded

init_rois(nav_axes_limits: List[Tuple[float, float]] = None, sig_axis_limits: List[Tuple[float, float]] = None)[source]

Init crosshairs and ROIs in viewers if needed

update_nav_data(x, y, width=None, height=None)[source]

Display navigator data potentially postprocessed from filters in the signal viewers

update_viewer_data(posx=0, posy=0)[source]

Update the signal display depending on the position of the crosshair in the navigation panels

Spread data can be customly represented using: if signal data is 0D:

  • A viewer 1D with non-linearly spaced data points (for 1 navigation axis)

  • A viewer 2D with its SpreadImage item (for 2 navigation axis)

  • A double panel: viewer for signal data and viewer 1D for all nav axes as a function of index in the data

otherwise:
  • A double panel: viewer for signal data and viewer 1D for all nav axes as a function of index in the data

series

Parameters:
  • posx (float) – from the 1D or 2D Navigator crosshair or from one of the navigation axis viewer (in that case nav_axis tells from which navigation axis the position comes from)

  • posy (float) – from the 2D Navigator crosshair

distribution: DataDistribution = 1
class pymodaq_gui.plotting.data_viewers.viewerND.UniformDataDisplayer(*args, **kwargs)[source]

Bases: BaseDataDisplayer

Specialized object to filter and plot linearly spaced data in dedicated viewers

Meant for any navigation axes and up to signal data dimensionality of 2 (images)

Methods

get_nav_data(data, x, y[, width, height])

Get filtered data

init(data)

init viewers or postprocessing once new data are loaded

init_rois([nav_axes_limits, sig_axis_limits])

Init crosshairs and ROIs in viewers if needed

update_nav_data(x, y[, width, height])

Display navigator data potentially postprocessed from filters in the signal viewers

update_viewer_data([posx, posy])

Update the signal display depending on the position of the crosshair in the navigation panels

updated_nav_integration()

Means the ROI select of the 2D viewer has been moved

get_nav_data(data: DataRaw, x, y, width=None, height=None)[source]

Get filtered data

init(data: DataRaw)[source]

init viewers or postprocessing once new data are loaded

init_rois(nav_axes_limits: List[Tuple[float, float]] = None, sig_axis_limits: List[Tuple[float, float]] = None)[source]

Init crosshairs and ROIs in viewers if needed

update_nav_data(x, y, width=None, height=None)[source]

Display navigator data potentially postprocessed from filters in the signal viewers

update_viewer_data(posx=0, posy=0)[source]

Update the signal display depending on the position of the crosshair in the navigation panels

Parameters:
  • posx (float) – from the 1D or 2D Navigator crosshair or from one of the navigation axis viewer (in that case nav_axis tells from which navigation axis the position comes from)

  • posy (float) – from the 2D Navigator crosshair

updated_nav_integration()[source]

Means the ROI select of the 2D viewer has been moved

distribution: DataDistribution = 0
class pymodaq_gui.plotting.data_viewers.viewerND.ViewerND(parent: QWidget = None, title='')[source]

Bases: ParameterManager, ActionManager, ViewerBase

Methods

setup_actions()

Method where to create actions to be subclassed.

connect_things

prepare_ui

reshape_data

set_data_test

setup_widgets

show_settings

update_data_dim

update_data_displayer

update_filters

update_widget_visibility

connect_things()[source]
prepare_ui()[source]
reshape_data()[source]
set_data_test(data_shape='3D')[source]
setup_actions()[source]

Method where to create actions to be subclassed. Mandatory

Examples

>>> self.add_action('Quit', 'close2', "Quit program")
>>> self.add_action('Grab', 'camera', "Grab from camera", checkable=True)
>>> self.add_action('Load', 'Open', "Load target file (.h5, .png, .jpg) or data from camera", checkable=False)
>>> self.add_action('Save', 'SaveAs', "Save current data", checkable=False)

See also

ActionManager.add_action

setup_widgets()[source]
show_settings(show: bool = True)[source]
update_data_dim(dim: str)[source]
update_data_displayer(distribution: DataDistribution)[source]
update_filters(processor: DataProcessorFactory)[source]
update_widget_visibility(data: DataRaw = None, nav_indexes: Tuple[int] = None)[source]
params = [{'name': 'set_data_spread1D0D', 'title': 'Set data spread 1D-0D', 'type': 'action', 'visible': False}, {'name': 'set_data_spread1D1D', 'title': 'Set data spread 1D-1D', 'type': 'action', 'visible': False}, {'name': 'set_data_spread1D2D', 'title': 'Set data spread 1D-2D', 'type': 'action', 'visible': False}, {'name': 'set_data_spread2D0D', 'title': 'Set data spread 2D-0D', 'type': 'action', 'visible': False}, {'name': 'set_data_spread2D1D', 'title': 'Set data spread 2D-1D', 'type': 'action', 'visible': False}, {'name': 'set_data_spread2D2D', 'title': 'Set data spread 2D-2D', 'type': 'action', 'visible': False}, {'name': 'set_data_spread3D0D', 'title': 'Set data spread 3D-0D', 'type': 'action', 'visible': False}, {'name': 'set_data_4D', 'title': 'Set data 4D', 'type': 'action', 'visible': False}, {'name': 'set_data_3D', 'title': 'Set data 3D', 'type': 'action', 'visible': False}, {'name': 'set_data_2D', 'title': 'Set data 2D', 'type': 'action', 'visible': False}, {'name': 'set_data_1D', 'title': 'Set data 1D', 'type': 'action', 'visible': False}, {'children': [{'name': 'data_shape_init', 'readonly': True, 'title': 'Initial Data shape:', 'type': 'str', 'value': ''}, {'children': [], 'name': 'nav_axes_shapes', 'readonly': True, 'title': 'Axes shape:', 'type': 'group'}, {'name': 'data_shape', 'readonly': True, 'title': 'Data shape:', 'type': 'str', 'value': ''}, {'name': 'navigator_axes', 'title': 'Navigator axes:', 'type': 'itemselect'}, {'name': 'set_nav_axes', 'title': 'Set Nav axes:', 'type': 'action', 'visible': True}], 'name': 'data_shape_settings', 'title': 'Signal shape', 'type': 'group'}]
pymodaq_gui.plotting.data_viewers.viewerND.main()[source]
pymodaq_gui.plotting.data_viewers.viewerND.spread_main()[source]