Interactive (erlab.interactive)

Interactive plotting based on Qt and pyqtgraph.

Interactive tools

imagetool

Interactive data browser.

bzplot

colors

Functions for manipulating colors in Qt.

curvefittingtool

fermiedge

kspace

Interactive momentum conversion tool.

masktool

derivative

Interactive tool for visualizing dispersive data.

utilities

Various helper functions and extensions to pyqtgraph.

erlab.interactive.dtool(data, data_name=None, *, execute=None)[source]
erlab.interactive.goldtool(data, data_corr=None, *, data_name=None, **kwargs)[source]

Interactive gold edge fitting.

Parameters:
  • data (DataArray) – The data to perform Fermi edge fitting on.

  • data_corr (DataArray | None) – The data to correct with the edge. Defaults to data.

  • data_name (str | None) – Name of the data used in generating the code snipped copied to the clipboard. Overrides automatic detection.

  • **kwargs – Arguments passed onto erlab.interactive.utilities.AnalysisWindow.

erlab.interactive.itool(data, link=False, link_colors=True, execute=None, **kwargs)[source]

Create and display an ImageTool window.

Parameters:
  • data (Collection[xr.DataArray | npt.NDArray] | xr.DataArray | npt.NDArray | xr.Dataset) – Array-like object or a sequence of such object with 2 to 4 dimensions. See notes.

  • link (bool) – Whether to enable linking between multiple ImageTool windows, by default False.

  • link_colors (bool) – Whether to link the color maps between multiple linked ImageTool windows, by default True.

  • execute (bool | None) – Whether to execute the Qt event loop and display the window, by default None. If None, the execution is determined based on the current IPython shell.

  • **kwargs – Additional keyword arguments to be passed onto the underlying slicer area. For a full list of supported arguments, see the erlab.interactive.imagetool.core.ImageSlicerArea documentation.

Returns:

The created ImageTool window(s).

Return type:

ImageTool or list of ImageTool

Notes

  • If data is a sequence of valid data, multiple ImageTool windows will be created and displayed.

  • If data is a Dataset, each DataArray in the Dataset will be displayed in a separate ImageTool window. Data variables with 2 to 4 dimensions are considered as valid. Other variables are ignored.

  • If link is True, the ImageTool windows will be synchronized.

Examples

>>> itool(data, cmap="gray", gamma=0.5)
>>> itool(data_list, link=True)
erlab.interactive.ktool(data, *, data_name=None, execute=None)[source]

Interactive momentum conversion tool.