hyperspyui.mainwindowhyperspy module

Created on Tue Nov 04 13:37:08 2014

@author: Vidar Tonaas Fauske

class hyperspyui.mainwindowhyperspy.MainWindowHyperspy(parent=None)

Bases: MainWindowActionRecorder

Fifth layer in the application stack. Should integrate hyperspy basics, such as UI wrappings for hyperspy classes (Signal and Model), file I/O, etc.

_connect_figure_2_statusbar(mdi_window)

When a figure is activated, this callback sets the navigation status bar, and connects _on_active_navigate to the signal’s AxesManager.

_get_console_config()
_get_console_exec()
_get_console_exports()
_on_active_navigate(axes_manager)

Callback triggered when the active signal navigates. Updates the status bar with the navigation indices.

_on_track(gpos)

Tracks the mouse position for the entire application, and if the mouse is over a figure axes it updates the status bar mouse coordinates.

_sweeper(removed)

Trigger a GC one second after calling this.

add_model(signal=None, *args, **kwargs)

Add a default model for the given/selected signal. Returns the newly created ModelWrapper.

cancel_progressbar

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

create_menu()
create_statusbar()

Creates extra status bar controls, e.g. coordinate tracking.

create_widgetbar()

The widget bar itself is created and managed implicitly by Qt. Override this function to add widgets on UI construction.

dragEnterEvent(self, a0: QDragEnterEvent | None)
dropEvent(self, a0: QDropEvent | None)
edit_hspy_settings()
static get_accepted_extensions_load()
static get_accepted_extensions_save()
get_selected_component()

Returns the selected component

get_selected_model()

Returns the selected model

get_selected_model_wrapper()

Returns the selected model

get_selected_plot()

Returns the selected signal; a string specifying whether the active window is “navtigation” plot, “signal” plot or “other”; and finally the active window.

get_selected_signal()
get_selected_signals()
get_selected_wrapper(error_on_multiple=False)
get_selected_wrappers()
get_signal_filepath_suggestion(signal, default_ext=None)
load(filenames=None)

Load ‘filenames’, or if ‘filenames’ is None, open a dialog to let the user interactively browse for files. It then load these files using hyperspy.api.load and wraps them and adds them to self.signals.

load_stack(filenames=None, stack_axis=None)
make_component(comp_type)
on_console_executed(response)

Override when inherited to perform actions after executing, given the ‘response’ returned.

on_console_executing(source)

Override when inherited to perform actions before exectuing ‘source’.

on_progressbar_finished(pid)
on_progressbar_update(pid, value, txt=None)
on_progressbar_wanted(pid, maxval, label)
on_signal_plotted(signal, *args, **kwargs)
on_signal_plotting(signal, *args, **kwargs)
save(signals=None, filenames=None)
select_model(win, action)

Model selection callback for actions that are only valid for selected Models.

select_signal(win, action)

Signal selection callback for actions that are only valid for selected Signals.

set_mouse_coords_status(indices, values, units, intensity=None)

Display mouse coordinates both in indices and data space values.

‘units’ must be the same size as ‘values’

set_navigator_coords_status(coords)

Displays ‘coords’ as the navigator coordinates.

class hyperspyui.mainwindowhyperspy.TrackEventFilter

Bases: QObject

Qt Event filter for tracking the mouse position in the application.

eventFilter(self, a0: QObject | None, a1: QEvent | None) bool
track

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