NumpyAxesSelector:Widget to select a view from a numpy array

This module defines a widget able to convert a numpy array from n-dimensions to a numpy array with less dimensions.

class NumpyAxesSelector(parent=None)[source]

Widget to select a view from a numpy array.

../../../_images/NumpyAxesSelector.png

The widget is set with an input data using setData(), and a requested output dimension using setAxisNames().

Widgets are provided to selected expected input axis, and a slice on the non-selected axis.

The final selected array can be reached using the getter selectedData(), and the event selectionChanged.

If the input data is a HDF5 Dataset, the selected output data will be a new numpy array.

dataChanged

Emitted when the input data change

selectedAxisChanged

Emitted when the selected axis change

selectionChanged

Emitted when the selected data change

customAxisChanged

Emitted when a custom axis change

clear()[source]

Clear the widget.

setAxisNames(axesNames)[source]

Set the axis names of the output selected data.

Axis names are defined from slower to faster axis.

The size of the list will constrain the dimension of the resulting array.

Parameters

axesNames (List[str]) – List of distinct strings identifying axis names

setCustomAxis(axesNames)[source]

Set the available list of named axis which can be set to a value.

Parameters

axesNames (List[str]) – List of customable axis names

setData(data)[source]

Set the input data unsed by the widget.

Parameters

data (numpy.ndarray) – The input data

data()[source]

Returns the input data.

Return type

numpy.ndarray

selectedData()[source]

Returns the output data.

Return type

numpy.ndarray

selection()[source]

Returns the selection tuple used to slice the data.

Return type

tuple

setNamedAxesSelectorVisibility(visible)[source]

Show or hide the combo-boxes allowing to map the plot axes to the data dimension.

Parameters

visible – Boolean