NeuXtalViz.views package#
Submodules#
- class NeuXtalVizWidget(parent=None)[source]#
Bases:
QWidgetBase widget for all NeuXtalViz views, providing shared functionality and interface for user-facing widgets.
This widget assembles the common 3D visualization panel shared by all feature-specific views: a PyVista/VTK plotter, camera and view controls, axis and reciprocal/real lattice toggles, theming controls, an information console, and a status/progress bar with a stop button. Feature-specific views subclass or embed this widget and add their own controls alongside it.
- Attributes:
- log_outputSignal(str)
Signal emitted to relay log/console text.
- cam_readySignal()
Signal emitted whenever the camera state has been updated.
Methods
acceptDrops(self, /)accessibleDescription(self, /)accessibleIdentifier(self, /)accessibleName(self, /)actionEvent(self, event, /)actions(self, /)activateWindow(self, /)addAction(...)addActions(self, actions, /)adjustSize(self, /)append_to_console(text)Append a line of text to the console output widget.
autoFillBackground(self, /)auto_scale_dropdown(combo)Autoscale a combobox width to fit text plus any icons/checks.
State of axes.
backgroundRole(self, /)backingStore(self, /)baseSize(self, /)blockSignals(self, b, /)changeEvent(self, event, /)Enable or disable parallel projection.
childAt(...)childEvent(self, event, /)children(self, /)childrenRect(self, /)childrenRegion(self, /)clearFocus(self, /)clearMask(self, /)Clear plane widgets and actors from the plotter.
close(self, /)closeEvent(self, event, /)colorCount(self, /)connect(...)connectNotify(self, signal, /)connect_az(left, right)Connect Azimuth to presenter handler.
connect_camera_ready(calculate)Connect a callback to the
cam_readysignal.connect_elev(up, down)Connect Elevate to presenter handler.
connect_manual_axis(view_manual)Manual axis view connection.
connect_manual_up_axis(view_manual)Manual axis up view connection.
connect_real_axes(view_a, view_b, view_c)Real axes view connections.
connect_reciprocal_axes(view_a_star, ...)Reciprocal axes view connections.
connect_reciprocal_real_compass(change_lattice)Reciprocal/real axis compass
connect_rotate(cww, cw)Connect Roll to presenter handler.
connect_save_screenshot(save_screenshot)Screenshot connection.
connect_stop(stop)Connect stop button to presenter callback.
contentsMargins(self, /)contentsRect(self, /)contextMenuEvent(self, event, /)contextMenuPolicy(self, /)create(self, /[, arg__1, initializeWindow, ...])createWinId(self, /)createWindowContainer(window, /[, parent, flags])cursor(self, /)customEvent(self, event, /)deleteLater(self, /)depth(self, /)destroy(self, /[, destroyWindow, ...])devType(self, /)devicePixelRatio(self, /)devicePixelRatioF(self, /)devicePixelRatioFScale()disconnect(...)disconnectNotify(self, signal, /)dragEnterEvent(self, event, /)dragLeaveEvent(self, event, /)dragMoveEvent(self, event, /)dropEvent(self, event, /)dumpObjectInfo(self, /)dumpObjectTree(self, /)dynamicPropertyNames(self, /)effectiveWinId(self, /)emit(self, signal, /, *args)encodeMetricF(metric, value, /)ensurePolished(self, /)enterEvent(self, event, /)event(self, event, /)eventFilter(self, watched, event, /)find(arg__1, /)findChild(self, type, /[, name, options])findChildren() -> List[~PlaceholderType] ))focusInEvent(self, event, /)focusNextChild(self, /)focusNextPrevChild(self, next, /)focusOutEvent(self, event, /)focusPolicy(self, /)focusPreviousChild(self, /)focusProxy(self, /)focusWidget(self, /)font(self, /)fontInfo(self, /)fontMetrics(self, /)foregroundRole(self, /)frameGeometry(self, /)frameSize(self, /)geometry(self, /)Get the current camera roll angle and view direction.
Return the current camera position, focal point, and up vectors.
Indices of manually entered direction components.
Indices of manually entered direction up components.
Return the rotation step in degrees from the rotate tab.
grab(self, /[, rectangle])grabGesture(self, type, /[, flags])grabKeyboard(self, /)grabMouse(-> None)grabShortcut(self, key, /[, context])graphicsEffect(self, /)graphicsProxyWidget(self, /)hasFocus(self, /)hasHeightForWidth(self, /)hasMouseTracking(self, /)hasTabletTracking(self, /)height(self, /)heightForWidth(self, arg__1, /)heightMM(self, /)hide(self, /)hideEvent(self, event, /)inherits(self, classname, /)initPainter(self, painter, /)inputMethodEvent(self, event, /)inputMethodHints(self, /)inputMethodQuery(self, arg__1, /)insertAction(self, before, action, /)insertActions(self, before, actions, /)installEventFilter(self, filterObj, /)internalWinId(self, /)isActiveWindow(self, /)isAncestorOf(self, child, /)isEnabled(self, /)isEnabledTo(self, arg__1, /)isFullScreen(self, /)isHidden(self, /)isLeftToRight(self, /)isMaximized(self, /)isMinimized(self, /)isModal(self, /)isQmlExposed(self, /)isQuickItemType(self, /)isRightToLeft(self, /)isSignalConnected(self, signal, /)isTopLevel(self, /)isVisible(self, /)isVisibleTo(self, arg__1, /)isWidgetType(self, /)isWindow(self, /)isWindowModified(self, /)isWindowType(self, /)keyPressEvent(self, event, /)keyReleaseEvent(self, event, /)keyboardGrabber()killTimer(-> None)layout(self, /)layoutDirection(self, /)leaveEvent(self, event, /)locale(self, /)logicalDpiX(self, /)logicalDpiY(self, /)lower(self, /)mapFrom(-> PySide6.QtCore.QPoint)mapFromGlobal(-> PySide6.QtCore.QPoint)mapFromParent(-> PySide6.QtCore.QPoint)mapTo(-> PySide6.QtCore.QPoint)mapToGlobal(-> PySide6.QtCore.QPoint)mapToParent(-> PySide6.QtCore.QPoint)mask(self, /)maximumHeight(self, /)maximumSize(self, /)maximumWidth(self, /)metaObject(self, /)metric(self, arg__1, /)minimumHeight(self, /)minimumSize(self, /)minimumSizeHint(self, /)minimumWidth(self, /)mouseDoubleClickEvent(self, event, /)mouseGrabber()mouseMoveEvent(self, event, /)mousePressEvent(self, event, /)mouseReleaseEvent(self, event, /)move(-> None)moveEvent(self, event, /)moveToThread(self, thread, /)nativeEvent(self, eventType, message, /)nativeParentWidget(self, /)nextInFocusChain(self, /)normalGeometry(self, /)objectName(self, /)overrideWindowFlags(self, type, /)overrideWindowState(self, state, /)paintEngine(self, /)paintEvent(self, event, /)paintingActive(self, /)palette(self, /)parent(self, /)parentWidget(self, /)physicalDpiX(self, /)physicalDpiY(self, /)pos(self, /)previousInFocusChain(self, /)property(self, name, /)raise_(self, /)receivers(self, signal, /)State of reciprocal lattice vectors.
rect(self, /)redirected(self, offset, /)releaseKeyboard(self, /)releaseMouse(self, /)releaseShortcut(self, id, /)removeAction(self, action, /)removeEventFilter(self, obj, /)render(, sourceRegion, renderFlags, renderFlags)repaint(-> None -> None -> None)Reset the camera.
Restore the cached camera position, or reset the view.
reset_view([negative])Reset the view to the default isometric orientation.
resize(-> None)resizeEvent(self, event, /)restoreGeometry(self, geometry, /)saveGeometry(self, /)save_screenshot(filename)Save plotter screenshot.
Prompt the user to choose a PNG file path for a screenshot.
screen(self, /)scroll(-> None)sender(self, /)senderSignalIndex(self, /)setAcceptDrops(self, on, /)setAccessibleDescription(self, description, /)setAccessibleIdentifier(self, identifier, /)setAccessibleName(self, name, /)setAttribute(self, arg__1, /[, on])setAutoFillBackground(self, enabled, /)setBackgroundRole(self, arg__1, /)setBaseSize(-> None)setContentsMargins(-> None)setContextMenuPolicy(self, policy, /)setCursor(self, arg__1, /)setDisabled(self, arg__1, /)setEnabled(self, arg__1, /)setFixedHeight(self, h, /)setFixedSize(-> None)setFixedWidth(self, w, /)setFocus(-> None)setFocusPolicy(self, policy, /)setFocusProxy(self, arg__1, /)setFont(self, arg__1, /)setForegroundRole(self, arg__1, /)setGeometry(-> None)setGraphicsEffect(self, effect, /)setHidden(self, hidden, /)setInputMethodHints(self, hints, /)setLayout(self, arg__1, /)setLayoutDirection(self, direction, /)setLocale(self, locale, /)setMask(-> None)setMaximumHeight(self, maxh, /)setMaximumSize(-> None)setMaximumWidth(self, maxw, /)setMinimumHeight(self, minh, /)setMinimumSize(-> None)setMinimumWidth(self, minw, /)setMouseTracking(self, enable, /)setObjectName(self, name, /)setPalette(self, arg__1, /)setParent(-> None)setProperty(self, name, value, /)setScreen(self, arg__1, /)setShortcutAutoRepeat(self, id, /[, enable])setShortcutEnabled(self, id, /[, enable])setSizeIncrement(-> None)setSizePolicy(-> None)setStatusTip(self, arg__1, /)setStyle(self, arg__1, /)setStyleSheet(self, styleSheet, /)setTabOrder(arg__1, arg__2, /)setTabletTracking(self, enable, /)setToolTip(self, arg__1, /)setToolTipDuration(self, msec, /)setUpdatesEnabled(self, enable, /)setVisible(self, visible, /)setWhatsThis(self, arg__1, /)setWindowFilePath(self, filePath, /)setWindowFlag(self, arg__1, /[, on])setWindowFlags(self, type, /)setWindowIcon(self, icon, /)setWindowIconText(self, arg__1, /)setWindowModality(self, windowModality, /)setWindowModified(self, arg__1, /)setWindowOpacity(self, level, /)setWindowRole(self, arg__1, /)setWindowState(self, state, /)setWindowTitle(self, arg__1, /)set_camera_state(position, focal_point, up)Apply a new camera state to the underlying plotter and refresh.
set_info(status)Update status information.
set_oriented_lattice_parameters(a, b, c, ...)Update the oriented lattice paramters.
set_position(pos)Set the position.
set_step(progress)Update progress step.
Apply a transform to the axes.
sharedPainter(self, /)show(self, /)showEvent(self, event, /)showFullScreen(self, /)showMaximized(self, /)showMinimized(self, /)showNormal(self, /)Show or hide the coordinate axes actor in the plotter.
signalsBlocked(self, /)size(self, /)sizeHint(self, /)sizeIncrement(self, /)sizePolicy(self, /)stackUnder(self, arg__1, /)startTimer(self, interval, /[, timerType])start_worker_pool(worker)Connect a worker's output to the console and start it.
statusTip(self, /)Stop all running worker processes.
stop_processing(stop_event)Check if a stop has been requested.
style(self, /)styleSheet(self, /)tabletEvent(self, event, /)testAttribute(self, arg__1, /)thread(self, /)timerEvent(self, event, /)toggle_console(state)Show or hide the console output widget.
toolTip(self, /)toolTipDuration(self, /)topLevelWidget(self, /)tr(self, sourceText, /[, disambiguation, n])underMouse(self, /)ungrabGesture(self, type, /)unsetCursor(self, /)unsetLayoutDirection(self, /)unsetLocale(self, /)update(-> None -> None -> None)updateGeometry(self, /)updateMicroFocus(self, /[, query])update_camera_display(roll, elevation, azimuth)Update the read-only camera orientation display, if present.
Change the axes labels between Miller and fractional notation.
Apply the selected PyVista/matplotlib plot theme to the view.
updatesEnabled(self, /)view_up_vector(vec)Set the camera according to given vector(s).
view_vector(vecs)Set the camera according to given vector(s).
view_xy()View \(xy\)-plane.
view_xz()View \(xz\)-plane.
view_yx()View \(yx\)-plane.
view_yz()View \(yz\)-plane.
view_zx()View \(zx\)-plane.
view_zy()View \(zy\)-plane.
visibleRegion(self, /)whatsThis(self, /)wheelEvent(self, event, /)width(self, /)widthMM(self, /)winId(self, /)window(self, /)windowFilePath(self, /)windowFlags(self, /)windowHandle(self, /)windowIcon(self, /)windowIconText(self, /)windowModality(self, /)windowOpacity(self, /)windowRole(self, /)windowState(self, /)windowTitle(self, /)windowType(self, /)worker(task)Wrap a callable as a background
Workertask.x(self, /)y(self, /)PaintDeviceMetric
RenderFlag
cam_ready
customContextMenuRequested
destroyed
log_output
objectNameChanged
windowIconChanged
windowIconTextChanged
windowTitleChanged
- append_to_console(text)[source]#
Append a line of text to the console output widget.
- Parameters:
- textstr
Text to append to the console.
- auto_scale_dropdown(combo)[source]#
Autoscale a combobox width to fit text plus any icons/checks.
This keeps the drop-down (and closed state) wide enough for the longest item label while leaving extra room for icons or check indicators drawn on the left-hand side. Also assigns a representative icon to each item (based on item text, e.g. a gem icon for “TOPAZ”) before measuring the required width.
- Parameters:
- comboQComboBox
Combo box to resize and decorate with icons.
- axes_show()[source]#
State of axes.
- Returns:
- checkedbool
True if the “Show Axes” checkbox is checked, False otherwise.
- clear_scene()[source]#
Clear plane widgets and actors from the plotter.
Uses
clear_actors()(notclear()) so that scene lights are preserved and shading is not flattened. Also caches the current camera position (if one is already stored) so it can be restored later byreset_scene().
- connect_az(left, right)[source]#
Connect Azimuth to presenter handler.
- Parameters:
- leftfunction
Handler for rotating the camera left (azimuth).
- rightfunction
Handler for rotating the camera right (azimuth).
- connect_camera_ready(calculate)[source]#
Connect a callback to the
cam_readysignal.The
cam_readysignal is emitted whenever the camera state changes (e.g. after a view/up vector change or a camera reset). Presenters typically connect this to a handler that recomputes and displays roll/elevation/azimuth.- Parameters:
- calculatecallable
Slot to invoke whenever the camera is ready/updated.
- connect_elev(up, down)[source]#
Connect Elevate to presenter handler.
- Parameters:
- upfunction
Handler for tilting the camera up.
- downfunction
Handler for tilting the camera down.
- connect_manual_axis(view_manual)[source]#
Manual axis view connection.
- Parameters:
- view_manualfunction
Manual axis view handler.
- connect_manual_up_axis(view_manual)[source]#
Manual axis up view connection.
- Parameters:
- view_manualfunction
Manual axis up view handler.
- connect_real_axes(view_a, view_b, view_c)[source]#
Real axes view connections.
- Parameters:
- view_afunction
\(a\)-axis view handler.
- view_bfunction
\(b\)-axis view handler.
- view_cfunction
\(c\)-axis view handler.
- connect_reciprocal_axes(view_a_star, view_b_star, view_c_star)[source]#
Reciprocal axes view connections.
- Parameters:
- view_a_starfunction
\(a^st\)-axis view handler.
- view_b_starfunction
\(b^st\)-axis view handler.
- view_c_starfunction
\(c^st\)-axis view handler.
- connect_reciprocal_real_compass(change_lattice)[source]#
Reciprocal/real axis compass
- Parameters:
- change_latticefunction
Lattice handler.
- connect_rotate(cww, cw)[source]#
Connect Roll to presenter handler.
- Parameters:
- cwwfunction
Handler for rolling counter-clockwise.
- cwfunction
Handler for rolling clockwise.
- connect_save_screenshot(save_screenshot)[source]#
Screenshot connection.
- Parameters:
- save_screenshotfunction
Screenshot handler.
- connect_stop(stop)[source]#
Connect stop button to presenter callback.
- Parameters:
- stopcallable
Callback function to handle stop requests.
- get_camera_roll_direction()[source]#
Get the current camera roll angle and view direction.
- Returns:
- rollfloat
Camera roll angle in degrees.
- direction3-element tuple of float
Camera view direction vector.
- get_camera_state()[source]#
Return the current camera position, focal point, and up vectors.
- Returns:
- position3-element ndarray of float
Camera position in Cartesian coordinates.
- focal_point3-element ndarray of float
Camera focal point in Cartesian coordinates.
- up3-element ndarray of float
Camera up direction in Cartesian coordinates.
- get_manual_axis_indices()[source]#
Indices of manually entered direction components.
- Returns:
- axes_typestr, [hkl] or [uvw]
Miller index or fractional coordinate.
- ind3-element 1d array-like
Indices.
- None
Returned (implicitly) instead of the tuple above if any of the three axis line edits currently holds invalid input.
- get_manual_axis_up_indices()[source]#
Indices of manually entered direction up components.
- Returns:
- axes_typestr, [hkl] or [uvw]
Miller index or fractional coordinate.
- ind3-element 1d array-like
Indices.
- None
Returned (implicitly) instead of the tuple above if any of the three up-axis line edits currently holds invalid input.
- get_rotate_step()[source]#
Return the rotation step in degrees from the rotate tab.
- Returns:
- stepfloat
Rotation step in degrees entered in the rotate tab, or 5.0 if the current text is not a valid value.
- reciprocal_lattice()[source]#
State of reciprocal lattice vectors.
- Returns:
- checkedbool
True if the reciprocal lattice toggle is checked (axes should be labeled a*/b*/c*), False otherwise (a/b/c).
- reset_scene()[source]#
Restore the cached camera position, or reset the view.
If a camera position was previously cached (see
clear_scene()/reset_view()), it is reapplied to the plotter; otherwise the view is reset to the default isometric orientation viareset_view(). Emitscam_readywhen done.
- reset_view(negative=False)[source]#
Reset the view to the default isometric orientation.
Also caches the resulting camera position and emits
cam_ready.- Parameters:
- negativebool, optional
If True, view from the opposite isometric direction, by default False.
- save_screenshot(filename)[source]#
Save plotter screenshot.
- Parameters:
- filenamestr
Filename with *.png extension.
- save_screenshot_file_dialog()[source]#
Prompt the user to choose a PNG file path for a screenshot.
Opens a “Save PNG file” dialog seeded with the last remembered directory, and remembers the chosen directory for next time.
- Returns:
- filenamestr
Selected file path, or an empty string if the user cancelled the dialog.
- set_camera_state(position, focal_point, up)[source]#
Apply a new camera state to the underlying plotter and refresh.
Re-renders the plotter and emits
cam_readyafterward.- Parameters:
- position3-element 1d array-like
Camera position in Cartesian coordinates.
- focal_point3-element 1d array-like
Camera focal point in Cartesian coordinates.
- up3-element 1d array-like
Camera up direction in Cartesian coordinates.
- set_oriented_lattice_parameters(a, b, c, alpha, beta, gamma, u, v)[source]#
Update the oriented lattice paramters.
- Parameters:
- a, b, cfloat
Lattice constants.
- alpha, beta, gammafloat
Lattice angles.
- u, v3-element 1d array-like
Sample orientation vectors.
- set_position(pos)[source]#
Set the position.
- Parameters:
- pos3-element 1d array-like
Coordinate position.
- set_transform(T)[source]#
Apply a transform to the axes.
- Parameters:
- T3x3 2d array
Trasformation matrix.
- show_axes()[source]#
Show or hide the coordinate axes actor in the plotter.
If the axes checkbox is unchecked, the axes are hidden. Otherwise, if a transform
Thas been set, the axes actor is (re)drawn with labels chosen according toreciprocal_lattice()(a*/b*/c* vs a/b/c) and oriented using the current transform matrix.
- start_worker_pool(worker)[source]#
Connect a worker’s output to the console and start it.
Wires
worker.signals.outputtoappend_to_console()so any captured stdout/stderr/logging text produced while the task runs is streamed live to the console, then hands the worker off to the sharedThreadPoolfor execution.- Parameters:
- workerNeuXtalViz.views.utilities.Worker
Worker to run, typically created via
worker()with itsresult/finished/progresssignals already connected by the presenter.
- static stop_processing(stop_event)[source]#
Check if a stop has been requested.
Convenience method for worker tasks to check if they should terminate early.
- Parameters:
- stop_eventthreading.Event or None
The stop event to check.
- Returns:
- stopbool
True if stop was requested, False otherwise.
- toggle_console(state)[source]#
Show or hide the console output widget.
Connected to the “Expand Console” checkbox’s
stateChangedsignal.- Parameters:
- stateint or Qt.CheckState
Checkbox state; truthy (checked) shows the console, falsy (unchecked) hides it.
- update_camera_display(roll, elevation, azimuth)[source]#
Update the read-only camera orientation display, if present.
This shows the camera’s roll, elevation, azimuth in degrees.
- Parameters:
- rollfloat
Camera roll angle in degrees.
- elevationfloat
Camera elevation angle in degrees.
- azimuthfloat
Camera azimuth angle in degrees.
- update_theme()[source]#
Apply the selected PyVista/matplotlib plot theme to the view.
Reads the current selection from the theme combo box, applies it as the global PyVista plot theme, updates the plotter background, re-renders, refreshes the axes actor, and refreshes the axis button icon colors to match the new theme. Selecting the “dark” theme also switches the whole application to a dark Qt stylesheet; any other theme selection switches back to the light stylesheet. Also applies a corresponding matplotlib style (“default” for “default”/”document”, “dark” -> “dark_background”, “paraview” -> “Solarize_Light2”) and re-styles any matplotlib canvases already drawn on this view.
- view_up_vector(vec)[source]#
Set the camera according to given vector(s).
- Parameters:
- vec3 element 1d array-like
Camera up direction.
- view_vector(vecs)[source]#
Set the camera according to given vector(s).
- Parameters:
- vecslist of 2 or single 3 element 1d array-like
Camera direction and optional upward vector.
- worker(task)[source]#
Wrap a callable as a background
Workertask.The returned worker calls
taskon a thread-pool thread, automatically injectingprogressandstop_eventkeyword arguments so the task can report progress and check for cooperative cancellation.- Parameters:
- taskcallable
Function (or functools.partial-bound method) to run in the background, e.g. a presenter processing method.
- Returns:
- workerNeuXtalViz.views.utilities.Worker
Worker object wrapping
task, ready to have its signals connected and be passed tostart_worker_pool().
- class CrystalStructureView(parent=None)[source]#
Bases:
NeuXtalVizWidgetView for visualizing and editing crystal structures in NeuXtalViz.
Provides user interface elements for entering lattice parameters, selecting crystal system and space group, loading/saving structure files, and visualizing atomic positions and structure factors.
- Attributes:
paintersushort
Methods
Build the "Absorption" tab layout and widgets.
acceptDrops(self, /)accessibleDescription(self, /)accessibleIdentifier(self, /)accessibleName(self, /)actionEvent(self, event, /)actions(self, /)activateWindow(self, /)addAction(...)addActions(self, actions, /)add_absorption_sample(mesh, T, mu, r_incident)Draw the absorption sample mesh in the 3D view.
add_atoms(atom_dict)Draw atom sites as spheres in the 3D view.
adjustSize(self, /)append_to_console(text)Append a line of text to the console output widget.
autoFillBackground(self, /)auto_scale_dropdown(combo)Autoscale a combobox width to fit text plus any icons/checks.
axes_show()State of axes.
backgroundRole(self, /)backingStore(self, /)baseSize(self, /)blockSignals(self, b, /)changeEvent(self, event, /)change_projection()Enable or disable parallel projection.
childAt(...)childEvent(self, event, /)children(self, /)childrenRect(self, /)childrenRegion(self, /)clearFocus(self, /)clearMask(self, /)clear_scene()Clear plane widgets and actors from the plotter.
close(self, /)closeEvent(self, event, /)colorCount(self, /)connect(...)connectNotify(self, signal, /)connect_F2_calculator(calculate_F2)Connect the structure factor calculate button to a handler.
connect_atom_table(set_atom_table)Connect atom site field edits to a handler.
connect_az(left, right)Connect Azimuth to presenter handler.
Connect the absorption calculate button to a handler.
connect_camera_ready(calculate)Connect a callback to the
cam_readysignal.connect_elev(up, down)Connect Elevate to presenter handler.
connect_group_generator(generate_groups)Connect crystal system selection to a handler.
connect_hkl_calculator(calculate_hkl)Connect the individual hkl calculate button to a handler.
connect_lattice_parameters(update_parameters)Connect lattice parameter edits to a handler.
connect_load_CIF(load_CIF)Connect the load CIF button to a handler.
connect_manual_axis(view_manual)Manual axis view connection.
connect_manual_up_axis(view_manual)Manual axis up view connection.
connect_real_axes(view_a, view_b, view_c)Real axes view connections.
connect_reciprocal_axes(view_a_star, ...)Reciprocal axes view connections.
connect_reciprocal_real_compass(change_lattice)Reciprocal/real axis compass
connect_rotate(cww, cw)Connect Roll to presenter handler.
connect_row_highligter(highlight_row)Connect atom table row selection to a handler.
connect_save_INS(save_INS)Connect the save INS button to a handler.
connect_save_screenshot(save_screenshot)Screenshot connection.
connect_select_isotope(select_isotope)Connect the atom/isotope button to a handler.
connect_setting_generator(generate_settings)Connect space group selection to a handler.
connect_stop(stop)Connect stop button to presenter callback.
constrain_parameters(const)Enable or disable lattice parameter fields based on constraints.
contentsMargins(self, /)contentsRect(self, /)contextMenuEvent(self, event, /)contextMenuPolicy(self, /)create(self, /[, arg__1, initializeWindow, ...])createWinId(self, /)createWindowContainer(window, /[, parent, flags])cursor(self, /)customEvent(self, event, /)deleteLater(self, /)depth(self, /)destroy(self, /[, destroyWindow, ...])devType(self, /)devicePixelRatio(self, /)devicePixelRatioF(self, /)devicePixelRatioFScale()disconnect(...)disconnectNotify(self, signal, /)dragEnterEvent(self, event, /)dragLeaveEvent(self, event, /)dragMoveEvent(self, event, /)draw_cell(A)Draw the unit cell as a wireframe box in the 3D view.
dropEvent(self, event, /)dumpObjectInfo(self, /)dumpObjectTree(self, /)dynamicPropertyNames(self, /)effectiveWinId(self, /)emit(self, signal, /, *args)encodeMetricF(metric, value, /)ensurePolished(self, /)enterEvent(self, event, /)event(self, event, /)eventFilter(self, watched, event, /)Build the "Factors" tab layout and widgets.
find(arg__1, /)findChild(self, type, /[, name, options])findChildren() -> List[~PlaceholderType] ))focusInEvent(self, event, /)focusNextChild(self, /)focusNextPrevChild(self, next, /)focusOutEvent(self, event, /)focusPolicy(self, /)focusPreviousChild(self, /)focusProxy(self, /)focusWidget(self, /)font(self, /)fontInfo(self, /)fontMetrics(self, /)foregroundRole(self, /)frameGeometry(self, /)frameSize(self, /)geometry(self, /)Minimum d-spacing entered by the user, if valid.
Beam-/in-plane-direction vectors entered by the user.
Ellipsoid dimension values entered by the user.
Shape-orientation U/V vectors entered by the user.
get_atom_site(row)Atom site values from a specific table row.
get_camera_roll_direction()Get the current camera roll angle and view direction.
get_camera_state()Return the current camera position, focal point, and up vectors.
Current crystal system selection.
get_hkl()Individual hkl indices entered by the user.
Current isotope/atom button label.
Lattice parameter values entered by the user.
get_manual_axis_indices()Indices of manually entered direction components.
get_manual_axis_up_indices()Indices of manually entered direction up components.
Minimum d-spacing entered by the user.
Create a periodic table dialog view.
get_rotate_step()Return the rotation step in degrees from the rotate tab.
Atom site values for the currently selected table row.
Atom site values for all rows of the atom site table.
Current space group setting selection.
Current space group selection.
Incident wavelength entered by the user, if valid.
grab(self, /[, rectangle])grabGesture(self, type, /[, flags])grabKeyboard(self, /)grabMouse(-> None)grabShortcut(self, key, /[, context])graphicsEffect(self, /)graphicsProxyWidget(self, /)hasFocus(self, /)hasHeightForWidth(self, /)hasMouseTracking(self, /)hasTabletTracking(self, /)height(self, /)heightForWidth(self, arg__1, /)heightMM(self, /)hide(self, /)hideEvent(self, event, /)highlight(index, dataset)Toggle highlight color while preserving original atom color.
inherits(self, classname, /)initPainter(self, painter, /)inputMethodEvent(self, event, /)inputMethodHints(self, /)inputMethodQuery(self, arg__1, /)insertAction(self, before, action, /)insertActions(self, before, actions, /)installEventFilter(self, filterObj, /)internalWinId(self, /)isActiveWindow(self, /)isAncestorOf(self, child, /)isEnabled(self, /)isEnabledTo(self, arg__1, /)isFullScreen(self, /)isHidden(self, /)isLeftToRight(self, /)isMaximized(self, /)isMinimized(self, /)isModal(self, /)isQmlExposed(self, /)isQuickItemType(self, /)isRightToLeft(self, /)isSignalConnected(self, signal, /)isTopLevel(self, /)isVisible(self, /)isVisibleTo(self, arg__1, /)isWidgetType(self, /)isWindow(self, /)isWindowModified(self, /)isWindowType(self, /)keyPressEvent(self, event, /)keyReleaseEvent(self, event, /)keyboardGrabber()killTimer(-> None)layout(self, /)layoutDirection(self, /)leaveEvent(self, event, /)Open a file dialog to select a CIF file to load.
locale(self, /)logicalDpiX(self, /)logicalDpiY(self, /)lower(self, /)mapFrom(-> PySide6.QtCore.QPoint)mapFromGlobal(-> PySide6.QtCore.QPoint)mapFromParent(-> PySide6.QtCore.QPoint)mapTo(-> PySide6.QtCore.QPoint)mapToGlobal(-> PySide6.QtCore.QPoint)mapToParent(-> PySide6.QtCore.QPoint)mask(self, /)maximumHeight(self, /)maximumSize(self, /)maximumWidth(self, /)metaObject(self, /)metric(self, arg__1, /)minimumHeight(self, /)minimumSize(self, /)minimumSizeHint(self, /)minimumWidth(self, /)mouseDoubleClickEvent(self, event, /)mouseGrabber()mouseMoveEvent(self, event, /)mousePressEvent(self, event, /)mouseReleaseEvent(self, event, /)move(-> None)moveEvent(self, event, /)moveToThread(self, thread, /)nativeEvent(self, eventType, message, /)nativeParentWidget(self, /)nextInFocusChain(self, /)normalGeometry(self, /)objectName(self, /)overrideWindowFlags(self, type, /)overrideWindowState(self, state, /)paintEngine(self, /)paintEvent(self, event, /)paintingActive(self, /)palette(self, /)parent(self, /)parentWidget(self, /)physicalDpiX(self, /)physicalDpiY(self, /)pos(self, /)previousInFocusChain(self, /)property(self, name, /)raise_(self, /)receivers(self, signal, /)reciprocal_lattice()State of reciprocal lattice vectors.
rect(self, /)redirected(self, offset, /)releaseKeyboard(self, /)releaseMouse(self, /)releaseShortcut(self, id, /)removeAction(self, action, /)removeEventFilter(self, obj, /)render(, sourceRegion, renderFlags, renderFlags)repaint(-> None -> None -> None)reset_camera()Reset the camera.
reset_scene()Restore the cached camera position, or reset the view.
reset_view([negative])Reset the view to the default isometric orientation.
resize(-> None)resizeEvent(self, event, /)restoreGeometry(self, geometry, /)saveGeometry(self, /)Open a file dialog to select a destination INS file.
save_screenshot(filename)Save plotter screenshot.
save_screenshot_file_dialog()Prompt the user to choose a PNG file path for a screenshot.
screen(self, /)scroll(-> None)sender(self, /)senderSignalIndex(self, /)setAcceptDrops(self, on, /)setAccessibleDescription(self, description, /)setAccessibleIdentifier(self, identifier, /)setAccessibleName(self, name, /)setAttribute(self, arg__1, /[, on])setAutoFillBackground(self, enabled, /)setBackgroundRole(self, arg__1, /)setBaseSize(-> None)setContentsMargins(-> None)setContextMenuPolicy(self, policy, /)setCursor(self, arg__1, /)setDisabled(self, arg__1, /)setEnabled(self, arg__1, /)setFixedHeight(self, h, /)setFixedSize(-> None)setFixedWidth(self, w, /)setFocus(-> None)setFocusPolicy(self, policy, /)setFocusProxy(self, arg__1, /)setFont(self, arg__1, /)setForegroundRole(self, arg__1, /)setGeometry(-> None)setGraphicsEffect(self, effect, /)setHidden(self, hidden, /)setInputMethodHints(self, hints, /)setLayout(self, arg__1, /)setLayoutDirection(self, direction, /)setLocale(self, locale, /)setMask(-> None)setMaximumHeight(self, maxh, /)setMaximumSize(-> None)setMaximumWidth(self, maxw, /)setMinimumHeight(self, minh, /)setMinimumSize(-> None)setMinimumWidth(self, minw, /)setMouseTracking(self, enable, /)setObjectName(self, name, /)setPalette(self, arg__1, /)setParent(-> None)setProperty(self, name, value, /)setScreen(self, arg__1, /)setShortcutAutoRepeat(self, id, /[, enable])setShortcutEnabled(self, id, /[, enable])setSizeIncrement(-> None)setSizePolicy(-> None)setStatusTip(self, arg__1, /)setStyle(self, arg__1, /)setStyleSheet(self, styleSheet, /)setTabOrder(arg__1, arg__2, /)setTabletTracking(self, enable, /)setToolTip(self, arg__1, /)setToolTipDuration(self, msec, /)setUpdatesEnabled(self, enable, /)setVisible(self, visible, /)setWhatsThis(self, arg__1, /)setWindowFilePath(self, filePath, /)setWindowFlag(self, arg__1, /[, on])setWindowFlags(self, type, /)setWindowIcon(self, icon, /)setWindowIconText(self, arg__1, /)setWindowModality(self, windowModality, /)setWindowModified(self, arg__1, /)setWindowOpacity(self, level, /)setWindowRole(self, arg__1, /)setWindowState(self, state, /)setWindowTitle(self, arg__1, /)set_absorption_parameters(abs_dict)Populate the scattering/absorption and material property fields.
set_absorption_results(hkls, ds, Ts, Tbars)Repopulate the absorption results table.
set_absorption_shape_constants(params)Populate the ellipsoid dimension fields.
set_atom(scatterer)Populate the atom entry fields.
Apply the atom entry fields to the currently selected row.
set_camera_state(position, focal_point, up)Apply a new camera state to the underlying plotter and refresh.
set_crystal_system(crystal_system)Select a crystal system in the combo box.
set_equivalents(hkls, d, F2)Repopulate the structure factor table with symmetry equivalents.
set_factors(hkls, ds, F2s)Repopulate the structure factor table.
set_formula_z(chemical_formula, z_parameter)Populate the chemical formula and Z fields.
set_info(status)Update status information.
set_isotope(isotope)Set the isotope/atom button label.
set_lattice_constants(params)Populate the lattice parameter fields.
set_material_display(chemical_formula, ...)Populate the (read-only) absorption-tab material fields.
set_oriented_lattice_parameters(a, b, c, ...)Update the oriented lattice paramters.
set_position(pos)Set the position.
set_scatterer(row, scatterer)Populate a row of the atom site table.
set_scatterers(scatterers)Repopulate the atom site table.
set_setting(setting)Select a space group setting in the combo box.
set_space_group(space_group)Select a space group in the combo box.
set_step(progress)Update progress step.
set_transform(T)Apply a transform to the axes.
set_unit_cell_volume(vol)Populate the unit cell volume field.
sharedPainter(self, /)show(self, /)showEvent(self, event, /)showFullScreen(self, /)showMaximized(self, /)showMinimized(self, /)showNormal(self, /)show_axes()Show or hide the coordinate axes actor in the plotter.
signalsBlocked(self, /)size(self, /)sizeHint(self, /)sizeIncrement(self, /)sizePolicy(self, /)stackUnder(self, arg__1, /)startTimer(self, interval, /[, timerType])start_worker_pool(worker)Connect a worker's output to the console and start it.
statusTip(self, /)stop_processes()Stop all running worker processes.
stop_processing(stop_event)Check if a stop has been requested.
Build the "Structure" tab layout and widgets.
style(self, /)styleSheet(self, /)tabletEvent(self, event, /)testAttribute(self, arg__1, /)thread(self, /)timerEvent(self, event, /)toggle_console(state)Show or hide the console output widget.
toolTip(self, /)toolTipDuration(self, /)topLevelWidget(self, /)tr(self, sourceText, /[, disambiguation, n])underMouse(self, /)ungrabGesture(self, type, /)unsetCursor(self, /)unsetLayoutDirection(self, /)unsetLocale(self, /)update(-> None -> None -> None)updateGeometry(self, /)updateMicroFocus(self, /[, query])update_camera_display(roll, elevation, azimuth)Update the read-only camera orientation display, if present.
update_labels()Change the axes labels between Miller and fractional notation.
update_settings(settings)Repopulate the space group setting combo box.
update_space_groups(nos)Repopulate the space group combo box.
update_theme()Apply the selected PyVista/matplotlib plot theme to the view.
updatesEnabled(self, /)view_up_vector(vec)Set the camera according to given vector(s).
view_vector(vecs)Set the camera according to given vector(s).
view_xy()View \(xy\)-plane.
view_xz()View \(xz\)-plane.
view_yx()View \(yx\)-plane.
view_yz()View \(yz\)-plane.
view_zx()View \(zx\)-plane.
view_zy()View \(zy\)-plane.
visibleRegion(self, /)whatsThis(self, /)wheelEvent(self, event, /)width(self, /)widthMM(self, /)winId(self, /)window(self, /)windowFilePath(self, /)windowFlags(self, /)windowHandle(self, /)windowIcon(self, /)windowIconText(self, /)windowModality(self, /)windowOpacity(self, /)windowRole(self, /)windowState(self, /)windowTitle(self, /)windowType(self, /)worker(task)Wrap a callable as a background
Workertask.x(self, /)y(self, /)PaintDeviceMetric
RenderFlag
cam_ready
customContextMenuRequested
destroyed
log_output
objectNameChanged
windowIconChanged
windowIconTextChanged
windowTitleChanged
- absorption_tab()[source]#
Build the “Absorption” tab layout and widgets.
Constructs the ellipsoid dimension fields, wavelength and d-min fields with a calculate button, the transmission results table, the beam-/shape-orientation vector fields, the CIF-derived (read-only) material fields, and the absorption/scattering info panel, and adds them to the tab widget.
- add_absorption_sample(mesh, T, mu, r_incident)[source]#
Draw the absorption sample mesh in the 3D view.
Clears the current scene, adds the sample as a collection of triangles colored by the transmission from the incident beam entering the sample out to each surface point (
exp(-mu*(r_incident + r)), with a colorbar) – the same two-leg path used by the model’spredict_transmission, an easy, physically meaningful way to show which faces of the shape are most absorbing without hiding the shape itself behind a separate plot. Also adds a*/b*/c* arrows attached to the sample (colored red/green/blue, oriented byT, scaled to the sample’s own size), and resets the view.- Parameters:
- meshiterable of array-like
Triangle vertex coordinates describing the sample surface mesh, in cm.
- T(3, 3) array-like
Orientation matrix (unit a*/b*/c* Cartesian columns) from the model’s
get_transform_from_UB.- mufloat
Linear attenuation coefficient (1/cm,
mu_a + mu_sfrom the model’sget_absorption_dict) used to color the sample surface by local transmission.- r_incidentfloat
Sample radius (cm) along the incident beam direction, from the model’s
get_incident_path_length– the constant leg of the path added to each surface point’s own outgoing radius before computing transmission.
- add_atoms(atom_dict)[source]#
Draw atom sites as spheres in the 3D view.
Merges symmetry-equivalent atoms that fall on the same fractional coordinate (within rounding) into a single occupancy-weighted sphere whose color, radius, and opacity reflect the blended contributions, then enables block picking so atoms can be selected in the 3D view.
- Parameters:
- atom_dictdict
Mapping of atom/element label to a tuple of (coordinates, occupancies, indices), where
coordinatesis an iterable of fractional (x, y, z) positions,occupanciesis an iterable of site occupancy factors, andindicesis an iterable of row indices into the atom site table corresponding to each coordinate.
- connect_F2_calculator(calculate_F2)[source]#
Connect the structure factor calculate button to a handler.
- Parameters:
- calculate_F2callable
Slot invoked when the calculate button is clicked.
- connect_atom_table(set_atom_table)[source]#
Connect atom site field edits to a handler.
- Parameters:
- set_atom_tablecallable
Slot invoked when editing finishes on any of the x, y, z, occupancy, or Uiso line edits for the current atom.
- connect_calculate_absorption(calculate_absorption)[source]#
Connect the absorption calculate button to a handler.
- Parameters:
- calculate_absorptioncallable
Slot invoked when the absorption calculate button is clicked.
- connect_group_generator(generate_groups)[source]#
Connect crystal system selection to a handler.
- Parameters:
- generate_groupscallable
Slot invoked when the crystal system combo box is activated.
- connect_hkl_calculator(calculate_hkl)[source]#
Connect the individual hkl calculate button to a handler.
- Parameters:
- calculate_hklcallable
Slot invoked when the individual calculate button is clicked.
- connect_lattice_parameters(update_parameters)[source]#
Connect lattice parameter edits to a handler.
- Parameters:
- update_parameterscallable
Slot invoked when editing finishes on any of the a, b, c, alpha, beta, or gamma line edits.
- connect_load_CIF(load_CIF)[source]#
Connect the load CIF button to a handler.
- Parameters:
- load_CIFcallable
Slot invoked when the load CIF button is clicked.
- connect_row_highligter(highlight_row)[source]#
Connect atom table row selection to a handler.
- Parameters:
- highlight_rowcallable
Slot invoked when the selected item in the atom table changes.
- connect_save_INS(save_INS)[source]#
Connect the save INS button to a handler.
- Parameters:
- save_INScallable
Slot invoked when the save INS button is clicked.
- connect_select_isotope(select_isotope)[source]#
Connect the atom/isotope button to a handler.
- Parameters:
- select_isotopecallable
Slot invoked when the atom selection button is clicked.
- connect_setting_generator(generate_settings)[source]#
Connect space group selection to a handler.
- Parameters:
- generate_settingscallable
Slot invoked when the space group combo box is activated.
- constrain_parameters(const)[source]#
Enable or disable lattice parameter fields based on constraints.
- Parameters:
- constlist of bool
Flags indicating, for each of a, b, c, alpha, beta, and gamma, whether the corresponding field should be disabled (fixed) due to the crystal system’s symmetry constraints.
- draw_cell(A)[source]#
Draw the unit cell as a wireframe box in the 3D view.
- Parameters:
- A3x3 array-like
Transformation matrix mapping the unit cube to the unit cell edges.
- factors_tab()[source]#
Build the “Factors” tab layout and widgets.
Constructs the minimum d-spacing field and calculate button, the table of calculated structure factors, and the individual hkl entry fields with their calculate button, and adds them to the tab widget.
- get_absorption_d_min()[source]#
Minimum d-spacing entered by the user, if valid.
- Returns:
- d_minfloat or None
Minimum d-spacing (Å), or None if the field does not currently contain acceptable input.
- get_absorption_sample_vectors()[source]#
Beam-/in-plane-direction vectors entered by the user.
These define the crystal’s own orientation for the absorption prediction, independent of
get_absorption_shape_vectors()(which orients the shape mesh).- Returns:
- u_vectorlist of float
Reciprocal lattice indices (h, k, l) of the beam direction.
- v_vectorlist of float
Reciprocal lattice indices (h, k, l) of the in-plane direction.
- get_absorption_shape_constants()[source]#
Ellipsoid dimension values entered by the user.
- Returns:
- paramslist of float or None
Thickness, width, and height values (mm), or None if any field has invalid input.
- get_absorption_shape_vectors()[source]#
Shape-orientation U/V vectors entered by the user.
- Returns:
- u_vectorlist of float
Reciprocal lattice indices (h, k, l) of the direction along the sample thickness (the shape’s face normal).
- v_vectorlist of float
Reciprocal lattice indices (h, k, l) of an in-plane lateral direction.
- get_atom_site(row)[source]#
Atom site values from a specific table row.
- Parameters:
- rowint
Row index in the atom site table.
- Returns:
- scattererlist
Atom label (str) followed by x, y, z, occupancy, and Uiso values (float) for the given row.
- get_crystal_system()[source]#
Current crystal system selection.
- Returns:
- crystal_systemstr
Selected crystal system name (e.g. “Triclinic”, “Cubic”).
- get_hkl()[source]#
Individual hkl indices entered by the user.
- Returns:
- hkllist of float or None
Miller indices (h, k, l), or None if any field has invalid input.
- get_isotope()[source]#
Current isotope/atom button label.
- Returns:
- isotopestr
Isotope or element label currently shown on the button.
- get_lattice_constants()[source]#
Lattice parameter values entered by the user.
- Returns:
- paramslist of float or None
Lattice constants a, b, c (Å) and angles alpha, beta, gamma (degrees), or None if any field has invalid input.
- get_minimum_d_spacing()[source]#
Minimum d-spacing entered by the user.
- Returns:
- d_minfloat or None
Minimum d-spacing (Å) for structure factor calculation, or None if the field has invalid input.
- get_periodic_table()[source]#
Create a periodic table dialog view.
- Returns:
- viewNeuXtalViz.views.periodic_table.PeriodicTableView
New periodic table view instance for isotope selection.
- get_scatterer()[source]#
Atom site values for the currently selected table row.
- Returns:
- scattererlist or None
Atom label and x, y, z, occupancy, and Uiso values for the selected row, or None if no row is selected.
- get_scatterers()[source]#
Atom site values for all rows of the atom site table.
- Returns:
- scattererslist of list
Atom site values (label, x, y, z, occupancy, Uiso) for each row of the table.
- get_setting()[source]#
Current space group setting selection.
- Returns:
- settingstr
Selected space group setting identifier.
- get_space_group()[source]#
Current space group selection.
- Returns:
- space_groupstr
Selected space group identifier.
- get_wavelength()[source]#
Incident wavelength entered by the user, if valid.
- Returns:
- wavelengthfloat or None
Wavelength (Å), or None if the field does not currently contain acceptable input.
- highlight(index, dataset)[source]#
Toggle highlight color while preserving original atom color.
Callback for block picking on the 3D view: recolors the picked atom block pink (or restores its original color if already highlighted) and synchronizes the atom table selection.
- Parameters:
- indexint
Picked block index (1-based) within the composite mesh’s block attributes.
- datasetpyvista.DataSet
Picked dataset block, as provided by the block-picking callback (unused).
- load_CIF_file_dialog()[source]#
Open a file dialog to select a CIF file to load.
- Returns:
- filenamestr
Path to the selected
.ciffile, or an empty string if the dialog was cancelled.
- save_INS_file_dialog()[source]#
Open a file dialog to select a destination INS file.
- Returns:
- filenamestr
Path to the selected
.insfile, or an empty string if the dialog was cancelled.
- set_absorption_parameters(abs_dict)[source]#
Populate the scattering/absorption and material property fields.
- Parameters:
- abs_dictdict
Dictionary with keys “sigma_a”, “sigma_s”, “mu_a”, “mu_s”, “N”, “M”, “n”, “rho”, “V”, and “m” giving the absorption and scattering cross sections, linear coefficients, number of atoms, molar mass, number density, mass density, volume, and mass, respectively.
- set_absorption_results(hkls, ds, Ts, Tbars)[source]#
Repopulate the absorption results table.
- Parameters:
- hklsiterable of array-like
Miller indices (h, k, l) for each reflection.
- dsiterable of float
d-spacing (Å) for each reflection.
- Tsiterable of float
Transmission for each reflection (NaN if unreachable at the chosen wavelength).
- Tbarsiterable of float
Absorption-weighted path length (cm) for each reflection (NaN if unreachable at the chosen wavelength).
- set_absorption_shape_constants(params)[source]#
Populate the ellipsoid dimension fields.
- Parameters:
- paramslist of float
Thickness, width, and height values (mm), in that order.
- set_atom(scatterer)[source]#
Populate the atom entry fields.
- Parameters:
- scattererlist
Atom label followed by x, y, z, occupancy, and Uiso values, in that order.
- set_atom_table()[source]#
Apply the atom entry fields to the currently selected row.
Reads the x, y, z, occupancy, and Uiso line edits and, if they all contain valid input and a row is selected, writes the values, together with the current isotope button label, into that row of the atom site table.
- set_crystal_system(crystal_system)[source]#
Select a crystal system in the combo box.
- Parameters:
- crystal_systemstr
Name of the crystal system to select.
- set_equivalents(hkls, d, F2)[source]#
Repopulate the structure factor table with symmetry equivalents.
Unlike
set_factors(), all rows share the same d-spacing and squared structure factor since they are symmetry equivalents of a single reflection.- Parameters:
- hklsiterable of array-like
Miller indices (h, k, l) for each symmetry-equivalent reflection.
- dfloat
d-spacing (Å) shared by all the equivalent reflections.
- F2float
Squared structure factor shared by all the equivalent reflections.
- set_factors(hkls, ds, F2s)[source]#
Repopulate the structure factor table.
- Parameters:
- hklsiterable of array-like
Miller indices (h, k, l) for each reflection.
- dsiterable of float
d-spacing (Å) for each reflection.
- F2siterable of float
Squared structure factor for each reflection.
- set_formula_z(chemical_formula, z_parameter)[source]#
Populate the chemical formula and Z fields.
- Parameters:
- chemical_formulastr
Chemical formula of the unit cell.
- z_parameterint or float
Number of formula units per unit cell (Z).
- set_isotope(isotope)[source]#
Set the isotope/atom button label.
- Parameters:
- isotopestr
Isotope or element label to display on the button.
- set_lattice_constants(params)[source]#
Populate the lattice parameter fields.
- Parameters:
- paramslist of float
Lattice constants a, b, c (Å) and angles alpha, beta, gamma (degrees), in that order.
- set_material_display(chemical_formula, z_parameter, volume)[source]#
Populate the (read-only) absorption-tab material fields.
- Parameters:
- chemical_formulastr
Chemical formula, as returned by the model’s
get_chemical_formula_z_parameter.- z_parameterfloat
Number of formula units per unit cell.
- volumefloat
Unit cell volume (Å^3).
- set_scatterer(row, scatterer)[source]#
Populate a row of the atom site table.
- Parameters:
- rowint
Row index in the atom site table.
- scattererlist
Atom label followed by x, y, z, occupancy, and Uiso values, in that order.
- set_scatterers(scatterers)[source]#
Repopulate the atom site table.
- Parameters:
- scattererslist
List of atom site entries, each as accepted by
set_scatterer().
- set_setting(setting)[source]#
Select a space group setting in the combo box.
- Parameters:
- settingstr
Space group setting identifier to select.
- set_space_group(space_group)[source]#
Select a space group in the combo box.
- Parameters:
- space_groupstr
Space group identifier to select.
- set_unit_cell_volume(vol)[source]#
Populate the unit cell volume field.
- Parameters:
- volfloat
Unit cell volume (Å^3).
- structure_tab()[source]#
Build the “Structure” tab layout and widgets.
Constructs the lattice parameter fields, crystal system/space group/setting combo boxes, CIF load/INS save buttons, the atom site table, atom entry fields, and chemical formula display, and adds them to the tab widget.
- class ExperimentView(parent=None)[source]#
Bases:
NeuXtalVizWidgetView for experiment planning and peak visualization in NeuXtalViz.
Provides user interface elements for experiment setup, coverage analysis, peak calculation, and plan management.
- Attributes:
paintersushort
Methods
acceptDrops(self, /)accessibleDescription(self, /)accessibleIdentifier(self, /)accessibleName(self, /)actionEvent(self, event, /)actions(self, /)activateWindow(self, /)addAction(...)addActions(self, actions, /)add_instrument(inst_dict)Render the instrument geometry in the 3D scene.
add_orientations(title, comment, angles_list)Append new orientation rows to the plan table.
add_peaks(peak_dict)Render the reciprocal-space coverage point cloud in the 3D scene.
add_settings(titles, settings, comments, ...)Replace the plan table contents with a full set of loaded settings.
adjustSize(self, /)append_to_console(text)Append a line of text to the console output widget.
autoFillBackground(self, /)auto_scale_dropdown(combo)Autoscale a combobox width to fit text plus any icons/checks.
axes_show()State of axes.
backgroundRole(self, /)backingStore(self, /)baseSize(self, /)blockSignals(self, b, /)calculate_mesh_step(item)Automatically calculate step size based on min, max, and angle.
changeEvent(self, event, /)change_projection()Enable or disable parallel projection.
childAt(...)childEvent(self, event, /)children(self, /)childrenRect(self, /)childrenRegion(self, /)clearFocus(self, /)clearMask(self, /)clear_scene()Clear plane widgets and actors from the plotter.
close(self, /)closeEvent(self, event, /)colorCount(self, /)connect(...)connectNotify(self, signal, /)connect_add_orientation(add_orientation)Connect the "Add Orientation" button to adding a peak orientation.
connect_add_plane(add_plane)Connect the "Add Plane" button to adding a plane scan to the plan.
connect_az(left, right)Connect Azimuth to presenter handler.
connect_calculate_double(calculate_double)Connect the "Simultaneous" button to a two-peak calculation.
connect_calculate_plane(calculate_plane)Connect the "Calculate Plane" button to previewing plane coverage.
connect_calculate_single(calculate_single)Connect the "Individual" button for the first peak to a single HKL calculation.
connect_calculate_single_alt(calculate_single)Connect the "Individual" button for the second peak to a single HKL calculation.
connect_camera_ready(calculate)Connect a callback to the
cam_readysignal.connect_color_scheme(update_color_scheme)Connect the color scheme combo box to a visualization refresh.
connect_combined(update_combined)Connect the "Combine All" checkbox to the visualization update.
connect_convert_mesh_to_hkl(convert_to_hkl)Connect the "Calculate Mesh" button to convert a mesh scan to HKL.
connect_convert_plan_to_hkl(convert_to_hkl)Connect the "Calculate Plan" button to convert a plane scan to HKL.
connect_delete_angles(delete_angles)Connect the "Delete Highlighted" button to removing plan rows.
connect_elev(up, down)Connect Elevate to presenter handler.
connect_harmonic_ready(lookup)Connect a slot to the view's
harm_readysignal.connect_highlight_angles(highlight_angles)Connect the "Highlight All" button to selecting all plan rows.
connect_hkl_limits(update_hkl_limits)Connect editing of the minimum d-spacing field to updating the HKL limits.
connect_load_UB(load_UB)Connect the "Load UB" button to loading a UB matrix file.
connect_load_detector(load_detector_cal)Connect the "Detector" browse button to loading a detector calibration file.
connect_load_experiment(load_experiment)Connect the "Load Experiment" button to loading a saved experiment.
connect_load_goniometer(load_goniometer_cal)Connect the "Goniometer" browse button to loading a goniometer calibration file.
connect_load_mask(load_mask)Connect the "Mask" browse button to loading a detector mask file.
connect_manual_axis(view_manual)Manual axis view connection.
connect_manual_up_axis(view_manual)Manual axis up view connection.
connect_mesh(mesh)Connect the "Add Mesh" button to adding a mesh scan to the plan.
connect_move_down(move_down)Connect the "Move Down" button to moving an orientation down in the plan.
connect_move_up(move_up)Connect the "Move Up" button to moving an orientation up in the plan.
connect_optimize(optimize)Connect the "Optimize Coverage" button to the coverage optimizer.
connect_peak_row_highlighter(highlight_row)Connect peaks-table row selection to highlighting the peak.
connect_peak_table(update_table)Connect selecting an orientation in the settings combo box to updating the peaks table.
connect_real_axes(view_a, view_b, view_c)Real axes view connections.
connect_reciprocal_axes(view_a_star, ...)Reciprocal axes view connections.
connect_reciprocal_real_compass(change_lattice)Reciprocal/real axis compass
connect_reset(reset)Connect the "Recalculate Coverage" button to resetting settings.
connect_roi_ready(lookup)Connect a slot to the view's
roi_readysignal.connect_rotate(cww, cw)Connect Roll to presenter handler.
connect_save_CSV(save_CSV)Connect the "Save CSV" button to saving the experiment plan.
connect_save_experiment(save_experiment)Connect the "Save Experiment" button to saving the experiment.
connect_save_screenshot(save_screenshot)Screenshot connection.
connect_selection_ready(lookup)Connect a slot to the view's
sel_readysignal.connect_show_instrument(show)Connect the "Show Instrument" button to displaying the instrument.
connect_slice_combo(update_slice)Connect the slice axis combo box to a slice update.
connect_slice_line(update_slice)Connect editing of the slice value field to a slice update.
connect_slice_thickness_line(update_slice)Connect editing of the slice thickness field to a slice update.
connect_stop(stop)Connect stop button to presenter callback.
connect_switch_crystal(switch_crystal)Connect the crystal system combo box to updating point groups.
connect_switch_instrument(switch_instrument)Connect the instrument combo box to updating instrument parameters.
Connect the lattice centering combo box to a visualization refresh.
connect_switch_point_group(switch_group)Connect the point group combo box to updating lattice centerings.
connect_update(update)Connect the "Update Highlighted" button to refreshing counting values.
connect_update_goniometer(update_goniometer)Connect the goniometer mode combo box to updating the goniometer and motor tables.
connect_visualization_ready(visualize)Connect a slot to the view's
viz_readysignal.connect_wavelength(update_wavelength)Connect editing of the minimum wavelength field to a wavelength update.
contentsMargins(self, /)contentsRect(self, /)contextMenuEvent(self, event, /)contextMenuPolicy(self, /)Build the "Coverage" tab.
create(self, /[, arg__1, initializeWindow, ...])createWinId(self, /)createWindowContainer(window, /[, parent, flags])cursor(self, /)customEvent(self, event, /)deleteLater(self, /)delete_angles(rows)Remove the given rows from the plan table.
depth(self, /)destroy(self, /[, destroyWindow, ...])devType(self, /)devicePixelRatio(self, /)devicePixelRatioF(self, /)devicePixelRatioFScale()disconnect(...)disconnectNotify(self, signal, /)dragEnterEvent(self, event, /)dragLeaveEvent(self, event, /)dragMoveEvent(self, event, /)draw_all()Get whether all active orientations should be combined for display.
dropEvent(self, event, /)dumpObjectInfo(self, /)dumpObjectTree(self, /)dynamicPropertyNames(self, /)effectiveWinId(self, /)emit(self, signal, /, *args)encodeMetricF(metric, value, /)ensurePolished(self, /)enterEvent(self, event, /)event(self, event, /)eventFilter(self, watched, event, /)find(arg__1, /)findChild(self, type, /[, name, options])findChildren() -> List[~PlaceholderType] ))focusInEvent(self, event, /)focusNextChild(self, /)focusNextPrevChild(self, next, /)focusOutEvent(self, event, /)focusPolicy(self, /)focusPreviousChild(self, /)focusProxy(self, /)focusWidget(self, /)font(self, /)fontInfo(self, /)fontMetrics(self, /)foregroundRole(self, /)frameGeometry(self, /)frameSize(self, /)geometry(self, /)Get the names of all goniometer axes.
Get the comment text of every plan row.
Get the selected counting method of every plan row.
Get the full goniometer angle settings of every plan row.
Get the scan title of every plan row.
Get the counting value of every plan row.
get_angle_setting(row)Get the free-axis angle values for a plan row.
Get the currently displayed goniometer angles.
Prepare the plan table for row deletion and get the selected rows.
get_camera_roll_direction()Get the current camera roll angle and view direction.
get_camera_state()Return the current camera position, focal point, and up vectors.
Get the selected coverage color scheme.
Get the currently displayed comment/label.
Get the counting value (e.g., time or monitor count).
Get the index of the selected counting method.
Get all counting method options currently in the combo box.
Get the selected crystal system.
get_d()Get the primary reflection's d-spacing.
Get the alternate reflection's d-spacing.
Get the minimum d-spacing.
Get the path to the detector calibration file.
Get the names of the free (non-fixed) goniometer axes shown as plan table columns.
Get the path to the goniometer calibration file.
Get the goniometer axis limits from the goniometer table.
Get the primary reflection's horizontal (gamma) detector angle.
Get the alternate reflection's horizontal (gamma) detector angle.
Get the two user-entered HKL triplets.
Get the currently selected instrument.
Get the primary reflection's intersecting wavelength.
Get the alternate reflection's intersecting wavelength.
Get the selected lattice centering.
get_manual_axis_indices()Indices of manually entered direction components.
get_manual_axis_up_indices()Indices of manually entered direction up components.
get_mask()Get the path to the detector mask file.
Get the goniometer limits and number of angle steps for the mesh scan.
get_mode()Get the selected goniometer mode.
Get the current motor/log settings from the motor table.
Get the number of orientations currently in the plan.
Get whether each plan row originated from the CrystalPlan optimizer.
Get the "Use" checkbox state for every plan row.
get_peak()Get the peak index of the currently selected peaks-table row.
Get the plan row index selected in the orientation combo box.
Get the full goniometer angle settings for each plan row marked "in use".
Get the first (u) in-plane HKL vector for the scattering plane.
Get the second (v) in-plane HKL vector for the scattering plane.
Get the total angular coverage to sweep about the plane normal.
Get the number of orientations to sample across the plane coverage.
Get the selected point group.
Get the user-entered U/V/W projection matrix.
get_rotate_step()Return the rotation step in degrees from the rotate tab.
Get the single selected plan row, preparing the table for an update.
Get the row indices currently selected in the plan table.
Get the number of settings requested for coverage optimization.
Get the selected slice plane.
Get the slice thickness along the slice normal.
Get the slice position along the slice normal.
Get the scan title.
Get the primary reflection's vertical (nu) detector angle.
Get the alternate reflection's vertical (nu) detector angle.
Get the wavelength band.
grab(self, /[, rectangle])grabGesture(self, type, /[, flags])grabKeyboard(self, /)grabMouse(-> None)grabShortcut(self, key, /[, context])graphicsEffect(self, /)graphicsProxyWidget(self, /)handle_item_changed(item)Propagate a checkbox change to all selected rows in the plan table.
hasFocus(self, /)hasHeightForWidth(self, /)hasMouseTracking(self, /)hasTabletTracking(self, /)height(self, /)heightForWidth(self, arg__1, /)heightMM(self, /)hide(self, /)hideEvent(self, event, /)Select all rows in the plan table and give it keyboard focus.
highlight_peak(row)Select the peaks-table row corresponding to a given peak index.
inherits(self, classname, /)initPainter(self, painter, /)inputMethodEvent(self, event, /)inputMethodHints(self, /)inputMethodQuery(self, arg__1, /)insertAction(self, before, action, /)insertActions(self, before, actions, /)installEventFilter(self, filterObj, /)internalWinId(self, /)isActiveWindow(self, /)isAncestorOf(self, child, /)isEnabled(self, /)isEnabledTo(self, arg__1, /)isFullScreen(self, /)isHidden(self, /)isLeftToRight(self, /)isMaximized(self, /)isMinimized(self, /)isModal(self, /)isQmlExposed(self, /)isQuickItemType(self, /)isRightToLeft(self, /)isSignalConnected(self, signal, /)isTopLevel(self, /)isVisible(self, /)isVisibleTo(self, arg__1, /)isWidgetType(self, /)isWindow(self, /)isWindowModified(self, /)isWindowType(self, /)keyPressEvent(self, event, /)keyReleaseEvent(self, event, /)keyboardGrabber()killTimer(-> None)layout(self, /)layoutDirection(self, /)leaveEvent(self, event, /)load_UB_file_dialog([path])Open a file dialog to select a UB matrix file.
load_detector_cal_dialog([path])Open a file dialog to select a detector calibration file.
load_experiment_file_dialog([path])Open a file dialog to select a saved experiment (NeXus) file.
load_goniometer_cal_dialog([path])Open a file dialog to select a goniometer calibration file.
load_mask_dialog([path])Open a file dialog to select a detector mask file.
locale(self, /)logicalDpiX(self, /)logicalDpiY(self, /)lower(self, /)mapFrom(-> PySide6.QtCore.QPoint)mapFromGlobal(-> PySide6.QtCore.QPoint)mapFromParent(-> PySide6.QtCore.QPoint)mapTo(-> PySide6.QtCore.QPoint)mapToGlobal(-> PySide6.QtCore.QPoint)mapToParent(-> PySide6.QtCore.QPoint)mask(self, /)maximumHeight(self, /)maximumSize(self, /)maximumWidth(self, /)mesh_tab()Build the "Mesh" tab.
metaObject(self, /)metric(self, arg__1, /)minimumHeight(self, /)minimumSize(self, /)minimumSizeHint(self, /)minimumWidth(self, /)mouseDoubleClickEvent(self, event, /)mouseGrabber()mouseMoveEvent(self, event, /)mousePressEvent(self, event, /)mouseReleaseEvent(self, event, /)move(-> None)moveEvent(self, event, /)moveToThread(self, thread, /)nativeEvent(self, eventType, message, /)nativeParentWidget(self, /)nextInFocusChain(self, /)normalGeometry(self, /)objectName(self, /)on_press_inst(event)Handle a mouse click on the instrument coverage plot.
on_press_laue(event)Handle a mouse click on the Laue diffraction plot.
overrideWindowFlags(self, type, /)overrideWindowState(self, state, /)paintEngine(self, /)paintEvent(self, event, /)paintingActive(self, /)palette(self, /)parent(self, /)parentWidget(self, /)peak_tab()Build the "Peaks" tab.
physicalDpiX(self, /)physicalDpiY(self, /)plot_harmonics(hkls, lamdas)Plot harmonic reflections for the primary reflection.
plot_harmonics_alternate(hkls, lamdas)Plot harmonic reflections for the alternate reflection.
plot_instrument(inst_background, gamma, nu, ...)Plot single-reflection coverage on the instrument view.
plot_instrument_alternate(inst_background, ...)Plot simultaneous two-reflection coverage on the instrument view.
plot_laue(gamma_laue, nu_laue, gamma, nu, ...)Plot the Laue-diffraction peak positions.
plot_statistics(sym, asym, cumsym, cumasym)Plot per-shell and cumulative completeness/redundancy statistics.
pos(self, /)previousInFocusChain(self, /)property(self, name, /)raise_(self, /)receivers(self, signal, /)reciprocal_lattice()State of reciprocal lattice vectors.
rect(self, /)redirected(self, offset, /)releaseKeyboard(self, /)releaseMouse(self, /)releaseShortcut(self, id, /)removeAction(self, action, /)removeEventFilter(self, obj, /)render(, sourceRegion, renderFlags, renderFlags)repaint(-> None -> None -> None)reset_camera()Reset the camera.
reset_scene()Restore the cached camera position, or reset the view.
reset_view([negative])Reset the view to the default isometric orientation.
resize(-> None)resizeEvent(self, event, /)restoreGeometry(self, geometry, /)saveGeometry(self, /)save_CSV_file_dialog([path])Open a file dialog to choose where to save the experiment plan as a CSV file.
save_experiment_file_dialog([path])Open a file dialog to choose where to save the experiment as a NeXus file.
save_screenshot(filename)Save plotter screenshot.
save_screenshot_file_dialog()Prompt the user to choose a PNG file path for a screenshot.
screen(self, /)scroll(-> None)sender(self, /)senderSignalIndex(self, /)setAcceptDrops(self, on, /)setAccessibleDescription(self, description, /)setAccessibleIdentifier(self, identifier, /)setAccessibleName(self, name, /)setAttribute(self, arg__1, /[, on])setAutoFillBackground(self, enabled, /)setBackgroundRole(self, arg__1, /)setBaseSize(-> None)setContentsMargins(-> None)setContextMenuPolicy(self, policy, /)setCursor(self, arg__1, /)setDisabled(self, arg__1, /)setEnabled(self, arg__1, /)setFixedHeight(self, h, /)setFixedSize(-> None)setFixedWidth(self, w, /)setFocus(-> None)setFocusPolicy(self, policy, /)setFocusProxy(self, arg__1, /)setFont(self, arg__1, /)setForegroundRole(self, arg__1, /)setGeometry(-> None)setGraphicsEffect(self, effect, /)setHidden(self, hidden, /)setInputMethodHints(self, hints, /)setLayout(self, arg__1, /)setLayoutDirection(self, direction, /)setLocale(self, locale, /)setMask(-> None)setMaximumHeight(self, maxh, /)setMaximumSize(-> None)setMaximumWidth(self, maxw, /)setMinimumHeight(self, minh, /)setMinimumSize(-> None)setMinimumWidth(self, minw, /)setMouseTracking(self, enable, /)setObjectName(self, name, /)setPalette(self, arg__1, /)setParent(-> None)setProperty(self, name, value, /)setScreen(self, arg__1, /)setShortcutAutoRepeat(self, id, /[, enable])setShortcutEnabled(self, id, /[, enable])setSizeIncrement(-> None)setSizePolicy(-> None)setStatusTip(self, arg__1, /)setStyle(self, arg__1, /)setStyleSheet(self, styleSheet, /)setTabOrder(arg__1, arg__2, /)setTabletTracking(self, enable, /)setToolTip(self, arg__1, /)setToolTipDuration(self, msec, /)setUpdatesEnabled(self, enable, /)setVisible(self, visible, /)setWhatsThis(self, arg__1, /)setWindowFilePath(self, filePath, /)setWindowFlag(self, arg__1, /[, on])setWindowFlags(self, type, /)setWindowIcon(self, icon, /)setWindowIconText(self, arg__1, /)setWindowModality(self, windowModality, /)setWindowModified(self, arg__1, /)setWindowOpacity(self, level, /)setWindowRole(self, arg__1, /)setWindowState(self, state, /)setWindowTitle(self, arg__1, /)set_angles(values)Display the goniometer angles for the looked-up setting.
set_camera_state(position, focal_point, up)Apply a new camera state to the underlying plotter and refresh.
set_comment(values)Display the comment/label associated with the looked-up setting.
set_counting_options(options)Populate the counting method combo box.
set_crystal_system(crystal_system)Select a crystal system in the crystal system combo box.
set_d(val)Set the primary reflection's d-spacing.
set_d_alternate(val)Set the alternate reflection's d-spacing.
set_d_min(d_min)Set the minimum d-spacing field.
Reset the crystal system, point group, and lattice centering combo boxes to their default selections.
set_detector_calibration(filename)Set the path to the detector calibration file.
set_goniometer_calibration(filename)Set the path to the goniometer calibration file.
set_goniometer_limits(limits)Set the goniometer axis limits in the goniometer table.
set_hkl_limits(h_max, k_max, l_max)Display the maximum h, k, l indices reachable at the current minimum d-spacing.
set_horizontal(val)Set the primary reflection's horizontal (gamma) detector angle.
Set the alternate reflection's horizontal (gamma) detector angle.
set_info(status)Update status information.
set_instrument(instrument)Set the selected instrument.
set_intersect(val)Set the primary reflection's intersecting wavelength.
Set the alternate reflection's intersecting wavelength.
set_item_value(value[, row])Build a numeric table item tagged with its originating row.
set_lattice_centering(lattice_centering)Select a lattice centering in the lattice centering combo box.
set_lattice_centerings(centerings)Populate the lattice centering combo box.
set_mask(filename)Set the path to the detector mask file.
set_mode(mode)Select a goniometer mode in the mode combo box.
set_modes(modes)Populate the goniometer mode combo box.
set_motors(values)Set the motor/log values in the motor table.
set_oriented_lattice_parameters(a, b, c, ...)Update the oriented lattice paramters.
set_peak(row, peak)Populate a single row of the peaks table.
set_peak_list(rows)Repopulate the orientation selection combo box for the plan.
set_point_group(point_group)Select a point group in the point group combo box.
set_point_groups(groups)Populate the point group combo box.
set_position(pos)Set the position.
set_step(progress)Update progress step.
set_transform(T)Apply a transform to the axes.
set_vertical(val)Set the primary reflection's vertical (nu) detector angle.
Set the alternate reflection's vertical (nu) detector angle.
set_wavelength(wavelength)Set the minimum and maximum wavelength fields.
sharedPainter(self, /)show(self, /)showEvent(self, event, /)showFullScreen(self, /)showMaximized(self, /)showMinimized(self, /)showNormal(self, /)show_axes()Show or hide the coordinate axes actor in the plotter.
signalsBlocked(self, /)size(self, /)sizeHint(self, /)sizeIncrement(self, /)sizePolicy(self, /)stackUnder(self, arg__1, /)startTimer(self, interval, /[, timerType])start_worker_pool(worker)Connect a worker's output to the console and start it.
statusTip(self, /)stop_processes()Stop all running worker processes.
stop_processing(stop_event)Check if a stop has been requested.
style(self, /)styleSheet(self, /)swap_angles(rows)Swap the contents of two rows in the plan table.
tabletEvent(self, event, /)testAttribute(self, arg__1, /)thread(self, /)timerEvent(self, event, /)toggle_console(state)Show or hide the console output widget.
toolTip(self, /)toolTipDuration(self, /)topLevelWidget(self, /)tr(self, sourceText, /[, disambiguation, n])underMouse(self, /)ungrabGesture(self, type, /)unsetCursor(self, /)unsetLayoutDirection(self, /)unsetLocale(self, /)update(-> None -> None -> None)updateGeometry(self, /)updateMicroFocus(self, /[, query])update_camera_display(roll, elevation, azimuth)Update the read-only camera orientation display, if present.
Apply the current title, counting method, and count value to the selected plan rows.
Redraw the crosshair markers on the instrument coverage plot.
update_labels()Change the axes labels between Miller and fractional notation.
update_laue(horz, vert, lamdas, hkl, lamda_0)Highlight the selected peak on the Laue and harmonics plots.
update_limits(item)Propagate an edited goniometer limit to the matching mesh table row.
update_peaks_table(peaks)Repopulate the peaks table.
update_slice(slice_dict)Redraw the reciprocal-space slice plot.
update_tables(title, goniometers, motors)Rebuild the goniometer, motor, plan, and mesh tables.
update_theme()Apply the selected PyVista/matplotlib plot theme to the view.
update_wavelength(lamda_min)Mirror the minimum wavelength into the maximum wavelength field when the instrument is monochromatic.
updatesEnabled(self, /)Get whether symmetry-equivalent HKLs should be included.
Get whether symmetry should be applied.
Get whether symmetry should be applied to the mesh scan/plane.
view_up_vector(vec)Set the camera according to given vector(s).
view_vector(vecs)Set the camera according to given vector(s).
view_xy()View \(xy\)-plane.
view_xz()View \(xz\)-plane.
view_yx()View \(yx\)-plane.
view_yz()View \(yz\)-plane.
view_zx()View \(zx\)-plane.
view_zy()View \(zy\)-plane.
visibleRegion(self, /)whatsThis(self, /)wheelEvent(self, event, /)width(self, /)widthMM(self, /)winId(self, /)window(self, /)windowFilePath(self, /)windowFlags(self, /)windowHandle(self, /)windowIcon(self, /)windowIconText(self, /)windowModality(self, /)windowOpacity(self, /)windowRole(self, /)windowState(self, /)windowTitle(self, /)windowType(self, /)worker(task)Wrap a callable as a background
Workertask.x(self, /)y(self, /)PaintDeviceMetric
RenderFlag
cam_ready
customContextMenuRequested
destroyed
harm_ready
log_output
objectNameChanged
roi_ready
sel_ready
viz_ready
windowIconChanged
windowIconTextChanged
windowTitleChanged
- add_instrument(inst_dict)[source]#
Render the instrument geometry in the 3D scene.
Clears the scene and draws the instrument mesh along with coordinate axis lines, an arrow indicating the beam direction, and a legend scale.
- Parameters:
- inst_dictdict
Dictionary with keys
"points"and"faces"describing the instrument mesh geometry, and"radius"giving the(rx, ry, rz)extents of the axis lines.
- add_orientations(title, comment, angles_list)[source]#
Append new orientation rows to the plan table.
Adds one row per entry in angles_list, filling in the title, angle values, comment, a counting-method combo box (matching the current selection), the current count value, and a checked “Use” checkbox.
- Parameters:
- titlestr
Scan title for the new rows.
- commentstr
Comment text for the new rows.
- angles_listlist of list of float
One list of free-axis angle values per new row.
- add_peaks(peak_dict)[source]#
Render the reciprocal-space coverage point cloud in the 3D scene.
Clears the scene and, if data is given, plots the peak/coverage points colored per
peak_dict, the (100)/(010)/(001) axis arrows and a central sphere, and reciprocal-space axis lines scaled toaxis_limit.- Parameters:
- peak_dictdict or None
Dictionary with keys
"coords","colors","type","axis_coords","axis_colors", and"axis_limit"as produced by the model’s coverage calculation. If None, the scene is simply reset.
- add_settings(titles, settings, comments, counts, values, use)[source]#
Replace the plan table contents with a full set of loaded settings.
Used when restoring a saved experiment plan: clears the table and repopulates it row by row with the given titles, angle settings, comments, counting methods, count values, and “Use” checkbox states.
- Parameters:
- titleslist of str
Scan title for each row.
- settingslist of list of float
Free-axis angle values for each row.
- commentslist of str
Comment text for each row.
- countslist of str
Counting method for each row.
- valueslist of float
Counting value for each row.
- uselist of bool
“Use” checkbox state for each row.
- calculate_mesh_step(item)[source]#
Automatically calculate step size based on min, max, and angle.
- Parameters:
- itemQTableWidgetItem
Edited cell in the mesh table (min, max, or number-of-angles column) that triggered the recalculation.
- connect_add_orientation(add_orientation)[source]#
Connect the “Add Orientation” button to adding a peak orientation.
- Parameters:
- add_orientationcallable
Handler invoked when the button is clicked.
- connect_add_plane(add_plane)[source]#
Connect the “Add Plane” button to adding a plane scan to the plan.
- Parameters:
- add_planecallable
Handler invoked when the button is clicked.
- connect_calculate_double(calculate_double)[source]#
Connect the “Simultaneous” button to a two-peak calculation.
- Parameters:
- calculate_doublecallable
Handler invoked when the button is clicked.
- connect_calculate_plane(calculate_plane)[source]#
Connect the “Calculate Plane” button to previewing plane coverage.
- Parameters:
- calculate_planecallable
Handler invoked when the button is clicked.
- connect_calculate_single(calculate_single)[source]#
Connect the “Individual” button for the first peak to a single HKL calculation.
- Parameters:
- calculate_singlecallable
Handler invoked when the button is clicked.
- connect_calculate_single_alt(calculate_single)[source]#
Connect the “Individual” button for the second peak to a single HKL calculation.
- Parameters:
- calculate_singlecallable
Handler invoked when the button is clicked.
- connect_color_scheme(update_color_scheme)[source]#
Connect the color scheme combo box to a visualization refresh.
- Parameters:
- update_color_schemecallable
Handler invoked when the color scheme selection changes.
- connect_combined(update_combined)[source]#
Connect the “Combine All” checkbox to the visualization update.
- Parameters:
- update_combinedcallable
Handler invoked when the combined-peaks toggle changes.
- connect_convert_mesh_to_hkl(convert_to_hkl)[source]#
Connect the “Calculate Mesh” button to convert a mesh scan to HKL.
- Parameters:
- convert_to_hklcallable
Handler invoked when the mesh-to-HKL conversion is requested.
- connect_convert_plan_to_hkl(convert_to_hkl)[source]#
Connect the “Calculate Plan” button to convert a plane scan to HKL.
- Parameters:
- convert_to_hklcallable
Handler invoked when the plan-to-HKL conversion is requested.
- connect_delete_angles(delete_angles)[source]#
Connect the “Delete Highlighted” button to removing plan rows.
- Parameters:
- delete_anglescallable
Handler invoked when the button is clicked.
- connect_harmonic_ready(lookup)[source]#
Connect a slot to the view’s
harm_readysignal.- Parameters:
- lookupcallable
Slot to invoke when the harmonics should be recalculated.
- connect_highlight_angles(highlight_angles)[source]#
Connect the “Highlight All” button to selecting all plan rows.
- Parameters:
- highlight_anglescallable
Handler invoked when the button is clicked.
- connect_hkl_limits(update_hkl_limits)[source]#
Connect editing of the minimum d-spacing field to updating the HKL limits.
- Parameters:
- update_hkl_limitscallable
Handler invoked when the minimum d-spacing value is edited.
- connect_load_UB(load_UB)[source]#
Connect the “Load UB” button to loading a UB matrix file.
- Parameters:
- load_UBcallable
Handler invoked when the button is clicked.
- connect_load_detector(load_detector_cal)[source]#
Connect the “Detector” browse button to loading a detector calibration file.
- Parameters:
- load_detector_calcallable
Handler invoked when the button is clicked.
- connect_load_experiment(load_experiment)[source]#
Connect the “Load Experiment” button to loading a saved experiment.
- Parameters:
- load_experimentcallable
Handler invoked when the button is clicked.
- connect_load_goniometer(load_goniometer_cal)[source]#
Connect the “Goniometer” browse button to loading a goniometer calibration file.
- Parameters:
- load_goniometer_calcallable
Handler invoked when the button is clicked.
- connect_load_mask(load_mask)[source]#
Connect the “Mask” browse button to loading a detector mask file.
- Parameters:
- load_maskcallable
Handler invoked when the button is clicked.
- connect_mesh(mesh)[source]#
Connect the “Add Mesh” button to adding a mesh scan to the plan.
- Parameters:
- meshcallable
Handler invoked when the button is clicked.
- connect_move_down(move_down)[source]#
Connect the “Move Down” button to moving an orientation down in the plan.
- Parameters:
- move_downcallable
Handler invoked when the button is clicked.
- connect_move_up(move_up)[source]#
Connect the “Move Up” button to moving an orientation up in the plan.
- Parameters:
- move_upcallable
Handler invoked when the button is clicked.
- connect_optimize(optimize)[source]#
Connect the “Optimize Coverage” button to the coverage optimizer.
- Parameters:
- optimizecallable
Handler invoked when the button is clicked.
- connect_peak_row_highlighter(highlight_row)[source]#
Connect peaks-table row selection to highlighting the peak.
- Parameters:
- highlight_rowcallable
Handler invoked when the table selection changes.
- connect_peak_table(update_table)[source]#
Connect selecting an orientation in the settings combo box to updating the peaks table.
- Parameters:
- update_tablecallable
Handler invoked when an orientation is selected.
- connect_reset(reset)[source]#
Connect the “Recalculate Coverage” button to resetting settings.
- Parameters:
- resetcallable
Handler invoked when the button is clicked.
- connect_roi_ready(lookup)[source]#
Connect a slot to the view’s
roi_readysignal.- Parameters:
- lookupcallable
Slot to invoke with the
(gamma, nu)coordinates of a click on the instrument coverage plot.
- connect_save_CSV(save_CSV)[source]#
Connect the “Save CSV” button to saving the experiment plan.
- Parameters:
- save_CSVcallable
Handler invoked when the button is clicked.
- connect_save_experiment(save_experiment)[source]#
Connect the “Save Experiment” button to saving the experiment.
- Parameters:
- save_experimentcallable
Handler invoked when the button is clicked.
- connect_selection_ready(lookup)[source]#
Connect a slot to the view’s
sel_readysignal.- Parameters:
- lookupcallable
Slot to invoke with the
(gamma, nu)coordinates of a click on the Laue diffraction plot.
- connect_show_instrument(show)[source]#
Connect the “Show Instrument” button to displaying the instrument.
- Parameters:
- showcallable
Handler invoked when the button is clicked.
- connect_slice_combo(update_slice)[source]#
Connect the slice axis combo box to a slice update.
- Parameters:
- update_slicecallable
Handler invoked when the slice axis selection changes.
- connect_slice_line(update_slice)[source]#
Connect editing of the slice value field to a slice update.
- Parameters:
- update_slicecallable
Handler invoked when the slice value is edited.
- connect_slice_thickness_line(update_slice)[source]#
Connect editing of the slice thickness field to a slice update.
- Parameters:
- update_slicecallable
Handler invoked when the slice thickness value is edited.
- connect_switch_crystal(switch_crystal)[source]#
Connect the crystal system combo box to updating point groups.
- Parameters:
- switch_crystalcallable
Handler invoked when the crystal system selection changes.
- connect_switch_instrument(switch_instrument)[source]#
Connect the instrument combo box to updating instrument parameters.
- Parameters:
- switch_instrumentcallable
Handler invoked when the instrument selection changes.
- connect_switch_lattice_centering(switch_centering)[source]#
Connect the lattice centering combo box to a visualization refresh.
- Parameters:
- switch_centeringcallable
Handler invoked when the lattice centering selection changes.
- connect_switch_point_group(switch_group)[source]#
Connect the point group combo box to updating lattice centerings.
- Parameters:
- switch_groupcallable
Handler invoked when the point group selection changes.
- connect_update(update)[source]#
Connect the “Update Highlighted” button to refreshing counting values.
- Parameters:
- updatecallable
Handler invoked when the button is clicked.
- connect_update_goniometer(update_goniometer)[source]#
Connect the goniometer mode combo box to updating the goniometer and motor tables.
- Parameters:
- update_goniometercallable
Handler invoked when the mode selection changes.
- connect_visualization_ready(visualize)[source]#
Connect a slot to the view’s
viz_readysignal.- Parameters:
- visualizecallable
Slot to invoke when the visualization should be refreshed.
- connect_wavelength(update_wavelength)[source]#
Connect editing of the minimum wavelength field to a wavelength update.
- Parameters:
- update_wavelengthcallable
Handler invoked when the minimum wavelength value is edited.
- coverage_tab()[source]#
Build the “Coverage” tab.
Creates the instrument/wavelength/symmetry selection widgets, UB-loading and instrument-display controls, the goniometer, motor, and plan tables, experiment save/load buttons, and the resolution/cumulative coverage plots. Adds the resulting tab to the main tab widget.
- delete_angles(rows)[source]#
Remove the given rows from the plan table.
- Parameters:
- rowslist of int
Row indices to remove from the plan table.
- draw_all()[source]#
Get whether all active orientations should be combined for display.
- Returns:
- usebool
True if the “Combine All” checkbox is checked.
- get_all_angles()[source]#
Get the names of all goniometer axes.
- Returns:
- angleslist of str
Goniometer axis names, in table row order.
- get_all_comments()[source]#
Get the comment text of every plan row.
- Returns:
- commentlist of str
Comment text for each plan row.
- get_all_countings()[source]#
Get the selected counting method of every plan row.
- Returns:
- countlist of str
Counting method text for each plan row (empty string if the row has no counting combo box widget).
- get_all_settings()[source]#
Get the full goniometer angle settings of every plan row.
- Returns:
- settingslist of list of float
Free-axis angle settings for each plan row.
- get_all_titles()[source]#
Get the scan title of every plan row.
- Returns:
- titlelist of str
Title text for each plan row.
- get_all_values()[source]#
Get the counting value of every plan row.
- Returns:
- valuelist of float
Counting value for each plan row (0.0 if not a valid number).
- get_angle_setting(row)[source]#
Get the free-axis angle values for a plan row.
- Parameters:
- rowint
Plan table row index.
- Returns:
- settinglist of float
Angle value for each free goniometer axis column.
- get_angles()[source]#
Get the currently displayed goniometer angles.
- Returns:
- angleslist of float
Goniometer angles (degrees) parsed from the angles field.
- get_angles_to_delete()[source]#
Prepare the plan table for row deletion and get the selected rows.
Blocks signals and disables updates/sorting on the plan table so the subsequent deletion is not disrupted, then reads the currently selected rows.
- Returns:
- rowslist of int
Sorted, unique row indices selected in the plan table.
- get_color_scheme()[source]#
Get the selected coverage color scheme.
- Returns:
- colorstr
Selected color scheme (“Sphere” or “Redundancy”).
- get_comment()[source]#
Get the currently displayed comment/label.
- Returns:
- commentstr
Text currently shown in the comment field.
- get_count_value()[source]#
Get the counting value (e.g., time or monitor count).
- Returns:
- valuefloat or None
Counting value, or None if the field does not contain a valid, acceptable value.
- get_counting_index()[source]#
Get the index of the selected counting method.
- Returns:
- indexint
Index of the selected item in the counting method combo box.
- get_counting_options()[source]#
Get all counting method options currently in the combo box.
- Returns:
- optionslist of str
Counting method options.
- get_crystal_system()[source]#
Get the selected crystal system.
- Returns:
- crystal_systemstr
Selected crystal system.
- get_d()[source]#
Get the primary reflection’s d-spacing.
- Returns:
- valfloat or None
d-spacing (Angstrom) entered in the d-spacing field, or None if the field does not contain valid input.
- get_d_alternate()[source]#
Get the alternate reflection’s d-spacing.
- Returns:
- valfloat or None
d-spacing (Angstrom) entered in the alternate d-spacing field, or None if the field is empty or does not contain valid input.
- get_d_min()[source]#
Get the minimum d-spacing.
- Returns:
- d_minfloat or None
Minimum d-spacing in Angstrom, or None if the field does not contain a valid, acceptable value.
- get_detector_calibration()[source]#
Get the path to the detector calibration file.
- Returns:
- filenamestr
Path to the detector calibration file.
- get_free_angles()[source]#
Get the names of the free (non-fixed) goniometer axes shown as plan table columns.
- Returns:
- angleslist of str
Full axis names stored as header tooltip data for each free angle column.
- get_goniometer_calibration()[source]#
Get the path to the goniometer calibration file.
- Returns:
- filenamestr
Path to the goniometer calibration file.
- get_goniometer_limits()[source]#
Get the goniometer axis limits from the goniometer table.
- Returns:
- limitslist
List of
[min, max]angle limits (degrees), one pair per goniometer axis row.
- get_horizontal()[source]#
Get the primary reflection’s horizontal (gamma) detector angle.
- Returns:
- valfloat or None
Gamma angle (degrees) entered in the horizontal field, or None if the field does not contain valid input.
- get_horizontal_alternate()[source]#
Get the alternate reflection’s horizontal (gamma) detector angle.
- Returns:
- valfloat or None
Gamma angle (degrees) entered in the alternate horizontal field, or None if the field is empty or does not contain valid input.
- get_input_hkls()[source]#
Get the two user-entered HKL triplets.
- Returns:
- params_1list of float or None
[h, k, l]from the first HKL entry fields, or None if the input is not valid/complete.- params_2list of float or None
[h, k, l]from the second HKL entry fields, or None if the input is not valid/complete.
- get_instrument()[source]#
Get the currently selected instrument.
- Returns:
- instrumentstr
Name of the instrument selected in the instrument combo box.
- get_intersect()[source]#
Get the primary reflection’s intersecting wavelength.
- Returns:
- valfloat or None
Wavelength (Angstrom) entered in the intersect field, or None if the field does not contain valid input.
- get_intersect_alternate()[source]#
Get the alternate reflection’s intersecting wavelength.
- Returns:
- valfloat or None
Wavelength (Angstrom) entered in the alternate intersect field, or None if the field is empty or does not contain valid input.
- get_lattice_centering()[source]#
Get the selected lattice centering.
- Returns:
- lattice_centeringstr
Selected lattice centering.
- get_mask()[source]#
Get the path to the detector mask file.
- Returns:
- filenamestr
Path to the detector mask file.
- get_mesh_angles()[source]#
Get the goniometer limits and number of angle steps for the mesh scan.
Reads the free-axis rows from the mesh table and overrides the corresponding entries in the full goniometer limits/step-count lists with the mesh-table values.
- Returns:
- limitslist of list of float
[min, max] limits for each goniometer axis.
- angleslist of int
Number of steps to sample for each goniometer axis (1 for axes not present in the mesh table).
- get_motors()[source]#
Get the current motor/log settings from the motor table.
- Returns:
- logsdict
Mapping of motor/log name to its current float value.
- get_number_of_orientations()[source]#
Get the number of orientations currently in the plan.
- Returns:
- rowsint
Number of rows in the plan table.
- get_optimized_settings()[source]#
Get whether each plan row originated from the CrystalPlan optimizer.
- Returns:
- optlist of bool
True for each plan row whose title/source column reads “CrystalPlan”.
- get_orientations_to_use()[source]#
Get the “Use” checkbox state for every plan row.
- Returns:
- uselist of bool
True for each plan row whose “Use” checkbox is checked.
- get_peak()[source]#
Get the peak index of the currently selected peaks-table row.
- Returns:
- rowint
Peak index stored in the current row’s user-role data.
- get_peak_list()[source]#
Get the plan row index selected in the orientation combo box.
- Returns:
- rowint or None
Zero-based plan row index, -1 if the “Missing” placeholder is selected, or None if the combo box has no current text.
- get_plan_angles()[source]#
Get the full goniometer angle settings for each plan row marked “in use”.
For each row in the plan table whose “Use” checkbox is checked, combines the fixed goniometer axis values with the row’s free (variable) angle settings into one complete angle list.
- Returns:
- settingslist of list of float
Complete goniometer angle settings, one list per used plan row.
- get_plane_hkl_1()[source]#
Get the first (u) in-plane HKL vector for the scattering plane.
- Returns:
- hkl_1list of float or None
The [h, k, l] components of the u vector, or None if the fields do not contain valid numbers.
- get_plane_hkl_2()[source]#
Get the second (v) in-plane HKL vector for the scattering plane.
- Returns:
- hkl_2list of float or None
The [h, k, l] components of the v vector, or None if the fields do not contain valid numbers.
- get_plane_max_angle()[source]#
Get the total angular coverage to sweep about the plane normal.
- Returns:
- max_degfloat
Angular coverage in degrees, or 360.0 if the field does not contain a valid number.
- get_plane_n_steps()[source]#
Get the number of orientations to sample across the plane coverage.
- Returns:
- n_stepsint
Number of orientations, or 360 if the field does not contain a valid number.
- get_point_group()[source]#
Get the selected point group.
- Returns:
- point_groupstr
Selected point group.
- get_projection_matrix()[source]#
Get the user-entered U/V/W projection matrix.
- Returns:
- paramslist of float or None
Flattened
[U1, U2, U3, V1, V2, V3, W1, W2, W3]projection vector components, or None if any field does not contain valid input.
- get_selected_angle()[source]#
Get the single selected plan row, preparing the table for an update.
Blocks signals and disables updates/sorting on the plan table. If exactly one row is selected, the table is left in that state for the caller to perform an update (e.g. a row swap); otherwise the blocked state is immediately restored.
- Returns:
- rowint or None
Selected row index, or None if zero or more than one rows are selected.
- get_selected_plan_rows()[source]#
Get the row indices currently selected in the plan table.
- Returns:
- rowslist of int
Sorted, unique row indices.
- get_settings()[source]#
Get the number of settings requested for coverage optimization.
- Returns:
- n_orientint or None
Requested number of orientations/settings, or None if the field does not contain a valid, acceptable value.
- get_slice()[source]#
Get the selected slice plane.
- Returns:
- planestr
Name of the slice plane selected in the slice combo box.
- get_slice_thickness()[source]#
Get the slice thickness along the slice normal.
- Returns:
- thicknessfloat or None
Slice thickness (reciprocal-lattice units) entered in the slice-thickness field, or None if the field does not contain valid input.
- get_slice_value()[source]#
Get the slice position along the slice normal.
- Returns:
- valuefloat or None
Slice position (reciprocal-lattice units) entered in the slice-value field, or None if the field does not contain valid input.
- get_vertical()[source]#
Get the primary reflection’s vertical (nu) detector angle.
- Returns:
- valfloat or None
Nu angle (degrees) entered in the vertical field, or None if the field does not contain valid input.
- get_vertical_alternate()[source]#
Get the alternate reflection’s vertical (nu) detector angle.
- Returns:
- valfloat or None
Nu angle (degrees) entered in the alternate vertical field, or None if the field is empty or does not contain valid input.
- get_wavelength()[source]#
Get the wavelength band.
- Returns:
- wavelengthlist of float or None
[min, max] wavelength band in Angstrom, or None if either field does not contain a valid, acceptable value.
- handle_item_changed(item)[source]#
Propagate a checkbox change to all selected rows in the plan table.
Slot for the plan table’s
itemChangedsignal. When the changed item is in the “use” checkbox column, applies its new check state to every selected row and emitsviz_ready.- Parameters:
- itemQTableWidgetItem
The table item that changed.
- highlight_peak(row)[source]#
Select the peaks-table row corresponding to a given peak index.
- Parameters:
- rowint
Peak index (as stored in the table items’ user-role data) to select.
- load_UB_file_dialog(path='')[source]#
Open a file dialog to select a UB matrix file.
- Parameters:
- pathstr, optional
Initial directory for the dialog. If empty, the last used directory is used.
- Returns:
- filenamestr
Selected file path, or an empty string if the dialog was canceled.
- load_detector_cal_dialog(path='')[source]#
Open a file dialog to select a detector calibration file.
- Parameters:
- pathstr, optional
Initial directory for the dialog. If empty, the last used directory is used.
- Returns:
- filenamestr
Selected file path, or an empty string if the dialog was canceled.
- load_experiment_file_dialog(path='')[source]#
Open a file dialog to select a saved experiment (NeXus) file.
- Parameters:
- pathstr, optional
Initial directory for the dialog. If empty, the last used directory is used.
- Returns:
- filenamestr
Selected file path, or an empty string if the dialog was canceled.
- load_goniometer_cal_dialog(path='')[source]#
Open a file dialog to select a goniometer calibration file.
- Parameters:
- pathstr, optional
Initial directory for the dialog. If empty, the last used directory is used.
- Returns:
- filenamestr
Selected file path, or an empty string if the dialog was canceled.
- load_mask_dialog(path='')[source]#
Open a file dialog to select a detector mask file.
- Parameters:
- pathstr, optional
Initial directory for the dialog. If empty, the last used directory is used.
- Returns:
- filenamestr
Selected file path, or an empty string if the dialog was canceled.
- mesh_tab()[source]#
Build the “Mesh” tab.
Creates the shared slice controls (axis selection, slice value and thickness), the mesh-angle and scattering-plane definition sub-tabs, the coverage-slice plot canvas, and the projection matrix entry grid used to convert a mesh or plane scan into an HKL slice. Adds the resulting tab to the main tab widget.
- on_press_inst(event)[source]#
Handle a mouse click on the instrument coverage plot.
Matplotlib
button_press_eventcallback. When the click occurs inside the instrument axes with no toolbar mode active, emitsroi_readywith the clicked (gamma, nu) coordinates.- Parameters:
- eventmatplotlib.backend_bases.MouseEvent
The mouse press event.
- on_press_laue(event)[source]#
Handle a mouse click on the Laue diffraction plot.
Matplotlib
button_press_eventcallback. When the click occurs inside the Laue axes with no toolbar mode active, emitssel_readywith the clicked (gamma, nu) coordinates.- Parameters:
- eventmatplotlib.backend_bases.MouseEvent
The mouse press event.
- peak_tab()[source]#
Build the “Peaks” tab.
Creates the single/double HKL peak calculators, the read-only result fields for the primary and alternate peaks, the instrument-coverage and Laue-view plot canvases, the orientation/comment controls used to add a peak setting to the plan, and the calculated-peaks table. Adds the resulting tab to the main tab widget.
- plot_harmonics(hkls, lamdas)[source]#
Plot harmonic reflections for the primary reflection.
Clears any existing harmonic markers on the wavelength-band axis and draws a vertical line (and HKL label, when available) for each harmonic wavelength.
- Parameters:
- hklslist
HKL triplets (or None) for each harmonic, aligned with
lamdas.- lamdaslist of float
Wavelengths (Angstrom) at which each harmonic occurs.
- plot_harmonics_alternate(hkls, lamdas)[source]#
Plot harmonic reflections for the alternate reflection.
Draws a vertical line (and HKL label, when available) for each harmonic wavelength of the alternate reflection, without clearing the primary reflection’s existing harmonic markers.
- Parameters:
- hklslist
HKL triplets (or None) for each harmonic, aligned with
lamdas.- lamdaslist of float
Wavelengths (Angstrom) at which each harmonic occurs.
- plot_instrument(inst_background, gamma, nu, lamda)[source]#
Plot single-reflection coverage on the instrument view.
Clears and redraws the wavelength-band and instrument-coverage axes, scattering the detector positions colored by wavelength, and wires up the click handler for picking a goniometer setting.
- Parameters:
- inst_backgrounddict or None
Detector background image data, see
_plot_instrument_background().- gammaarray_like
Detector gamma angles (degrees) of the covered reflections.
- nuarray_like
Detector nu angles (degrees) of the covered reflections.
- lamdaarray_like
Wavelengths (Angstrom) of the covered reflections, used to color the scatter points.
- plot_instrument_alternate(inst_background, gamma_1, nu_1, lamda_1, gamma_2, nu_2, lamda_2)[source]#
Plot simultaneous two-reflection coverage on the instrument view.
Clears and redraws the wavelength-band and instrument-coverage axes, scattering the detector positions for both reflections (in distinct colormaps) and wiring up the click handler for picking a goniometer setting.
- Parameters:
- inst_backgrounddict or None
Detector background image data, see
_plot_instrument_background().- gamma_1array_like
Detector gamma angles (degrees) for the primary reflection.
- nu_1array_like
Detector nu angles (degrees) for the primary reflection.
- lamda_1array_like
Wavelengths (Angstrom) for the primary reflection.
- gamma_2array_like
Detector gamma angles (degrees) for the alternate reflection.
- nu_2array_like
Detector nu angles (degrees) for the alternate reflection.
- lamda_2array_like
Wavelengths (Angstrom) for the alternate reflection.
- plot_laue(gamma_laue, nu_laue, gamma, nu, lamda, d)[source]#
Plot the Laue-diffraction peak positions.
- Parameters:
- gamma_lauearray_like
Detector gamma angles (degrees) of the full detector coverage, drawn as a light gray background scatter.
- nu_lauearray_like
Detector nu angles (degrees) of the full detector coverage, drawn as a light gray background scatter.
- gammaarray_like
Detector gamma angles (degrees) of the peaks.
- nuarray_like
Detector nu angles (degrees) of the peaks.
- lamdaarray_like
Wavelengths (Angstrom) of the peaks, used to color the scatter points.
- darray_like
d-spacings (Angstrom) of the peaks.
- plot_statistics(sym, asym, cumsym, cumasym)[source]#
Plot per-shell and cumulative completeness/redundancy statistics.
Draws grouped bar charts (per-resolution-shell completeness, redundancy, and unique-reflection count, with and without symmetry) and line plots (cumulative versions as a function of orientation number).
- Parameters:
- symtuple
(shel, comp, mult, refl)– per-shell labels, completeness (%), redundancy, and unique-reflection counts with point-group symmetry applied.- asymtuple
Same layout as
symbut without symmetry applied.- cumsymtuple
(x, comp, mult, refl)– orientation numbers and cumulative completeness/redundancy/unique counts with symmetry applied.- cumasymtuple
Same layout as
cumsymbut without symmetry applied.
- save_CSV_file_dialog(path='')[source]#
Open a file dialog to choose where to save the experiment plan as a CSV file.
- Parameters:
- pathstr, optional
Initial directory for the dialog. If empty, the last used directory is used.
- Returns:
- filenamestr
Selected file path (with a “.csv” extension appended if missing), or an empty string if the dialog was canceled.
- save_experiment_file_dialog(path='')[source]#
Open a file dialog to choose where to save the experiment as a NeXus file.
- Parameters:
- pathstr, optional
Initial directory for the dialog. If empty, the last used directory is used.
- Returns:
- filenamestr
Selected file path (with a “.nxs” extension appended if missing), or an empty string if the dialog was canceled.
- set_angles(values)[source]#
Display the goniometer angles for the looked-up setting.
- Parameters:
- valuesarray_like
Goniometer angles (degrees) to display, formatted as a comma-separated tuple string.
- set_comment(values)[source]#
Display the comment/label associated with the looked-up setting.
- Parameters:
- valuesstr
Comment text to display.
- set_counting_options(options)[source]#
Populate the counting method combo box.
- Parameters:
- optionslist of str
Counting method options available for the current instrument.
- set_crystal_system(crystal_system)[source]#
Select a crystal system in the crystal system combo box.
- Parameters:
- crystal_systemstr
Crystal system to select.
- set_d(val)[source]#
Set the primary reflection’s d-spacing.
- Parameters:
- valfloat
d-spacing (Angstrom) to display, rounded to 4 decimals.
- set_d_alternate(val)[source]#
Set the alternate reflection’s d-spacing.
- Parameters:
- valfloat or None
d-spacing (Angstrom) to display, rounded to 4 decimals. If None, the field is cleared.
- set_d_min(d_min)[source]#
Set the minimum d-spacing field.
- Parameters:
- d_minfloat
Minimum d-spacing in Angstrom.
- set_default_symmetry()[source]#
Reset the crystal system, point group, and lattice centering combo boxes to their default selections.
- set_detector_calibration(filename)[source]#
Set the path to the detector calibration file.
- Parameters:
- filenamestr
Path to the detector calibration file.
- set_goniometer_calibration(filename)[source]#
Set the path to the goniometer calibration file.
- Parameters:
- filenamestr
Path to the goniometer calibration file.
- set_goniometer_limits(limits)[source]#
Set the goniometer axis limits in the goniometer table.
- Parameters:
- limitslist
List of
[min, max]angle limits (degrees), one pair per goniometer axis row.
- set_hkl_limits(h_max, k_max, l_max)[source]#
Display the maximum h, k, l indices reachable at the current minimum d-spacing.
- Parameters:
- h_max, k_max, l_maxfloat
Maximum Miller indices.
- set_horizontal(val)[source]#
Set the primary reflection’s horizontal (gamma) detector angle.
- Parameters:
- valfloat
Gamma angle (degrees) to display, rounded to 2 decimals.
- set_horizontal_alternate(val)[source]#
Set the alternate reflection’s horizontal (gamma) detector angle.
- Parameters:
- valfloat or None
Gamma angle (degrees) to display, rounded to 2 decimals. If None, the field is cleared.
- set_instrument(instrument)[source]#
Set the selected instrument.
- Parameters:
- instrumentstr
Name of the instrument to select. Ignored if not found in the instrument combo box.
- set_intersect(val)[source]#
Set the primary reflection’s intersecting wavelength.
- Parameters:
- valfloat
Wavelength (Angstrom) to display, rounded to 2 decimals.
- set_intersect_alternate(val)[source]#
Set the alternate reflection’s intersecting wavelength.
- Parameters:
- valfloat or None
Wavelength (Angstrom) to display, rounded to 2 decimals. If None, the field is cleared.
- set_item_value(value, row=0)[source]#
Build a numeric table item tagged with its originating row.
- Parameters:
- valuestr or float
Numeric value to display.
- rowint, optional
Row number to store as the item’s user-role data, used to associate the item back to its source row. Default is 0.
- Returns:
- itemQTableWidgetItem
Table item with
Qt.DisplayRoleset to the float value andQt.UserRoleset torow.
- set_lattice_centering(lattice_centering)[source]#
Select a lattice centering in the lattice centering combo box.
- Parameters:
- lattice_centeringstr
Lattice centering to select.
- set_lattice_centerings(centerings)[source]#
Populate the lattice centering combo box.
- Parameters:
- centeringslist of str
Lattice centering options available for the current point group.
- set_mask(filename)[source]#
Set the path to the detector mask file.
- Parameters:
- filenamestr
Path to the detector mask file.
- set_mode(mode)[source]#
Select a goniometer mode in the mode combo box.
- Parameters:
- modestr
Goniometer mode to select.
- set_modes(modes)[source]#
Populate the goniometer mode combo box.
- Parameters:
- modeslist of str
Goniometer modes available for the current instrument.
- set_motors(values)[source]#
Set the motor/log values in the motor table.
- Parameters:
- valueslist
Motor/log values, in row order, to populate into the motor table’s value column.
- set_peak(row, peak)[source]#
Populate a single row of the peaks table.
- Parameters:
- rowint
Row index in the peaks table to populate.
- peaktuple
(h, k, l, d, lamda)values for the peak.
- set_peak_list(rows)[source]#
Repopulate the orientation selection combo box for the plan.
Adds a “Missing” placeholder entry followed by one numbered entry (“#1”, “#2”, …) per plan row, and selects the last entry.
- Parameters:
- rowsint
Number of orientations currently in the plan.
- set_point_group(point_group)[source]#
Select a point group in the point group combo box.
- Parameters:
- point_groupstr
Point group to select.
- set_point_groups(groups)[source]#
Populate the point group combo box.
- Parameters:
- groupslist of str
Point group names available for the current crystal system.
- set_vertical(val)[source]#
Set the primary reflection’s vertical (nu) detector angle.
- Parameters:
- valfloat
Nu angle (degrees) to display, rounded to 2 decimals.
- set_vertical_alternate(val)[source]#
Set the alternate reflection’s vertical (nu) detector angle.
- Parameters:
- valfloat or None
Nu angle (degrees) to display, rounded to 2 decimals. If None, the field is cleared.
- set_wavelength(wavelength)[source]#
Set the minimum and maximum wavelength fields.
- Parameters:
- wavelengthfloat or list of float
Single wavelength value (monochromatic instrument, sets both fields and disables the maximum field) or a two-element [min, max] wavelength band (enables the maximum field).
- swap_angles(rows)[source]#
Swap the contents of two rows in the plan table.
Swaps cell items and, for combo-box cell widgets (e.g. the counting method column), rebuilds equivalent combo boxes with the swapped selections. Re-enables updates/sorting/signals on the plan table afterward.
- Parameters:
- rowslist of int
Two-element list of the row indices to swap.
- update_counting()[source]#
Apply the current title, counting method, and count value to the selected plan rows.
- Returns:
- rowslist of int
Row indices that were updated.
- update_inst()[source]#
Redraw the crosshair markers on the instrument coverage plot.
Clears existing crosshair lines and harmonic markers, emits
harm_readyto trigger a harmonics recalculation, and draws a crosshair (or connecting box, if both a primary and alternate setting are present) at the current horizontal/vertical reflection positions.
- update_laue(horz, vert, lamdas, hkl, lamda_0)[source]#
Highlight the selected peak on the Laue and harmonics plots.
Draws a crosshair at the selected peak’s detector position and vertical markers at each harmonic wavelength on the harmonics axis.
- Parameters:
- horzfloat
Detector gamma angle (degrees) of the selected peak.
- vertfloat
Detector nu angle (degrees) of the selected peak.
- lamdasarray_like
Harmonic wavelengths (Angstrom) to mark on the harmonics axis.
- hkltuple
HKL of the selected peak.
- lamda_0float
Fundamental wavelength (Angstrom) of the selected peak.
- update_limits(item)[source]#
Propagate an edited goniometer limit to the matching mesh table row.
- Parameters:
- itemQTableWidgetItem
Edited cell in the goniometer table.
- update_peaks_table(peaks)[source]#
Repopulate the peaks table.
- Parameters:
- peakslist
List of
(h, k, l, d, lamda)tuples, one per peak, to display in the peaks table.
- update_slice(slice_dict)[source]#
Redraw the reciprocal-space slice plot.
Rebuilds the slice axes using a curvilinear grid helper derived from the slice transform, and plots the slice’s signal as a pseudocolor mesh.
- Parameters:
- slice_dictdict
Dictionary with keys
"x","y"(grid coordinates),"labels"(axis labels),"title"(plot title),"signal"(2D intensity array),"z"(out-of-plane coordinate),"W"(projection matrix),"transform"(2D affine transform matrix), and"aspect"(axes aspect ratio).
- update_tables(title, goniometers, motors)[source]#
Rebuild the goniometer, motor, plan, and mesh tables.
Populates the goniometer table with the axis names and limits, marks fixed axes (equal min/max) as read only, populates the motor table with fixed motor values, resizes the plan table columns to match the free (non-fixed) goniometer axes plus the comment/counting/value/use columns, and rebuilds the mesh table rows for the free axes.
- Parameters:
- titlestr
Scan log title used for the first plan table column header.
- goniometerslist of tuple
Sequence of (angle_name, min, max) goniometer axis definitions.
- motorslist of tuple
Sequence of (setting_name, value) fixed motor/calibration values.
- update_wavelength(lamda_min)[source]#
Mirror the minimum wavelength into the maximum wavelength field when the instrument is monochromatic.
- Parameters:
- lamda_minfloat
Minimum wavelength in Angstrom.
- use_equivalents()[source]#
Get whether symmetry-equivalent HKLs should be included.
- Returns:
- usebool
True if the “Equivalents” checkbox is checked.
- class AtomView[source]#
Bases:
QWidgetView for displaying isotope and neutron scattering data for an element.
Provides a user interface for selecting an isotope and displaying the corresponding atomic mass, abundance, and neutron scattering parameters.
- Attributes:
paintersushort
Methods
acceptDrops(self, /)accessibleDescription(self, /)accessibleIdentifier(self, /)accessibleName(self, /)actionEvent(self, event, /)actions(self, /)activateWindow(self, /)addAction(...)addActions(self, actions, /)adjustSize(self, /)autoFillBackground(self, /)backgroundRole(self, /)backingStore(self, /)baseSize(self, /)blockSignals(self, b, /)changeEvent(self, event, /)childAt(...)childEvent(self, event, /)children(self, /)childrenRect(self, /)childrenRegion(self, /)clearFocus(self, /)clearMask(self, /)close(self, /)closeEvent(event)Emit the current isotope selection when the widget is closed.
colorCount(self, /)connect(...)connectNotify(self, signal, /)connect_isotopes(update_info)Connect a callback to isotope combo box changes.
connect_selected(value)Connect a callback to the selection signal.
connect_selection(use_isotope)Connect a callback to the "Use Isotope" button.
contentsMargins(self, /)contentsRect(self, /)contextMenuEvent(self, event, /)contextMenuPolicy(self, /)create(self, /[, arg__1, initializeWindow, ...])createWinId(self, /)createWindowContainer(window, /[, parent, flags])cursor(self, /)customEvent(self, event, /)deleteLater(self, /)depth(self, /)destroy(self, /[, destroyWindow, ...])devType(self, /)devicePixelRatio(self, /)devicePixelRatioF(self, /)devicePixelRatioFScale()disconnect(...)disconnectNotify(self, signal, /)dragEnterEvent(self, event, /)dragLeaveEvent(self, event, /)dragMoveEvent(self, event, /)dropEvent(self, event, /)dumpObjectInfo(self, /)dumpObjectTree(self, /)dynamicPropertyNames(self, /)effectiveWinId(self, /)emit(self, signal, /, *args)encodeMetricF(metric, value, /)ensurePolished(self, /)enterEvent(self, event, /)event(self, event, /)eventFilter(self, watched, event, /)find(arg__1, /)findChild(self, type, /[, name, options])findChildren() -> List[~PlaceholderType] ))focusInEvent(self, event, /)focusNextChild(self, /)focusNextPrevChild(self, next, /)focusOutEvent(self, event, /)focusPolicy(self, /)focusPreviousChild(self, /)focusProxy(self, /)focusWidget(self, /)font(self, /)fontInfo(self, /)fontMetrics(self, /)foregroundRole(self, /)frameGeometry(self, /)frameSize(self, /)geometry(self, /)Return the mass number of the currently selected isotope.
Return the currently displayed element symbol.
grab(self, /[, rectangle])grabGesture(self, type, /[, flags])grabKeyboard(self, /)grabMouse(-> None)grabShortcut(self, key, /[, context])graphicsEffect(self, /)graphicsProxyWidget(self, /)hasFocus(self, /)hasHeightForWidth(self, /)hasMouseTracking(self, /)hasTabletTracking(self, /)height(self, /)heightForWidth(self, arg__1, /)heightMM(self, /)hide(self, /)hideEvent(self, event, /)inherits(self, classname, /)initPainter(self, painter, /)inputMethodEvent(self, event, /)inputMethodHints(self, /)inputMethodQuery(self, arg__1, /)insertAction(self, before, action, /)insertActions(self, before, actions, /)installEventFilter(self, filterObj, /)internalWinId(self, /)isActiveWindow(self, /)isAncestorOf(self, child, /)isEnabled(self, /)isEnabledTo(self, arg__1, /)isFullScreen(self, /)isHidden(self, /)isLeftToRight(self, /)isMaximized(self, /)isMinimized(self, /)isModal(self, /)isQmlExposed(self, /)isQuickItemType(self, /)isRightToLeft(self, /)isSignalConnected(self, signal, /)isTopLevel(self, /)isVisible(self, /)isVisibleTo(self, arg__1, /)isWidgetType(self, /)isWindow(self, /)isWindowModified(self, /)isWindowType(self, /)keyPressEvent(self, event, /)keyReleaseEvent(self, event, /)keyboardGrabber()killTimer(-> None)layout(self, /)layoutDirection(self, /)leaveEvent(self, event, /)locale(self, /)logicalDpiX(self, /)logicalDpiY(self, /)lower(self, /)mapFrom(-> PySide6.QtCore.QPoint)mapFromGlobal(-> PySide6.QtCore.QPoint)mapFromParent(-> PySide6.QtCore.QPoint)mapTo(-> PySide6.QtCore.QPoint)mapToGlobal(-> PySide6.QtCore.QPoint)mapToParent(-> PySide6.QtCore.QPoint)mask(self, /)maximumHeight(self, /)maximumSize(self, /)maximumWidth(self, /)metaObject(self, /)metric(self, arg__1, /)minimumHeight(self, /)minimumSize(self, /)minimumSizeHint(self, /)minimumWidth(self, /)mouseDoubleClickEvent(self, event, /)mouseGrabber()mouseMoveEvent(self, event, /)mousePressEvent(self, event, /)mouseReleaseEvent(self, event, /)move(-> None)moveEvent(self, event, /)moveToThread(self, thread, /)nativeEvent(self, eventType, message, /)nativeParentWidget(self, /)nextInFocusChain(self, /)normalGeometry(self, /)objectName(self, /)overrideWindowFlags(self, type, /)overrideWindowState(self, state, /)paintEngine(self, /)paintEvent(self, event, /)paintingActive(self, /)palette(self, /)parent(self, /)parentWidget(self, /)physicalDpiX(self, /)physicalDpiY(self, /)pos(self, /)previousInFocusChain(self, /)property(self, name, /)raise_(self, /)receivers(self, signal, /)rect(self, /)redirected(self, offset, /)releaseKeyboard(self, /)releaseMouse(self, /)releaseShortcut(self, id, /)removeAction(self, action, /)removeEventFilter(self, obj, /)render(, sourceRegion, renderFlags, renderFlags)repaint(-> None -> None -> None)resize(-> None)resizeEvent(self, event, /)restoreGeometry(self, geometry, /)saveGeometry(self, /)screen(self, /)scroll(-> None)sender(self, /)senderSignalIndex(self, /)setAcceptDrops(self, on, /)setAccessibleDescription(self, description, /)setAccessibleIdentifier(self, identifier, /)setAccessibleName(self, name, /)setAttribute(self, arg__1, /[, on])setAutoFillBackground(self, enabled, /)setBackgroundRole(self, arg__1, /)setBaseSize(-> None)setContentsMargins(-> None)setContextMenuPolicy(self, policy, /)setCursor(self, arg__1, /)setDisabled(self, arg__1, /)setEnabled(self, arg__1, /)setFixedHeight(self, h, /)setFixedSize(-> None)setFixedWidth(self, w, /)setFocus(-> None)setFocusPolicy(self, policy, /)setFocusProxy(self, arg__1, /)setFont(self, arg__1, /)setForegroundRole(self, arg__1, /)setGeometry(-> None)setGraphicsEffect(self, effect, /)setHidden(self, hidden, /)setInputMethodHints(self, hints, /)setLayout(self, arg__1, /)setLayoutDirection(self, direction, /)setLocale(self, locale, /)setMask(-> None)setMaximumHeight(self, maxh, /)setMaximumSize(-> None)setMaximumWidth(self, maxw, /)setMinimumHeight(self, minh, /)setMinimumSize(-> None)setMinimumWidth(self, minw, /)setMouseTracking(self, enable, /)setObjectName(self, name, /)setPalette(self, arg__1, /)setParent(-> None)setProperty(self, name, value, /)setScreen(self, arg__1, /)setShortcutAutoRepeat(self, id, /[, enable])setShortcutEnabled(self, id, /[, enable])setSizeIncrement(-> None)setSizePolicy(-> None)setStatusTip(self, arg__1, /)setStyle(self, arg__1, /)setStyleSheet(self, styleSheet, /)setTabOrder(arg__1, arg__2, /)setTabletTracking(self, enable, /)setToolTip(self, arg__1, /)setToolTipDuration(self, msec, /)setUpdatesEnabled(self, enable, /)setVisible(self, visible, /)setWhatsThis(self, arg__1, /)setWindowFilePath(self, filePath, /)setWindowFlag(self, arg__1, /[, on])setWindowFlags(self, type, /)setWindowIcon(self, icon, /)setWindowIconText(self, arg__1, /)setWindowModality(self, windowModality, /)setWindowModified(self, arg__1, /)setWindowOpacity(self, level, /)setWindowRole(self, arg__1, /)setWindowState(self, state, /)setWindowTitle(self, arg__1, /)set_atom_parameters(atom, scatt)Update the displayed atomic and neutron scattering parameters.
set_isotope_numbers(numbers)Populate the isotope combo box with the given mass numbers.
set_symbol_name(symbol, name)Set the displayed element symbol and name.
sharedPainter(self, /)show(self, /)showEvent(self, event, /)showFullScreen(self, /)showMaximized(self, /)showMinimized(self, /)showNormal(self, /)signalsBlocked(self, /)size(self, /)sizeHint(self, /)sizeIncrement(self, /)sizePolicy(self, /)stackUnder(self, arg__1, /)startTimer(self, interval, /[, timerType])statusTip(self, /)style(self, /)styleSheet(self, /)tabletEvent(self, event, /)testAttribute(self, arg__1, /)thread(self, /)timerEvent(self, event, /)toolTip(self, /)toolTipDuration(self, /)topLevelWidget(self, /)tr(self, sourceText, /[, disambiguation, n])underMouse(self, /)ungrabGesture(self, type, /)unsetCursor(self, /)unsetLayoutDirection(self, /)unsetLocale(self, /)update(-> None -> None -> None)updateGeometry(self, /)updateMicroFocus(self, /[, query])updatesEnabled(self, /)visibleRegion(self, /)whatsThis(self, /)wheelEvent(self, event, /)width(self, /)widthMM(self, /)winId(self, /)window(self, /)windowFilePath(self, /)windowFlags(self, /)windowHandle(self, /)windowIcon(self, /)windowIconText(self, /)windowModality(self, /)windowOpacity(self, /)windowRole(self, /)windowState(self, /)windowTitle(self, /)windowType(self, /)x(self, /)y(self, /)PaintDeviceMetric
RenderFlag
customContextMenuRequested
destroyed
objectNameChanged
selection
windowIconChanged
windowIconTextChanged
windowTitleChanged
- closeEvent(event)[source]#
Emit the current isotope selection when the widget is closed.
- Parameters:
- eventQCloseEvent
Close event triggering the shutdown; accepted unconditionally.
- connect_isotopes(update_info)[source]#
Connect a callback to isotope combo box changes.
- Parameters:
- update_infocallable
Function called when the selected isotope combo box index changes.
- connect_selected(value)[source]#
Connect a callback to the selection signal.
- Parameters:
- valuecallable
Function called with the selected isotope symbol when the selection signal is emitted.
- connect_selection(use_isotope)[source]#
Connect a callback to the “Use Isotope” button.
- Parameters:
- use_isotopecallable
Function called when the select button is clicked.
- get_isotope()[source]#
Return the mass number of the currently selected isotope.
- Returns:
- isoint or None
Mass number of the selected isotope, 0 if no specific isotope is selected (empty combo box text), or None if the combo box text itself is None.
- get_selection()[source]#
Return the currently displayed element symbol.
- Returns:
- isotopestr
Chemical symbol shown in the symbol label.
- set_atom_parameters(atom, scatt)[source]#
Update the displayed atomic and neutron scattering parameters.
- Parameters:
- atomdict
Atomic data with keys
"z","mass", and"abundance".- scattdict
Neutron scattering data with keys
"sigma_coh","sigma_inc","sigma_tot","b_coh_re","b_coh_im","b_inc_re", and"b_inc_im".
- class PeriodicTableView(parent=None)[source]#
Bases:
QWidgetView for displaying and selecting elements from the periodic table in NeuXtalViz.
Provides a user interface for element selection, highlighting, and displaying element properties.
- Attributes:
paintersushort
Methods
acceptDrops(self, /)accessibleDescription(self, /)accessibleIdentifier(self, /)accessibleName(self, /)actionEvent(self, event, /)actions(self, /)activateWindow(self, /)addAction(...)addActions(self, actions, /)adjustSize(self, /)autoFillBackground(self, /)backgroundRole(self, /)backingStore(self, /)baseSize(self, /)blockSignals(self, b, /)changeEvent(self, event, /)childAt(...)childEvent(self, event, /)children(self, /)childrenRect(self, /)childrenRegion(self, /)clearFocus(self, /)clearMask(self, /)close(self, /)closeEvent(event)Emit the current selection when the widget is closed.
colorCount(self, /)connect(...)connectNotify(self, signal, /)connect_atoms(atom_info)Connect element button clicks to a handler.
connect_selected(value)Connect a callback to the selection signal.
contentsMargins(self, /)contentsRect(self, /)contextMenuEvent(self, event, /)contextMenuPolicy(self, /)create(self, /[, arg__1, initializeWindow, ...])createWinId(self, /)createWindowContainer(window, /[, parent, flags])cursor(self, /)customEvent(self, event, /)deleteLater(self, /)depth(self, /)destroy(self, /[, destroyWindow, ...])devType(self, /)devicePixelRatio(self, /)devicePixelRatioF(self, /)devicePixelRatioFScale()disconnect(...)disconnectNotify(self, signal, /)dragEnterEvent(self, event, /)dragLeaveEvent(self, event, /)dragMoveEvent(self, event, /)dropEvent(self, event, /)dumpObjectInfo(self, /)dumpObjectTree(self, /)dynamicPropertyNames(self, /)effectiveWinId(self, /)emit(self, signal, /, *args)encodeMetricF(metric, value, /)ensurePolished(self, /)enterEvent(self, event, /)event(self, event, /)eventFilter(self, watched, event, /)find(arg__1, /)findChild(self, type, /[, name, options])findChildren() -> List[~PlaceholderType] ))focusInEvent(self, event, /)focusNextChild(self, /)focusNextPrevChild(self, next, /)focusOutEvent(self, event, /)focusPolicy(self, /)focusPreviousChild(self, /)focusProxy(self, /)focusWidget(self, /)font(self, /)fontInfo(self, /)fontMetrics(self, /)foregroundRole(self, /)frameGeometry(self, /)frameSize(self, /)geometry(self, /)Create a new atom/isotope selection view.
grab(self, /[, rectangle])grabGesture(self, type, /[, flags])grabKeyboard(self, /)grabMouse(-> None)grabShortcut(self, key, /[, context])graphicsEffect(self, /)graphicsProxyWidget(self, /)hasFocus(self, /)hasHeightForWidth(self, /)hasMouseTracking(self, /)hasTabletTracking(self, /)height(self, /)heightForWidth(self, arg__1, /)heightMM(self, /)hide(self, /)hideEvent(self, event, /)inherits(self, classname, /)initPainter(self, painter, /)inputMethodEvent(self, event, /)inputMethodHints(self, /)inputMethodQuery(self, arg__1, /)insertAction(self, before, action, /)insertActions(self, before, actions, /)installEventFilter(self, filterObj, /)internalWinId(self, /)isActiveWindow(self, /)isAncestorOf(self, child, /)isEnabled(self, /)isEnabledTo(self, arg__1, /)isFullScreen(self, /)isHidden(self, /)isLeftToRight(self, /)isMaximized(self, /)isMinimized(self, /)isModal(self, /)isQmlExposed(self, /)isQuickItemType(self, /)isRightToLeft(self, /)isSignalConnected(self, signal, /)isTopLevel(self, /)isVisible(self, /)isVisibleTo(self, arg__1, /)isWidgetType(self, /)isWindow(self, /)isWindowModified(self, /)isWindowType(self, /)keyPressEvent(self, event, /)keyReleaseEvent(self, event, /)keyboardGrabber()killTimer(-> None)layout(self, /)layoutDirection(self, /)leaveEvent(self, event, /)locale(self, /)logicalDpiX(self, /)logicalDpiY(self, /)lower(self, /)mapFrom(-> PySide6.QtCore.QPoint)mapFromGlobal(-> PySide6.QtCore.QPoint)mapFromParent(-> PySide6.QtCore.QPoint)mapTo(-> PySide6.QtCore.QPoint)mapToGlobal(-> PySide6.QtCore.QPoint)mapToParent(-> PySide6.QtCore.QPoint)mask(self, /)maximumHeight(self, /)maximumSize(self, /)maximumWidth(self, /)metaObject(self, /)metric(self, arg__1, /)minimumHeight(self, /)minimumSize(self, /)minimumSizeHint(self, /)minimumWidth(self, /)mouseDoubleClickEvent(self, event, /)mouseGrabber()mouseMoveEvent(self, event, /)mousePressEvent(self, event, /)mouseReleaseEvent(self, event, /)move(-> None)moveEvent(self, event, /)moveToThread(self, thread, /)nativeEvent(self, eventType, message, /)nativeParentWidget(self, /)nextInFocusChain(self, /)normalGeometry(self, /)objectName(self, /)overrideWindowFlags(self, type, /)overrideWindowState(self, state, /)paintEngine(self, /)paintEvent(self, event, /)paintingActive(self, /)palette(self, /)parent(self, /)parentWidget(self, /)physicalDpiX(self, /)physicalDpiY(self, /)pos(self, /)previousInFocusChain(self, /)property(self, name, /)raise_(self, /)receivers(self, signal, /)rect(self, /)redirected(self, offset, /)releaseKeyboard(self, /)releaseMouse(self, /)releaseShortcut(self, id, /)removeAction(self, action, /)removeEventFilter(self, obj, /)render(, sourceRegion, renderFlags, renderFlags)repaint(-> None -> None -> None)resize(-> None)resizeEvent(self, event, /)restoreGeometry(self, geometry, /)saveGeometry(self, /)screen(self, /)scroll(-> None)sender(self, /)senderSignalIndex(self, /)setAcceptDrops(self, on, /)setAccessibleDescription(self, description, /)setAccessibleIdentifier(self, identifier, /)setAccessibleName(self, name, /)setAttribute(self, arg__1, /[, on])setAutoFillBackground(self, enabled, /)setBackgroundRole(self, arg__1, /)setBaseSize(-> None)setContentsMargins(-> None)setContextMenuPolicy(self, policy, /)setCursor(self, arg__1, /)setDisabled(self, arg__1, /)setEnabled(self, arg__1, /)setFixedHeight(self, h, /)setFixedSize(-> None)setFixedWidth(self, w, /)setFocus(-> None)setFocusPolicy(self, policy, /)setFocusProxy(self, arg__1, /)setFont(self, arg__1, /)setForegroundRole(self, arg__1, /)setGeometry(-> None)setGraphicsEffect(self, effect, /)setHidden(self, hidden, /)setInputMethodHints(self, hints, /)setLayout(self, arg__1, /)setLayoutDirection(self, direction, /)setLocale(self, locale, /)setMask(-> None)setMaximumHeight(self, maxh, /)setMaximumSize(-> None)setMaximumWidth(self, maxw, /)setMinimumHeight(self, minh, /)setMinimumSize(-> None)setMinimumWidth(self, minw, /)setMouseTracking(self, enable, /)setObjectName(self, name, /)setPalette(self, arg__1, /)setParent(-> None)setProperty(self, name, value, /)setScreen(self, arg__1, /)setShortcutAutoRepeat(self, id, /[, enable])setShortcutEnabled(self, id, /[, enable])setSizeIncrement(-> None)setSizePolicy(-> None)setStatusTip(self, arg__1, /)setStyle(self, arg__1, /)setStyleSheet(self, styleSheet, /)setTabOrder(arg__1, arg__2, /)setTabletTracking(self, enable, /)setToolTip(self, arg__1, /)setToolTipDuration(self, msec, /)setUpdatesEnabled(self, enable, /)setVisible(self, visible, /)setWhatsThis(self, arg__1, /)setWindowFilePath(self, filePath, /)setWindowFlag(self, arg__1, /[, on])setWindowFlags(self, type, /)setWindowIcon(self, icon, /)setWindowIconText(self, arg__1, /)setWindowModality(self, windowModality, /)setWindowModified(self, arg__1, /)setWindowOpacity(self, level, /)setWindowRole(self, arg__1, /)setWindowState(self, state, /)setWindowTitle(self, arg__1, /)sharedPainter(self, /)show(self, /)showEvent(self, event, /)showFullScreen(self, /)showMaximized(self, /)showMinimized(self, /)showNormal(self, /)show_atom_dialog(button)Invoke the atom info callback for the clicked element button.
signalsBlocked(self, /)size(self, /)sizeHint(self, /)sizeIncrement(self, /)sizePolicy(self, /)stackUnder(self, arg__1, /)startTimer(self, interval, /[, timerType])statusTip(self, /)style(self, /)styleSheet(self, /)tabletEvent(self, event, /)testAttribute(self, arg__1, /)thread(self, /)timerEvent(self, event, /)toolTip(self, /)toolTipDuration(self, /)topLevelWidget(self, /)tr(self, sourceText, /[, disambiguation, n])underMouse(self, /)ungrabGesture(self, type, /)unsetCursor(self, /)unsetLayoutDirection(self, /)unsetLocale(self, /)update(-> None -> None -> None)updateGeometry(self, /)updateMicroFocus(self, /[, query])updatesEnabled(self, /)visibleRegion(self, /)whatsThis(self, /)wheelEvent(self, event, /)width(self, /)widthMM(self, /)winId(self, /)window(self, /)windowFilePath(self, /)windowFlags(self, /)windowHandle(self, /)windowIcon(self, /)windowIconText(self, /)windowModality(self, /)windowOpacity(self, /)windowRole(self, /)windowState(self, /)windowTitle(self, /)windowType(self, /)x(self, /)y(self, /)PaintDeviceMetric
RenderFlag
customContextMenuRequested
destroyed
objectNameChanged
selection
windowIconChanged
windowIconTextChanged
windowTitleChanged
- closeEvent(event)[source]#
Emit the current selection when the widget is closed.
- Parameters:
- eventQCloseEvent
Close event triggering the shutdown; accepted unconditionally.
- connect_atoms(atom_info)[source]#
Connect element button clicks to a handler.
- Parameters:
- atom_infocallable
Function called with the clicked element’s symbol when an element button is clicked.
- connect_selected(value)[source]#
Connect a callback to the selection signal.
- Parameters:
- valuecallable
Function called with the selected element symbol when the selection signal is emitted.
- get_atom_view()[source]#
Create a new atom/isotope selection view.
- Returns:
- atom_viewAtomView
Newly constructed atom detail/isotope selection widget.
- show_atom_dialog(button)[source]#
Invoke the atom info callback for the clicked element button.
- Parameters:
- buttonQPushButton
Button that was clicked, whose text is the element symbol.
- Returns:
- resultobject
Return value of the atom_info callback connected via
connect_atoms().
- class UBView(parent=None)[source]#
Bases:
NeuXtalVizWidgetView for UB matrix and peak indexing tools in NeuXtalViz.
Provides user interface elements for UB calculation, peak finding, indexing, prediction, integration, and filtering. Tool tips are added to all major widgets and controls for improved usability.
- Attributes:
paintersushort
Methods
acceptDrops(self, /)accessibleDescription(self, /)accessibleIdentifier(self, /)accessibleName(self, /)actionEvent(self, event, /)actions(self, /)activateWindow(self, /)addAction(...)addActions(self, actions, /)add_Q_viz(Q_dict)Render the Q-space volume and, if available, indexed peaks.
add_alignment_peaks(alignment_dict)Draw observed-vs-predicted Q vectors for goniometer alignment.
add_cluster_peaks(peak_dict)Draw clustered satellite peak positions and their unit-cell images.
add_highlight_1(peak)Display the first highlighted peak's Q vector and d-spacing.
add_highlight_2(peak)Display the second highlighted peak's Q vector and d-spacing.
adjustSize(self, /)Build the "Alignment" tab.
append_to_console(text)Append a line of text to the console output widget.
autoFillBackground(self, /)auto_scale_dropdown(combo)Autoscale a combobox width to fit text plus any icons/checks.
axes_show()State of axes.
backgroundRole(self, /)backingStore(self, /)baseSize(self, /)blockSignals(self, b, /)changeEvent(self, event, /)change_projection()Enable or disable parallel projection.
childAt(...)childEvent(self, event, /)children(self, /)childrenRect(self, /)childrenRegion(self, /)clearFocus(self, /)clearMask(self, /)Clear the 3D alignment view and reset the observed/predicted hkl histogram axes.
Clear the instrument view minimum/maximum color-scale fields.
Clear the reduced-cell table and the selected form label.
Clear the peaks table selection and any highlight marker.
clear_run_info(filepath)Reset run/calibration fields and enable widgets for a facility.
clear_scene()Clear plane widgets and actors from the plotter.
close(self, /)closeEvent(self, event, /)colorCount(self, /)connect(...)connectNotify(self, signal, /)connect_add_peak(add_peak)Connect a callback to the "Add Peak" button click.
connect_az(left, right)Connect Azimuth to presenter handler.
connect_browse_calibration(load_detector_cal)Connect a callback to the detector calibration browse button.
connect_browse_goniometer(load_goniometer_cal)Connect a callback to the goniometer calibration browse button.
connect_browse_tube(load_tube_cal)Connect a callback to the tube calibration browse button.
connect_calculate_alignment(calculate_alignment)Connect a callback to the calculate-alignment button click.
connect_calculate_highlight(calculate_highlight)Connect a callback to the highlighted-peaks "Calculate" button click.
connect_calculate_peaks(calculate_peaks)Connect a callback to the peak calculator's "Calculate" button click.
connect_camera_ready(calculate)Connect a callback to the
cam_readysignal.connect_cbar_combo(update_cbar)Connect a callback to the slice view colormap combo box.
connect_cell_row_highligter(highlight_row)Connect a callback to cell table selection changes.
connect_check_hkl(check_hkl)Connect a callback to the "Check hkl" button click.
connect_clim_combo(update_clim)Connect a callback to the slice view color-limit method combo box.
connect_cluster(cluster)Connect a callback to the cluster button click.
connect_convert_HKL(convert_HKL)Connect a callback to the "Convert" button click for HKL conversion.
connect_convert_Q(convert_Q)Connect a callback to the "Convert" button click for Q conversion.
connect_convert_to_hkl(convert_to_hkl)Connect a callback to the "Convert" button in the slice view tab.
connect_d_max(update_inst_data)Connect a callback to editing-finished on the detector view maximum d-spacing field.
connect_d_min(update_inst_data)Connect a callback to editing-finished on the detector view minimum d-spacing field.
connect_data_combo(update_inst_data)Connect a callback to the instrument data source combo box.
connect_delete_peak(delete_peak)Connect a callback to the "Delete Highlighted" button click.
connect_diffraction(update_inst_data)Connect a callback to editing-finished on the diffraction angle field.
connect_elev(up, down)Connect Elevate to presenter handler.
connect_filter_peaks(filter_peaks)Connect a callback to the "Filter" button click.
connect_find_conventional(find_conventional)Connect a callback to the "Find UB with Lattice Parameters" button click.
connect_find_distance(update)Connect a callback to editing-finished on the minimum peak distance field.
connect_find_niggli(find_niggli)Connect a callback to the "Find Primitive Cell" button click.
connect_find_peaks(find_peaks)Connect a callback to the "Find" peaks button click.
connect_find_spacing(update)Connect a callback to editing-finished on the maximum d-spacing field.
connect_h_index(update_index)Connect a callback to editing-finished on the fractional h index field.
connect_hand_index_peak(reindex)Connect a callback to the index_ready signal.
connect_highlight_1(add)Connect a callback to the first "Add Highlighted" button click.
connect_highlight_2(add)Connect a callback to the second "Add Highlighted" button click.
connect_horizontal(update_inst_data)Connect a callback to editing-finished on the horizontal angle field.
connect_horizontal_roi(update_inst_data)Connect a callback to editing-finished on the horizontal ROI size field.
connect_index_peaks(index_peaks)Connect a callback to the "Index" button click.
connect_inst_vmax_line(update_vals)Connect a callback to editing-finished on the detector view maximum color value field.
connect_inst_vmin_line(update_vals)Connect a callback to editing-finished on the detector view minimum color value field.
connect_instrument_auto_limits(update_limits)Connect a callback to the detector view "Auto Limits" checkbox.
connect_instrument_scale_combo(update_view)Connect a callback to the detector view scale (linear/log) combo box.
connect_integer_h_index(update_index)Connect a callback to editing-finished on the integer H index field.
connect_integer_k_index(update_index)Connect a callback to editing-finished on the integer K index field.
connect_integer_l_index(update_index)Connect a callback to editing-finished on the integer L index field.
connect_integer_m_index(update_index)Connect a callback to editing-finished on the integer m satellite index field.
connect_integer_n_index(update_index)Connect a callback to editing-finished on the integer n satellite index field.
connect_integer_p_index(update_index)Connect a callback to editing-finished on the integer p satellite index field.
connect_integrate_peaks(integrate_peaks)Connect a callback to the "Integrate" button click.
connect_k_index(update_index)Connect a callback to editing-finished on the fractional k index field.
connect_l_index(update_index)Connect a callback to editing-finished on the fractional l index field.
connect_lattice_transform(lattice_transform)Connect a callback to the lattice system combo box.
connect_load_Q(load_Q)Connect a callback to the "Load Q" button click.
connect_load_UB(load_UB)Connect a callback to the "Load UB" button click.
connect_load_peaks(load_peaks)Connect a callback to the "Load Peaks" button click.
connect_manual_axis(view_manual)Manual axis view connection.
connect_manual_up_axis(view_manual)Manual axis up view connection.
connect_optimize_UB(optimize_UB)Connect a callback to the "Refine" button click.
connect_peak_row_highligter(highlight_row)Connect a callback to peaks table selection changes.
connect_predict_peaks(predict_peaks)Connect a callback to the "Predict" button click.
connect_real_axes(view_a, view_b, view_c)Real axes view connections.
connect_reciprocal_axes(view_a_star, ...)Reciprocal axes view connections.
connect_reciprocal_real_compass(change_lattice)Reciprocal/real axis compass
connect_reload_convert_Q(convert_Q)Connect a callback to the "Convert + Reload" button click.
connect_roi_ready(replot)Connect a handler to the roi_ready signal.
connect_rotate(cww, cw)Connect Roll to presenter handler.
connect_save_Q(save_Q)Connect a callback to the "Save Q" button click.
connect_save_UB(save_UB)Connect a callback to the "Save UB" button click.
connect_save_peaks(save_peaks)Connect a callback to the "Save Peaks" button click.
connect_save_roi_mask(save_roi_mask)Connect a callback to the "Save ROI Mask" button click.
connect_save_screenshot(save_screenshot)Screenshot connection.
connect_scan_ready(replot)Connect a handler to the scan_ready signal.
connect_select_cell(select_cell)Connect a callback to the cell selection button click.
connect_select_form(select_form)Connect a callback to the "Select Conventional Cell" button click.
connect_set_UB(set_UB)Connect a callback to the "Set UB" button click.
Connect a callback to the "Search U from Scattering Plane" button click.
connect_slice_auto_limits(update_limits)Connect a callback to the slice view "Auto Limits" checkbox.
connect_slice_combo(update_slice[, ...])Connect callbacks to the slice axis-pair combo box.
connect_slice_line(update_slice)Connect a callback to editing-finished on the slice position field.
connect_slice_ready(add_peak)Connect a handler to the slice_ready signal.
connect_slice_scale_combo(update_slice)Connect a callback to the slice view scale (linear/log) combo box.
connect_slice_slider(reslice)Register the callback invoked when the slice slider is released.
connect_slice_thickness_line(update_slice)Connect a callback to editing-finished on the slice thickness field.
connect_slice_width_line(update_slice)Connect a callback to editing-finished on the slice width field.
connect_stop(stop)Connect stop button to presenter callback.
connect_switch_instrument(switch_instrument)Connect a callback to the instrument selection combo box.
connect_symmetry_transform(symmetry_transform)Connect a callback to the symmetry operation combo box.
connect_transform_UB(transform_UB)Connect a callback to the "Transform" button click.
connect_undo_filter_peaks(undo_filter_peaks)Connect a callback to the "Undo" filter button click.
connect_vbar_combo(update_cbar)Connect a callback to the detector view colormap combo box.
connect_vertical(update_inst_data)Connect a callback to editing-finished on the vertical angle field.
connect_vertical_roi(update_inst_data)Connect a callback to editing-finished on the vertical ROI size field.
connect_vlim_combo(update_clim)Connect a callback to the detector view color-limit method combo box.
connect_vmax_line(update_vals)Connect a callback to editing-finished on the slice view maximum color value field.
connect_vmin_line(update_vals)Connect a callback to editing-finished on the slice view minimum color value field.
connect_wavelength(update_wavelength)Connect a callback to editing-finished on the minimum wavelength field.
contentsMargins(self, /)contentsRect(self, /)contextMenuEvent(self, event, /)contextMenuPolicy(self, /)create(self, /[, arg__1, initializeWindow, ...])createWinId(self, /)createWindowContainer(window, /[, parent, flags])cursor(self, /)customEvent(self, event, /)deleteLater(self, /)depth(self, /)destroy(self, /[, destroyWindow, ...])devType(self, /)devicePixelRatio(self, /)devicePixelRatioF(self, /)devicePixelRatioFScale()disconnect(...)disconnectNotify(self, signal, /)dragEnterEvent(self, event, /)dragLeaveEvent(self, event, /)dragMoveEvent(self, event, /)dropEvent(self, event, /)dumpObjectInfo(self, /)dumpObjectTree(self, /)dynamicPropertyNames(self, /)effectiveWinId(self, /)emit(self, signal, /, *args)Get whether clicking the slice plot should add a peak.
encodeMetricF(metric, value, /)ensurePolished(self, /)enterEvent(self, event, /)event(self, event, /)eventFilter(obj, event)Filter key press/release events for the slice canvas and slider.
find(arg__1, /)findChild(self, type, /[, name, options])findChildren() -> List[~PlaceholderType] ))focusInEvent(self, event, /)focusNextChild(self, /)focusNextPrevChild(self, next, /)focusOutEvent(self, event, /)focusPolicy(self, /)focusPreviousChild(self, /)focusProxy(self, /)focusWidget(self, /)font(self, /)fontInfo(self, /)fontMetrics(self, /)foregroundRole(self, /)format_with_error(value, error)Format a value with its uncertainty in compact parenthetical notation.
frameGeometry(self, /)frameSize(self, /)geometry(self, /)get_IPTS()Get the IPTS proposal number.
Get the run number selected for goniometer alignment.
Get the goniometer tilt angles for alignment calculation.
Get whether aluminum powder-ring regions should be excluded.
Get whether copper powder-ring regions should be excluded.
Get whether iron powder-ring regions should be excluded.
Get the tolerance used when calculating the UB matrix.
get_camera_roll_direction()Get the current camera roll angle and view direction.
get_camera_state()Return the current camera position, focal point, and up vectors.
Get whether peak centroiding is enabled during integration.
Get the hkl to check the detector position for.
Get the selected color-limit clipping method for the slice view.
Get the DBSCAN clustering parameters for satellite peak clustering.
Return the default color bar percentile limits.
Get the selected colormap for the slice view.
Get the minimum d-spacing used when converting to Q-space.
Get the maximum d-spacing for the instrument/ROI view.
Get the minimum d-spacing for the instrument/ROI view.
Get the currently selected dataset index.
Get the detector calibration file path.
Get the diffraction coordinate for the current detector position.
Get whether adaptive ellipsoidal peak integration is enabled.
Get the experiment number.
Get the selected comparison operator for peak filtering.
Get the threshold value for peak filtering.
Get the selected peak property to filter by.
Get the minimum distance between found peaks.
Get the number of detector edge pixels to exclude during peak finding.
Get the density threshold and maximum peak count for peak finding.
Get the maximum d-spacing for peak finding.
get_form()Get the Niggli form number of the selected reduced-cell row.
Get the selected Niggli cell form number.
Get the goniometer calibration file path.
Get the Q vectors of the two highlighted peaks.
Get the horizontal detector coordinate.
Get the horizontal region-of-interest half-width.
Get the HKL indexing tolerances for fundamental and satellite peaks.
Get whether indexed HKL values should be rounded to integers.
Get whether satellite peak indexing is enabled.
Get the fractional and integer HKL/MNP indices from the index fields.
Get the two manually entered HKL triples used for angle/d-spacing calculations.
Get the maximum color-scale value for the instrument view.
Get the minimum color-scale value for the instrument view.
Get the currently selected instrument.
Get whether the instrument view color limits are auto-computed.
Get whether the instrument view auto-zooms to fit new data.
Get the selected colormap for the instrument view.
Get the selected color scale for the instrument view.
Get the peak and background shell radii for integration.
Get the six lattice constants from their line edits.
Get the selected lattice/Bravais system for symmetry transforms.
Get whether the Lorentz correction should be applied.
get_manual_axis_indices()Indices of manually entered direction components.
get_manual_axis_up_indices()Indices of manually entered direction up components.
Get the maximum modulation order and whether cross terms are used.
Get the maximum scalar error for Niggli cell determination.
Get the minimum and maximum lattice constant search bounds.
Get the three modulation vectors for satellite peak indexing.
get_peak()Get the index of the peak selected in the peaks table.
Get the peak width parameter used for peak finding.
Get the peak numbers currently selected in the peaks table.
Get the selected lattice centering used for peak prediction.
Get the number of detector edge pixels to exclude during peak prediction.
Get the minimum d-spacing for predicting fundamental and satellite peaks.
Get whether satellite peak prediction is enabled.
Get the 3x3 projection matrix from its line edits.
Get the selected UB refinement constraint option.
Get the tolerance used when refining the UB matrix.
get_rotate_step()Return the rotation step in degrees from the rotate tab.
get_runs()Get the list of run numbers from the runs line edit.
Get the u and v sample orientation direction vectors.
Get the selected slice plane.
Get whether the slice view color limits are auto-computed.
Get whether the slice view auto-zooms to fit new data.
Get the selected color scale for the slice view.
Get the out-of-plane slice integration thickness.
Get the out-of-plane slice coordinate.
Get the in-plane bin width for the slice view.
Get the selected symmetry (point/space group) symbol.
Get the time filter cutoff.
Get the tolerance used when applying a UB transformation.
Get the 3x3 lattice transformation matrix from its line edits.
Get the tube calibration file path.
Get the vertical detector coordinate.
Get the vertical region-of-interest half-width.
Get the selected color-limit clipping method for the instrument view.
Get the maximum color-scale value for the slice view.
Get the minimum color-scale value for the slice view.
Get the wavelength range from the min/max line edits.
grab(self, /[, rectangle])grabGesture(self, type, /[, flags])grabKeyboard(self, /)grabMouse(-> None)grabShortcut(self, key, /[, context])graphicsEffect(self, /)graphicsProxyWidget(self, /)hasFocus(self, /)hasHeightForWidth(self, /)hasMouseTracking(self, /)hasTabletTracking(self, /)height(self, /)heightForWidth(self, arg__1, /)heightMM(self, /)hide(self, /)hideEvent(self, event, /)highlight(ind)Select a peak in the table from a 3D view click.
highlight_peak(index)Highlight a peak given its block index (from table/logic).
highlight_peaks(indices)Highlight multiple peaks given their block indices.
inherits(self, classname, /)initPainter(self, painter, /)inputMethodEvent(self, event, /)inputMethodHints(self, /)inputMethodQuery(self, arg__1, /)insertAction(self, before, action, /)insertActions(self, before, actions, /)installEventFilter(self, filterObj, /)internalWinId(self, /)isActiveWindow(self, /)isAncestorOf(self, child, /)isEnabled(self, /)isEnabledTo(self, arg__1, /)isFullScreen(self, /)isHidden(self, /)isLeftToRight(self, /)isMaximized(self, /)isMinimized(self, /)isModal(self, /)isQmlExposed(self, /)isQuickItemType(self, /)isRightToLeft(self, /)isSignalConnected(self, signal, /)isTopLevel(self, /)isVisible(self, /)isVisibleTo(self, arg__1, /)isWidgetType(self, /)isWindow(self, /)isWindowModified(self, /)isWindowType(self, /)keyPressEvent(self, event, /)keyReleaseEvent(self, event, /)keyboardGrabber()killTimer(-> None)layout(self, /)layoutDirection(self, /)leaveEvent(self, event, /)load_Q_file_dialog([path])Open a dialog to select a Q-space NeXus file to load.
load_UB_file_dialog([path])Open a dialog to select a UB matrix file to load.
load_detector_cal_dialog([path])Open a dialog to select a detector calibration file to load.
load_goniometer_cal_dialog([path])Open a dialog to select a goniometer calibration file to load.
load_peaks_file_dialog([path])Open a dialog to select a peaks file to load.
load_tube_cal_dialog([path])Open a dialog to select a tube calibration file to load.
locale(self, /)logicalDpiX(self, /)logicalDpiY(self, /)lower(self, /)mapFrom(-> PySide6.QtCore.QPoint)mapFromGlobal(-> PySide6.QtCore.QPoint)mapFromParent(-> PySide6.QtCore.QPoint)mapTo(-> PySide6.QtCore.QPoint)mapToGlobal(-> PySide6.QtCore.QPoint)mapToParent(-> PySide6.QtCore.QPoint)mask(self, /)maximumHeight(self, /)maximumSize(self, /)maximumWidth(self, /)metaObject(self, /)metric(self, arg__1, /)minimumHeight(self, /)minimumSize(self, /)minimumSizeHint(self, /)minimumWidth(self, /)Build the "Modulation" tab.
mouseDoubleClickEvent(self, event, /)mouseGrabber()mouseMoveEvent(self, event, /)mousePressEvent(self, event, /)mouseReleaseEvent(self, event, /)move(-> None)moveEvent(self, event, /)moveToThread(self, thread, /)nativeEvent(self, eventType, message, /)nativeParentWidget(self, /)nextInFocusChain(self, /)normalGeometry(self, /)objectName(self, /)on_press_inst(event)Matplotlib button-press handler that picks a detector position.
on_press_scan(event)Matplotlib button-press handler that picks a diffraction value.
on_press_slice(event)Matplotlib button-press handler that picks an hkl on the slice plot.
overrideWindowFlags(self, type, /)overrideWindowState(self, state, /)paintEngine(self, /)paintEvent(self, event, /)paintingActive(self, /)palette(self, /)Build the "Parameters" tab containing Q/peaks/UB I/O controls.
parent(self, /)parentWidget(self, /)physicalDpiX(self, /)physicalDpiY(self, /)pos(self, /)previousInFocusChain(self, /)property(self, name, /)raise_(self, /)receivers(self, signal, /)reciprocal_lattice()State of reciprocal lattice vectors.
rect(self, /)redirected(self, offset, /)releaseKeyboard(self, /)releaseMouse(self, /)releaseShortcut(self, id, /)removeAction(self, action, /)removeEventFilter(self, obj, /)render(, sourceRegion, renderFlags, renderFlags)repaint(-> None -> None -> None)reset_camera()Reset the camera.
reset_scene()Restore the cached camera position, or reset the view.
reset_view([negative])Reset the view to the default isometric orientation.
resize(-> None)resizeEvent(self, event, /)restoreGeometry(self, geometry, /)runs_string_to_list(runs_str)Convert runs string to list using regex validation.
saveGeometry(self, /)save_Q_file_dialog([path])Open a dialog to choose a filename for saving Q-space data.
save_UB_file_dialog([path])Open a dialog to choose a filename for saving a UB matrix.
save_mask_file_dialog([path])Open a dialog to choose a filename for saving a detector mask.
save_peaks_file_dialog([path])Open a dialog to choose a filename for saving peaks data.
save_screenshot(filename)Save plotter screenshot.
save_screenshot_file_dialog()Prompt the user to choose a PNG file path for a screenshot.
screen(self, /)scroll(-> None)sender(self, /)senderSignalIndex(self, /)setAcceptDrops(self, on, /)setAccessibleDescription(self, description, /)setAccessibleIdentifier(self, identifier, /)setAccessibleName(self, name, /)setAttribute(self, arg__1, /[, on])setAutoFillBackground(self, enabled, /)setBackgroundRole(self, arg__1, /)setBaseSize(-> None)setContentsMargins(-> None)setContextMenuPolicy(self, policy, /)setCursor(self, arg__1, /)setDisabled(self, arg__1, /)setEnabled(self, arg__1, /)setFixedHeight(self, h, /)setFixedSize(-> None)setFixedWidth(self, w, /)setFocus(-> None)setFocusPolicy(self, policy, /)setFocusProxy(self, arg__1, /)setFont(self, arg__1, /)setForegroundRole(self, arg__1, /)setGeometry(-> None)setGraphicsEffect(self, effect, /)setHidden(self, hidden, /)setInputMethodHints(self, hints, /)setLayout(self, arg__1, /)setLayoutDirection(self, direction, /)setLocale(self, locale, /)setMask(-> None)setMaximumHeight(self, maxh, /)setMaximumSize(-> None)setMaximumWidth(self, maxw, /)setMinimumHeight(self, minh, /)setMinimumSize(-> None)setMinimumWidth(self, minw, /)setMouseTracking(self, enable, /)setObjectName(self, name, /)setPalette(self, arg__1, /)setParent(-> None)setProperty(self, name, value, /)setScreen(self, arg__1, /)setShortcutAutoRepeat(self, id, /[, enable])setShortcutEnabled(self, id, /[, enable])setSizeIncrement(-> None)setSizePolicy(-> None)setStatusTip(self, arg__1, /)setStyle(self, arg__1, /)setStyleSheet(self, styleSheet, /)setTabOrder(arg__1, arg__2, /)setTabletTracking(self, enable, /)setToolTip(self, arg__1, /)setToolTipDuration(self, msec, /)setUpdatesEnabled(self, enable, /)setVisible(self, visible, /)setWhatsThis(self, arg__1, /)setWindowFilePath(self, filePath, /)setWindowFlag(self, arg__1, /[, on])setWindowFlags(self, type, /)setWindowIcon(self, icon, /)setWindowIconText(self, arg__1, /)setWindowModality(self, windowModality, /)setWindowModified(self, arg__1, /)setWindowOpacity(self, level, /)setWindowRole(self, arg__1, /)setWindowState(self, state, /)setWindowTitle(self, arg__1, /)set_Q_status(status)Update the Q-sample status label text and color.
set_UB_status(status)Update the UB matrix status label text and color.
set_camera_state(position, focal_point, up)Apply a new camera state to the underlying plotter and refresh.
set_cell(row, cell)Populate one row of the reduced-cell table with a candidate cell.
set_cell_form(form)Set the form-number input field.
set_check_hkl(h, k, l)Set the hkl to check the detector position for.
set_convert_min_d(min_d)Set the minimum d-spacing used when converting to Q-space.
set_d_min(val)Set the minimum d-spacing for the instrument/ROI view.
set_d_phi(d_1, d_2, phi_12)Set the calculated d-spacing and angle fields for the two input HKLs.
set_data_list(values)Populate the data selection combo box with numbered entries.
set_detector_calibration(filename)Set the detector calibration file path.
set_diffraction(val)Set the diffraction coordinate for the current detector position.
Set the minimum distance between found peaks.
Set the maximum d-spacing for peak finding.
set_goniometer_axes(names)Set the goniometer axis name labels in both the peaks and detector view tabs.
set_goniometer_calibration(filename)Set the goniometer calibration file path.
set_goniometer_setting(angles)Set the goniometer angle readouts in both the peaks and detector view tabs.
set_highlight_phi(phi)Set the calculated angle between the two highlighted peaks.
set_horizontal(val)Set the horizontal detector coordinate.
set_indices(hkl, int_hkl, int_mnp)Set the fractional and integer HKL/MNP index fields.
set_info(status)Update status information.
set_inst_vmax_value(val)Set the maximum color-scale value for the instrument view.
set_inst_vmin_value(val)Set the minimum color-scale value for the instrument view.
set_instrument(instrument)Select an instrument in the instrument combo box.
Set the goniometer axis name label in the detector view tab, if present.
Set the goniometer angle readout in the detector view tab, if present.
set_item_value(value)Create a numeric, sortable table item.
set_lattice_constants(params, errors)Set the lattice constant fields, each formatted with its error.
set_modulatation_offsets(params)Set the three modulation vector line edits for satellite peaks.
set_oriented_lattice_parameters(a, b, c, ...)Update the oriented lattice paramters.
set_peak(row, peak)Populate one row of the peaks table with a peak's summary values.
set_peak_goniometer_axes(names)Set the goniometer axis name label in the peaks tab.
set_peak_goniometer_setting(angles)Set the goniometer angle readout in the peaks tab.
set_peak_info(peak)Populate the peak-detail fields with a single peak's information.
set_peaks_status(status)Update the peaks table status label text and color.
set_position(pos)Set the position.
set_sample_directions(params)Set the u, v, w sample orientation direction line edits.
set_step(progress)Update progress step.
set_transform(T)Apply a transform to the axes.
set_transform_matrix(params)Set the 3x3 lattice transformation matrix line edits.
set_tube_calibration(filename)Set the tube calibration file path.
set_undo_filter_enabled(enabled)Enable or disable the "Undo" filter button.
set_vertical(val)Set the vertical detector coordinate.
set_vmax_value(val)Set the maximum color-scale value for the slice view.
set_vmin_value(val)Set the minimum color-scale value for the slice view.
set_wavelength(wavelength)Set the wavelength line edit(s) from a single value or a range.
setup_slice_slider(z_min, z_max)Configure the slice slider for the given axis extent.
sharedPainter(self, /)show(self, /)showEvent(self, event, /)showFullScreen(self, /)showMaximized(self, /)showMinimized(self, /)showNormal(self, /)show_axes()Show or hide the coordinate axes actor in the plotter.
signalsBlocked(self, /)size(self, /)sizeHint(self, /)sizeIncrement(self, /)sizePolicy(self, /)stackUnder(self, arg__1, /)startTimer(self, interval, /[, timerType])start_worker_pool(worker)Connect a worker's output to the console and start it.
statusTip(self, /)stop_processes()Stop all running worker processes.
stop_processing(stop_event)Check if a stop has been requested.
style(self, /)styleSheet(self, /)Build the "Peaks" tab.
tabletEvent(self, event, /)testAttribute(self, arg__1, /)thread(self, /)timerEvent(self, event, /)toggle_console(state)Show or hide the console output widget.
toolTip(self, /)toolTipDuration(self, /)topLevelWidget(self, /)tr(self, sourceText, /[, disambiguation, n])underMouse(self, /)ungrabGesture(self, type, /)unsetCursor(self, /)unsetLayoutDirection(self, /)unsetLocale(self, /)update(-> None -> None -> None)updateGeometry(self, /)updateMicroFocus(self, /[, query])update_alignment_runs(peaks)Repopulate the alignment run combo box from the indexed peaks.
update_camera_display(roll, elevation, azimuth)Update the read-only camera orientation display, if present.
update_cell_table(cells)Repopulate the reduced-cell table from a list of candidate cells.
update_cluster_table(peak_info)Repopulate the cluster table with satellite centroid coordinates.
update_colorbar_vlims(vmin, vmax)Apply new color limits to the slice image and colorbar.
update_diffraction_label(mono)Update the label describing the diffraction axis units.
update_filter_description_label(option)Update the label describing the selected peak filter variable.
update_instrument_colorbar_vlims(vmin, vmax)Apply new color limits to the detector view image.
update_instrument_display(cmap_key, scale, ...)Update the colormap and normalization of the instrument view plot.
update_instrument_view(inst_view)Redraw the instrument detector (gamma/nu) image.
update_labels()Change the axes labels between Miller and fractional notation.
update_peaks_table(peaks)Repopulate the peaks table from a list of peak dictionaries.
update_refine_constraint_label(option)Update the label describing the constraints of a refinement option.
update_roi_view(roi_view)Draw or update the region-of-interest box on the instrument view.
update_scan_view(roi_view)Redraw the 1D diffraction scan (ROI-integrated intensity) plot.
update_slice(slice_dict)Redraw the 2D reciprocal-space slice plot from new slice data.
Recompute and apply slice colorbar limits from the current color-bar slider values.
update_slice_display(cmap_key, scale, vmin, vmax)Update the colormap, normalization, and colorbar of the slice plot.
update_symmetry_symbols(symbols)Repopulate the symmetry combo box with available symbols.
update_table_index(ind, hkl)Update the HKL columns of a single peaks-table row after reindexing.
update_theme()Apply the selected PyVista/matplotlib plot theme to the view.
update_wavelength(lamda_min)Mirror the minimum wavelength into the maximum field if locked.
updatesEnabled(self, /)Build the "Views" tab containing the slice and detector views.
view_up_vector(vec)Set the camera according to given vector(s).
view_vector(vecs)Set the camera according to given vector(s).
view_xy()View \(xy\)-plane.
view_xz()View \(xz\)-plane.
view_yx()View \(yx\)-plane.
view_yz()View \(yz\)-plane.
view_zx()View \(zx\)-plane.
view_zy()View \(zy\)-plane.
visibleRegion(self, /)whatsThis(self, /)wheelEvent(self, event, /)width(self, /)widthMM(self, /)winId(self, /)window(self, /)windowFilePath(self, /)windowFlags(self, /)windowHandle(self, /)windowIcon(self, /)windowIconText(self, /)windowModality(self, /)windowOpacity(self, /)windowRole(self, /)windowState(self, /)windowTitle(self, /)windowType(self, /)worker(task)Wrap a callable as a background
Workertask.x(self, /)y(self, /)PaintDeviceMetric
RenderFlag
cam_ready
customContextMenuRequested
destroyed
index_ready
log_output
objectNameChanged
roi_ready
scan_ready
slice_ready
windowIconChanged
windowIconTextChanged
windowTitleChanged
- add_Q_viz(Q_dict)[source]#
Render the Q-space volume and, if available, indexed peaks.
Clears the current scene, adds a volumetric rendering of the reciprocal-space signal along with axis lines, and if peak ellipsoid transforms are present, renders each peak as a sphere/ellipsoid colored by intensity (when integrated) or by HKL indexing status, with block picking enabled to allow selecting peaks interactively.
- Parameters:
- Q_dictdict
Dictionary describing the Q-space volume and peaks, with keys such as “signal”, “spacing”, “min_lim”, “max_lim” for the volume, and “transforms”, “intensities”, “indexings”, “numbers” for the peak ellipsoids.
- add_alignment_peaks(alignment_dict)[source]#
Draw observed-vs-predicted Q vectors for goniometer alignment.
Clears the current alignment plot, histograms the observed hkl deviations along each of the h/k/l axes, and renders the 3D observed and predicted Q vector point clouds with connecting axis wireframes for comparison.
- Parameters:
- alignment_dictdict
Alignment information containing
"observed"and"predicted"Q vector arrays, and"observed_hkl"hkl deviations, as produced by the model.
- add_cluster_peaks(peak_dict)[source]#
Draw clustered satellite peak positions and their unit-cell images.
Clears the current cluster plot, then for each DBSCAN cluster replicates its points across neighboring unit cells (via the lattice translation vectors), keeps only the images that fall within the reference cell, and renders them as a 3D point cloud. Unclustered (noise) points are drawn in black; clustered points are colored by cluster and histogrammed along each of the h/k/l axes. Also draws the reference unit-cell wireframe and its coordinate planes.
- Parameters:
- peak_dictdict
Clustering result containing
"coordinates"(peak positions),"clusters"(cluster label per peak, with negative labels for noise),"translation"(lattice translation vectors),"transform"(cell orientation matrix), and"inverse"(its inverse), as produced by the model.
- add_highlight_1(peak)[source]#
Display the first highlighted peak’s Q vector and d-spacing.
- Parameters:
- peakdict
Peak information dictionary containing
"Q"and"d_spacing"entries.
- add_highlight_2(peak)[source]#
Display the second highlighted peak’s Q vector and d-spacing.
- Parameters:
- peakdict
Peak information dictionary containing
"Q"and"d_spacing"entries.
- alignment_tab()[source]#
Build the “Alignment” tab.
Creates the run selector, manual goniometer yaw/pitch/roll correction inputs, the calculate-alignment button, and the matplotlib canvas comparing UB-predicted and observed peak positions, then adds the tab to the main tab widget.
- clear_alignment_plot()[source]#
Clear the 3D alignment view and reset the observed/predicted hkl histogram axes.
- clear_run_info(filepath)[source]#
Reset run/calibration fields and enable widgets for a facility.
- Parameters:
- filepathstr
Path or identifier used to detect the facility/instrument, e.g. containing “exp”, “SNS”, or “CORELLI”. Determines which experiment number, time filter, and calibration controls are enabled.
- connect_add_peak(add_peak)[source]#
Connect a callback to the “Add Peak” button click.
- Parameters:
- add_peakcallable
Slot invoked to add a new peak to the peaks workspace.
- connect_browse_calibration(load_detector_cal)[source]#
Connect a callback to the detector calibration browse button.
- Parameters:
- load_detector_calcallable
Slot invoked to open a file dialog and load a detector calibration file.
- connect_browse_goniometer(load_goniometer_cal)[source]#
Connect a callback to the goniometer calibration browse button.
- Parameters:
- load_goniometer_calcallable
Slot invoked to open a file dialog and load a goniometer calibration file.
- connect_browse_tube(load_tube_cal)[source]#
Connect a callback to the tube calibration browse button.
- Parameters:
- load_tube_calcallable
Slot invoked to open a file dialog and load a tube calibration file.
- connect_calculate_alignment(calculate_alignment)[source]#
Connect a callback to the calculate-alignment button click.
- Parameters:
- calculate_alignmentcallable
Slot invoked to compute the alignment comparison.
- connect_calculate_highlight(calculate_highlight)[source]#
Connect a callback to the highlighted-peaks “Calculate” button click.
- Parameters:
- calculate_highlightcallable
Slot invoked to calculate d-spacings and angle between the two highlighted peaks.
- connect_calculate_peaks(calculate_peaks)[source]#
Connect a callback to the peak calculator’s “Calculate” button click.
- Parameters:
- calculate_peakscallable
Slot invoked to calculate d-spacings and angle between the two entered hkl values.
- connect_cbar_combo(update_cbar)[source]#
Connect a callback to the slice view colormap combo box.
- Parameters:
- update_cbarcallable
Slot invoked when the selected colormap changes.
- connect_cell_row_highligter(highlight_row)[source]#
Connect a callback to cell table selection changes.
- Parameters:
- highlight_rowcallable
Slot invoked when the selected row(s) in the cell table change.
- connect_check_hkl(check_hkl)[source]#
Connect a callback to the “Check hkl” button click.
- Parameters:
- check_hklcallable
Slot invoked to validate the entered hkl indices.
- connect_clim_combo(update_clim)[source]#
Connect a callback to the slice view color-limit method combo box.
- Parameters:
- update_climcallable
Slot invoked when the selected color-limit method changes.
- connect_cluster(cluster)[source]#
Connect a callback to the cluster button click.
- Parameters:
- clustercallable
Slot invoked to cluster the selected peaks.
- connect_convert_HKL(convert_HKL)[source]#
Connect a callback to the “Convert” button click for HKL conversion.
- Parameters:
- convert_HKLcallable
Slot invoked to convert Q-sample data to HKL.
- connect_convert_Q(convert_Q)[source]#
Connect a callback to the “Convert” button click for Q conversion.
- Parameters:
- convert_Qcallable
Slot invoked to convert raw data to a Q-sample workspace.
- connect_convert_to_hkl(convert_to_hkl)[source]#
Connect a callback to the “Convert” button in the slice view tab.
- Parameters:
- convert_to_hklcallable
Slot invoked to convert Q-sample data to an HKL workspace.
- connect_d_max(update_inst_data)[source]#
Connect a callback to editing-finished on the detector view maximum d-spacing field.
- Parameters:
- update_inst_datacallable
Slot invoked when editing of the d(max) field finishes.
- connect_d_min(update_inst_data)[source]#
Connect a callback to editing-finished on the detector view minimum d-spacing field.
- Parameters:
- update_inst_datacallable
Slot invoked when editing of the d(min) field finishes.
- connect_data_combo(update_inst_data)[source]#
Connect a callback to the instrument data source combo box.
- Parameters:
- update_inst_datacallable
Slot invoked when the selected data source changes.
- connect_delete_peak(delete_peak)[source]#
Connect a callback to the “Delete Highlighted” button click.
- Parameters:
- delete_peakcallable
Slot invoked to delete the currently highlighted peak.
- connect_diffraction(update_inst_data)[source]#
Connect a callback to editing-finished on the diffraction angle field.
- Parameters:
- update_inst_datacallable
Slot invoked when editing of the diffraction field finishes.
- connect_filter_peaks(filter_peaks)[source]#
Connect a callback to the “Filter” button click.
- Parameters:
- filter_peakscallable
Slot invoked to filter the peaks table by the selected variable, comparison, and value.
- connect_find_conventional(find_conventional)[source]#
Connect a callback to the “Find UB with Lattice Parameters” button click.
- Parameters:
- find_conventionalcallable
Slot invoked to search for a conventional cell matching the given lattice parameters.
- connect_find_distance(update)[source]#
Connect a callback to editing-finished on the minimum peak distance field.
- Parameters:
- updatecallable
Slot invoked when editing of the minimum distance field finishes.
- connect_find_niggli(find_niggli)[source]#
Connect a callback to the “Find Primitive Cell” button click.
- Parameters:
- find_nigglicallable
Slot invoked to search for the reduced (Niggli) cell.
- connect_find_peaks(find_peaks)[source]#
Connect a callback to the “Find” peaks button click.
- Parameters:
- find_peakscallable
Slot invoked to search for peaks in the Q workspace.
- connect_find_spacing(update)[source]#
Connect a callback to editing-finished on the maximum d-spacing field.
- Parameters:
- updatecallable
Slot invoked when editing of the maximum spacing field finishes.
- connect_h_index(update_index)[source]#
Connect a callback to editing-finished on the fractional h index field.
- Parameters:
- update_indexcallable
Slot invoked when editing of the h field finishes.
- connect_hand_index_peak(reindex)[source]#
Connect a callback to the index_ready signal.
- Parameters:
- reindexcallable
Slot invoked when index_ready is emitted, i.e. when a peak has been reindexed by hand.
- connect_highlight_1(add)[source]#
Connect a callback to the first “Add Highlighted” button click.
- Parameters:
- addcallable
Slot invoked to add the currently highlighted peak as peak 1.
- connect_highlight_2(add)[source]#
Connect a callback to the second “Add Highlighted” button click.
- Parameters:
- addcallable
Slot invoked to add the currently highlighted peak as peak 2.
- connect_horizontal(update_inst_data)[source]#
Connect a callback to editing-finished on the horizontal angle field.
- Parameters:
- update_inst_datacallable
Slot invoked when editing of the horizontal angle field finishes.
- connect_horizontal_roi(update_inst_data)[source]#
Connect a callback to editing-finished on the horizontal ROI size field.
- Parameters:
- update_inst_datacallable
Slot invoked when editing of the horizontal ROI field finishes.
- connect_index_peaks(index_peaks)[source]#
Connect a callback to the “Index” button click.
- Parameters:
- index_peakscallable
Slot invoked to index the peaks table using the current UB.
- connect_inst_vmax_line(update_vals)[source]#
Connect a callback to editing-finished on the detector view maximum color value field.
- Parameters:
- update_valscallable
Slot invoked when editing of the instrument V Max field finishes.
- connect_inst_vmin_line(update_vals)[source]#
Connect a callback to editing-finished on the detector view minimum color value field.
- Parameters:
- update_valscallable
Slot invoked when editing of the instrument V Min field finishes.
- connect_instrument_auto_limits(update_limits)[source]#
Connect a callback to the detector view “Auto Limits” checkbox.
- Parameters:
- update_limitscallable
Slot invoked when the instrument auto-limits checkbox is toggled.
- connect_instrument_scale_combo(update_view)[source]#
Connect a callback to the detector view scale (linear/log) combo box.
- Parameters:
- update_viewcallable
Slot invoked when the selected scale changes.
- connect_integer_h_index(update_index)[source]#
Connect a callback to editing-finished on the integer H index field.
- Parameters:
- update_indexcallable
Slot invoked when editing of the integer H field finishes.
- connect_integer_k_index(update_index)[source]#
Connect a callback to editing-finished on the integer K index field.
- Parameters:
- update_indexcallable
Slot invoked when editing of the integer K field finishes.
- connect_integer_l_index(update_index)[source]#
Connect a callback to editing-finished on the integer L index field.
- Parameters:
- update_indexcallable
Slot invoked when editing of the integer L field finishes.
- connect_integer_m_index(update_index)[source]#
Connect a callback to editing-finished on the integer m satellite index field.
- Parameters:
- update_indexcallable
Slot invoked when editing of the integer m field finishes.
- connect_integer_n_index(update_index)[source]#
Connect a callback to editing-finished on the integer n satellite index field.
- Parameters:
- update_indexcallable
Slot invoked when editing of the integer n field finishes.
- connect_integer_p_index(update_index)[source]#
Connect a callback to editing-finished on the integer p satellite index field.
- Parameters:
- update_indexcallable
Slot invoked when editing of the integer p field finishes.
- connect_integrate_peaks(integrate_peaks)[source]#
Connect a callback to the “Integrate” button click.
- Parameters:
- integrate_peakscallable
Slot invoked to integrate peak intensities.
- connect_k_index(update_index)[source]#
Connect a callback to editing-finished on the fractional k index field.
- Parameters:
- update_indexcallable
Slot invoked when editing of the k field finishes.
- connect_l_index(update_index)[source]#
Connect a callback to editing-finished on the fractional l index field.
- Parameters:
- update_indexcallable
Slot invoked when editing of the l field finishes.
- connect_lattice_transform(lattice_transform)[source]#
Connect a callback to the lattice system combo box.
- Parameters:
- lattice_transformcallable
Slot invoked when the selected lattice system changes.
- connect_load_Q(load_Q)[source]#
Connect a callback to the “Load Q” button click.
- Parameters:
- load_Qcallable
Slot invoked to load a Q-sample workspace from a file.
- connect_load_UB(load_UB)[source]#
Connect a callback to the “Load UB” button click.
- Parameters:
- load_UBcallable
Slot invoked to load a UB matrix from a file.
- connect_load_peaks(load_peaks)[source]#
Connect a callback to the “Load Peaks” button click.
- Parameters:
- load_peakscallable
Slot invoked to load a peaks table from a file.
- connect_optimize_UB(optimize_UB)[source]#
Connect a callback to the “Refine” button click.
- Parameters:
- optimize_UBcallable
Slot invoked to refine (optimize) the UB matrix.
- connect_peak_row_highligter(highlight_row)[source]#
Connect a callback to peaks table selection changes.
- Parameters:
- highlight_rowcallable
Slot invoked when the selected row(s) in the peaks table change.
- connect_predict_peaks(predict_peaks)[source]#
Connect a callback to the “Predict” button click.
- Parameters:
- predict_peakscallable
Slot invoked to predict peak positions from the UB matrix.
- connect_reload_convert_Q(convert_Q)[source]#
Connect a callback to the “Convert + Reload” button click.
- Parameters:
- convert_Qcallable
Slot invoked to force-reload raw data and convert to a Q-sample workspace.
- connect_roi_ready(replot)[source]#
Connect a handler to the roi_ready signal.
- Parameters:
- replotcallable
Slot invoked when roi_ready is emitted, i.e. when the region of interest has been repositioned by clicking on the instrument view.
- connect_save_Q(save_Q)[source]#
Connect a callback to the “Save Q” button click.
- Parameters:
- save_Qcallable
Slot invoked to save the Q-sample workspace to a file.
- connect_save_UB(save_UB)[source]#
Connect a callback to the “Save UB” button click.
- Parameters:
- save_UBcallable
Slot invoked to save the UB matrix to a file.
- connect_save_peaks(save_peaks)[source]#
Connect a callback to the “Save Peaks” button click.
- Parameters:
- save_peakscallable
Slot invoked to save the peaks table to a file.
- connect_save_roi_mask(save_roi_mask)[source]#
Connect a callback to the “Save ROI Mask” button click.
- Parameters:
- save_roi_maskcallable
Slot invoked to save the current instrument ROI as a mask file.
- connect_scan_ready(replot)[source]#
Connect a handler to the scan_ready signal.
- Parameters:
- replotcallable
Slot invoked when scan_ready is emitted, i.e. when the diffraction value has been repositioned by clicking on the scan view.
- connect_select_cell(select_cell)[source]#
Connect a callback to the cell selection button click.
- Parameters:
- select_cellcallable
Slot invoked to select the highlighted cell.
- connect_select_form(select_form)[source]#
Connect a callback to the “Select Conventional Cell” button click.
- Parameters:
- select_formcallable
Slot invoked to select the highlighted cell in the cell table.
- connect_set_UB(set_UB)[source]#
Connect a callback to the “Set UB” button click.
- Parameters:
- set_UBcallable
Slot invoked to set the UB matrix from the entered lattice parameters and orientation.
- connect_set_UB_from_scattering_plane(set_UB)[source]#
Connect a callback to the “Search U from Scattering Plane” button click.
- Parameters:
- set_UBcallable
Slot invoked to compute the UB matrix from the scattering plane vectors.
- connect_slice_auto_limits(update_limits)[source]#
Connect a callback to the slice view “Auto Limits” checkbox.
- Parameters:
- update_limitscallable
Slot invoked when the auto-limits checkbox is toggled.
- connect_slice_combo(update_slice, update_extent=None)[source]#
Connect callbacks to the slice axis-pair combo box.
Resetting the slice position to zero is always connected first, followed optionally by an extent-update callback, and finally the slice redraw callback.
- Parameters:
- update_slicecallable
Slot invoked to redraw the slice after the axis pair changes.
- update_extentcallable, optional
Slot invoked to update the slice extent/slider range after the axis pair changes, by default None.
- connect_slice_line(update_slice)[source]#
Connect a callback to editing-finished on the slice position field.
- Parameters:
- update_slicecallable
Slot invoked when editing of the slice position field finishes.
- connect_slice_ready(add_peak)[source]#
Connect a handler to the slice_ready signal.
- Parameters:
- add_peakcallable
Slot invoked when slice_ready is emitted, i.e. when the user picks an hkl position on the slice plot to add as a peak.
- connect_slice_scale_combo(update_slice)[source]#
Connect a callback to the slice view scale (linear/log) combo box.
- Parameters:
- update_slicecallable
Slot invoked when the selected scale changes.
- connect_slice_slider(reslice)[source]#
Register the callback invoked when the slice slider is released.
- Parameters:
- reslicecallable
Slot invoked to redraw the slice view once slider dragging ends.
- connect_slice_thickness_line(update_slice)[source]#
Connect a callback to editing-finished on the slice thickness field.
- Parameters:
- update_slicecallable
Slot invoked when editing of the slice thickness field finishes.
- connect_slice_width_line(update_slice)[source]#
Connect a callback to editing-finished on the slice width field.
- Parameters:
- update_slicecallable
Slot invoked when editing of the slice width field finishes.
- connect_switch_instrument(switch_instrument)[source]#
Connect a callback to the instrument selection combo box.
- Parameters:
- switch_instrumentcallable
Slot invoked when the user selects a different instrument.
- connect_symmetry_transform(symmetry_transform)[source]#
Connect a callback to the symmetry operation combo box.
- Parameters:
- symmetry_transformcallable
Slot invoked when the selected symmetry operation changes.
- connect_transform_UB(transform_UB)[source]#
Connect a callback to the “Transform” button click.
- Parameters:
- transform_UBcallable
Slot invoked to apply the lattice transformation matrix to the UB matrix.
- connect_undo_filter_peaks(undo_filter_peaks)[source]#
Connect a callback to the “Undo” filter button click.
- Parameters:
- undo_filter_peakscallable
Slot invoked to restore the peaks table to its state before the last filter operation.
- connect_vbar_combo(update_cbar)[source]#
Connect a callback to the detector view colormap combo box.
- Parameters:
- update_cbarcallable
Slot invoked when the selected colormap changes.
- connect_vertical(update_inst_data)[source]#
Connect a callback to editing-finished on the vertical angle field.
- Parameters:
- update_inst_datacallable
Slot invoked when editing of the vertical angle field finishes.
- connect_vertical_roi(update_inst_data)[source]#
Connect a callback to editing-finished on the vertical ROI size field.
- Parameters:
- update_inst_datacallable
Slot invoked when editing of the vertical ROI field finishes.
- connect_vlim_combo(update_clim)[source]#
Connect a callback to the detector view color-limit method combo box.
- Parameters:
- update_climcallable
Slot invoked when the selected color-limit method changes.
- connect_vmax_line(update_vals)[source]#
Connect a callback to editing-finished on the slice view maximum color value field.
- Parameters:
- update_valscallable
Slot invoked when editing of the V Max field finishes.
- connect_vmin_line(update_vals)[source]#
Connect a callback to editing-finished on the slice view minimum color value field.
- Parameters:
- update_valscallable
Slot invoked when editing of the V Min field finishes.
- connect_wavelength(update_wavelength)[source]#
Connect a callback to editing-finished on the minimum wavelength field.
- Parameters:
- update_wavelengthcallable
Slot invoked when editing of the wavelength field finishes.
- enable_slice_peak_add()[source]#
Get whether clicking the slice plot should add a peak.
- Returns:
- enabledbool
True if the “add peak from slice” checkbox is checked.
- eventFilter(obj, event)[source]#
Filter key press/release events for the slice canvas and slider.
Handles left/right arrow key presses on the slice canvas by stepping the slice slider, and triggers a reslice when the arrow key is released.
- Parameters:
- objQObject
The object that generated the event.
- eventQEvent
The event being filtered.
- Returns:
- handledbool
True if the event was handled and should be filtered out, otherwise the result of the base class event filter.
- format_with_error(value, error)[source]#
Format a value with its uncertainty in compact parenthetical notation.
The value and error are rounded to the decimal place implied by the error’s order of magnitude, e.g. 3.14159 with error 0.02 becomes “3.14(2)”.
- Parameters:
- valuefloat
Central value to format.
- errorfloat
Uncertainty on the value. If not positive, the value is returned unformatted with no error digits.
- Returns:
- formatted_strstr
Value with the trailing error digit(s) in parentheses.
- get_IPTS()[source]#
Get the IPTS proposal number.
- Returns:
- iptsstr
IPTS number, or None if the field contains invalid input.
- get_alignment_run()[source]#
Get the run number selected for goniometer alignment.
- Returns:
- run_numberint
Selected run number, or None if no run is selected (e.g. the combo box shows “None” or free-form text).
- get_alignment_tilts()[source]#
Get the goniometer tilt angles for alignment calculation.
- Returns:
- tiltstuple of float
(yaw, pitch, roll)tilt angles.- Returns None instead if any tilt field contains invalid input.
- get_avoid_aluminum()[source]#
Get whether aluminum powder-ring regions should be excluded.
- Returns:
- avoidbool
True if the aluminum exclusion checkbox is checked.
- get_avoid_copper()[source]#
Get whether copper powder-ring regions should be excluded.
- Returns:
- avoidbool
True if the copper exclusion checkbox is checked.
- get_avoid_iron()[source]#
Get whether iron powder-ring regions should be excluded.
- Returns:
- avoidbool
True if the iron exclusion checkbox is checked.
- get_calculate_UB_tol()[source]#
Get the tolerance used when calculating the UB matrix.
- Returns:
- tolfloat
HKL indexing tolerance, or None if the field contains invalid input.
- get_centroid()[source]#
Get whether peak centroiding is enabled during integration.
- Returns:
- centroidbool
True if the centroid checkbox is checked.
- get_check_hkl()[source]#
Get the hkl to check the detector position for.
- Returns:
- hkllist of float
[h, k, l]Miller indices, or None if any field contains invalid input.
- get_clim_clip_type()[source]#
Get the selected color-limit clipping method for the slice view.
- Returns:
- ctypestr
Selected clipping method, e.g. “μ±3×σ” or “Q₃/Q₁±1.5×IQR”.
- get_cluster_parameters()[source]#
Get the DBSCAN clustering parameters for satellite peak clustering.
- Returns:
- epsfloat
Maximum neighborhood distance between two samples.
- min_samplesint
Minimum number of samples in a neighborhood for a point to be considered a core point.
- Returns None instead if either field contains invalid input.
- get_color_bar_values()[source]#
Return the default color bar percentile limits.
- Returns:
- vmin, vmaxint
Lower and upper percentile limits, fixed at 0 and 100.
- get_colormap()[source]#
Get the selected colormap for the slice view.
- Returns:
- cmapstr
Selected colormap name.
- get_convert_min_d()[source]#
Get the minimum d-spacing used when converting to Q-space.
- Returns:
- min_dfloat
Minimum d-spacing in angstroms, or None if the field contains invalid input.
- get_d_max()[source]#
Get the maximum d-spacing for the instrument/ROI view.
- Returns:
- valfloat
Maximum d-spacing in angstroms (may be
inf), or None if the field contains invalid input.
- get_d_min()[source]#
Get the minimum d-spacing for the instrument/ROI view.
- Returns:
- valfloat
Minimum d-spacing in angstroms, or None if the field contains invalid input.
- get_data_list()[source]#
Get the currently selected dataset index.
- Returns:
- indexint
Zero-based index of the selected dataset, parsed from the “row: label” text of the combo box.
- get_detector_calibration()[source]#
Get the detector calibration file path.
- Returns:
- filenamestr
Path to the detector calibration file.
- get_diffraction()[source]#
Get the diffraction coordinate for the current detector position.
- Returns:
- valfloat
Diffraction value (e.g. time-of-flight or wavelength), or None if the field contains invalid input.
- get_ellipsoid()[source]#
Get whether adaptive ellipsoidal peak integration is enabled.
- Returns:
- ellipsoidbool
True if the adaptive ellipsoid checkbox is checked.
- get_experiment()[source]#
Get the experiment number.
- Returns:
- experimentstr
Experiment number, or None if the field contains invalid input.
- get_filter_comparison()[source]#
Get the selected comparison operator for peak filtering.
- Returns:
- comparisonstr
Selected comparison operator, e.g. “>”, “<”, “=”.
- get_filter_value()[source]#
Get the threshold value for peak filtering.
- Returns:
- valuefloat
Filter threshold value, or None if the field contains invalid input.
- get_filter_variable()[source]#
Get the selected peak property to filter by.
- Returns:
- variablestr
Selected filter variable, e.g. “I/sigma”, “d”, “Q”.
- get_find_peaks_distance()[source]#
Get the minimum distance between found peaks.
- Returns:
- distancefloat
Minimum peak separation, or None if the field contains invalid input.
- get_find_peaks_edge()[source]#
Get the number of detector edge pixels to exclude during peak finding.
- Returns:
- edgeint
Number of edge pixels to exclude, or None if the field contains invalid input.
- get_find_peaks_parameters()[source]#
Get the density threshold and maximum peak count for peak finding.
- Returns:
- paramslist
Two-element [density_threshold, max_peaks] as integers, or None if either field contains invalid input.
- get_find_peaks_spacing()[source]#
Get the maximum d-spacing for peak finding.
- Returns:
- spacingfloat
Maximum d-spacing in angstroms, or None if the field contains invalid input.
- get_form()[source]#
Get the Niggli form number of the selected reduced-cell row.
- Returns:
- formint
Form number shown in the vertical header of the currently selected cell_table row, or None if no row is selected.
- get_form_number()[source]#
Get the selected Niggli cell form number.
- Returns:
- formint
Form number of the selected conventional cell, or None if the field is empty.
- get_goniometer_calibration()[source]#
Get the goniometer calibration file path.
- Returns:
- filenamestr
Path to the goniometer calibration file.
- get_highlight()[source]#
Get the Q vectors of the two highlighted peaks.
- Returns:
- peak_1list of float
Q vector
[Qx, Qy, Qz]of the first highlighted peak.- peak_2list of float
Q vector
[Qx, Qy, Qz]of the second highlighted peak.- Returns None instead if either highlighted-peak field does not
- contain exactly three comma-separated values.
- get_horizontal()[source]#
Get the horizontal detector coordinate.
- Returns:
- valfloat
Horizontal detector position, or None if the field contains invalid input.
- get_horizontal_roi()[source]#
Get the horizontal region-of-interest half-width.
- Returns:
- valfloat
Horizontal ROI half-width, or None if the field contains invalid input.
- get_index_peaks_parameters()[source]#
Get the HKL indexing tolerances for fundamental and satellite peaks.
- Returns:
- tolfloat
Indexing tolerance for fundamental peaks.
- sat_tolfloat
Indexing tolerance for satellite peaks. Falls back to
tolif the satellite tolerance field is invalid.- Returns None if the fundamental tolerance field contains
- invalid input.
- get_index_peaks_round()[source]#
Get whether indexed HKL values should be rounded to integers.
- Returns:
- round_hklbool
True if the round HKL checkbox is checked.
- get_index_satellite_peaks()[source]#
Get whether satellite peak indexing is enabled.
- Returns:
- index_satbool
True if the satellite peak indexing checkbox is checked.
- get_indices()[source]#
Get the fractional and integer HKL/MNP indices from the index fields.
- Returns:
- hkllist
Fractional
[H, K, L]Miller indices.- int_hkllist
Integer
[h, k, l]Miller indices.- int_mnplist
Integer
[m, n, p]satellite indices.- Returns None instead if any index field contains invalid input.
- get_input_hkls()[source]#
Get the two manually entered HKL triples used for angle/d-spacing calculations.
- Returns:
- params_1list or None
[h, k, l]for the first plane, or None if the fields contain invalid input.- params_2list or None
[h, k, l]for the second plane, or None if the fields contain invalid input.
- get_inst_vmax_value()[source]#
Get the maximum color-scale value for the instrument view.
- Returns:
- valfloat
Maximum display value, or None if the field contains invalid input.
- get_inst_vmin_value()[source]#
Get the minimum color-scale value for the instrument view.
- Returns:
- valfloat
Minimum display value, or None if the field contains invalid input.
- get_instrument()[source]#
Get the currently selected instrument.
- Returns:
- instrumentstr
Name of the selected instrument.
- get_instrument_auto_limits()[source]#
Get whether the instrument view color limits are auto-computed.
- Returns:
- enabledbool
True if automatic color-limit scaling is enabled.
- get_instrument_auto_zoom()[source]#
Get whether the instrument view auto-zooms to fit new data.
- Returns:
- enabledbool
True if automatic zoom is enabled.
- get_instrument_colormap()[source]#
Get the selected colormap for the instrument view.
- Returns:
- cmapstr
Selected colormap name.
- get_instrument_scale()[source]#
Get the selected color scale for the instrument view.
- Returns:
- scalestr
Selected scale in lowercase, e.g. “linear” or “log”.
- get_integrate_peaks_parameters()[source]#
Get the peak and background shell radii for integration.
- Returns:
- paramslist
Three-element [radius, inner, outer] radii, or None if any field contains invalid input.
- get_lattice_constants()[source]#
Get the six lattice constants from their line edits.
- Returns:
- paramslist
[a, b, c, alpha, beta, gamma] as floats, parsed by stripping any trailing “(error)” notation, or None if any field contains invalid input.
- get_lattice_transform()[source]#
Get the selected lattice/Bravais system for symmetry transforms.
- Returns:
- cellstr
Name of the selected lattice system.
- get_lorentz()[source]#
Get whether the Lorentz correction should be applied.
- Returns:
- lorentzbool
True if the Lorentz correction checkbox is checked.
- get_max_order_cross_terms()[source]#
Get the maximum modulation order and whether cross terms are used.
- Returns:
- max_orderint
Maximum modulation order for satellite peak indexing.
- cross_termsbool
True if cross terms between modulation vectors should be included.
- Returns None if the maximum order field contains invalid
- input.
- get_max_scalar_error()[source]#
Get the maximum scalar error for Niggli cell determination.
- Returns:
- errorfloat
Maximum allowed scalar error, or None if the field contains invalid input.
- get_min_max_constants()[source]#
Get the minimum and maximum lattice constant search bounds.
- Returns:
- paramslist
Two-element [min, max] lattice constant bound in angstroms, or None if either field contains invalid input.
- get_modulatation_offsets()[source]#
Get the three modulation vectors for satellite peak indexing.
- Returns:
- paramslist
Nine components, [dh1, dk1, dl1, dh2, dk2, dl2, dh3, dk3, dl3], as floats describing up to three modulation vectors, or None if any field contains invalid input.
- get_peak()[source]#
Get the index of the peak selected in the peaks table.
- Returns:
- indexint
Zero-based peak index corresponding to the selected row, or None if no row is selected or the peak number is missing.
- get_peak_width()[source]#
Get the peak width parameter used for peak finding.
- Returns:
- widthfloat
Peak width, or None if the field contains invalid input.
- get_peaks()[source]#
Get the peak numbers currently selected in the peaks table.
- Returns:
- peakslist
Sorted, unique zero-based peak indices for the selected rows.
- get_predict_peaks_centering()[source]#
Get the selected lattice centering used for peak prediction.
- Returns:
- centeringstr
Selected centering symbol.
- get_predict_peaks_edge()[source]#
Get the number of detector edge pixels to exclude during peak prediction.
- Returns:
- edgeint
Number of edge pixels to exclude, or None if the field contains invalid input.
- get_predict_peaks_parameters()[source]#
Get the minimum d-spacing for predicting fundamental and satellite peaks.
- Returns:
- d_minfloat
Minimum d-spacing for fundamental peaks.
- sat_d_minfloat
Minimum d-spacing for satellite peaks. Falls back to
d_minif the satellite field is invalid.- Returns None if the fundamental minimum d-spacing field
- contains invalid input.
- get_predict_satellite_peaks()[source]#
Get whether satellite peak prediction is enabled.
- Returns:
- predict_satbool
True if the satellite peak prediction checkbox is checked.
- get_projection_matrix()[source]#
Get the 3x3 projection matrix from its line edits.
- Returns:
- paramslist
Nine matrix elements, row-major [U1, U2, U3, V1, V2, V3, W1, W2, W3], as floats, or None if any field contains invalid input.
- get_refine_UB_option()[source]#
Get the selected UB refinement constraint option.
- Returns:
- optionstr
Name of the selected refinement option, e.g. “Unconstrained”, “Constrained”, or a Bravais lattice system such as “Cubic”.
- get_refine_UB_tol()[source]#
Get the tolerance used when refining the UB matrix.
- Returns:
- tolfloat
HKL indexing tolerance, or None if the field contains invalid input.
- get_runs()[source]#
Get the list of run numbers from the runs line edit.
- Returns:
- runslist or None
Integer run numbers parsed from the condensed notation, or None if the input is invalid.
- get_sample_directions()[source]#
Get the u and v sample orientation direction vectors.
- Returns:
- paramslist
Six HKL components, [uh, uk, ul, vh, vk, vl], as floats, or None if any field contains invalid input.
- get_slice()[source]#
Get the selected slice plane.
- Returns:
- planestr
Selected slice plane, e.g. “Axis 1/2”.
- get_slice_auto_limits()[source]#
Get whether the slice view color limits are auto-computed.
- Returns:
- enabledbool
True if automatic color-limit scaling is enabled.
- get_slice_auto_zoom()[source]#
Get whether the slice view auto-zooms to fit new data.
- Returns:
- enabledbool
True if automatic zoom is enabled.
- get_slice_scale()[source]#
Get the selected color scale for the slice view.
- Returns:
- scalestr
Selected scale in lowercase, e.g. “linear” or “log”.
- get_slice_thickness()[source]#
Get the out-of-plane slice integration thickness.
- Returns:
- valfloat
Slice thickness, or None if the field contains invalid input.
- get_slice_value()[source]#
Get the out-of-plane slice coordinate.
- Returns:
- valfloat
Slice position, or None if the field contains invalid input.
- get_slice_width()[source]#
Get the in-plane bin width for the slice view.
- Returns:
- valfloat
Slice bin width, or None if the field contains invalid input.
- get_symmetry_symbol()[source]#
Get the selected symmetry (point/space group) symbol.
- Returns:
- symbolstr
Selected symmetry symbol.
- get_time_stop()[source]#
Get the time filter cutoff.
- Returns:
- time_stopstr
Time filter stop value, or None if the field contains invalid input.
- get_transform_UB_tol()[source]#
Get the tolerance used when applying a UB transformation.
- Returns:
- tolfloat
HKL indexing tolerance, or None if the field contains invalid input.
- get_transform_matrix()[source]#
Get the 3x3 lattice transformation matrix from its line edits.
- Returns:
- paramslist
Nine matrix elements, row-major [T11, T12, T13, T21, T22, T23, T31, T32, T33], as floats, or None if any field contains invalid input.
- get_tube_calibration()[source]#
Get the tube calibration file path.
- Returns:
- filenamestr
Path to the tube calibration file.
- get_vertical()[source]#
Get the vertical detector coordinate.
- Returns:
- valfloat
Vertical detector position, or None if the field contains invalid input.
- get_vertical_roi()[source]#
Get the vertical region-of-interest half-width.
- Returns:
- valfloat
Vertical ROI half-width, or None if the field contains invalid input.
- get_vlim_clip_type()[source]#
Get the selected color-limit clipping method for the instrument view.
- Returns:
- ctypestr
Selected clipping method, e.g. “μ±3×σ” or “Q₃/Q₁±1.5×IQR”.
- get_vmax_value()[source]#
Get the maximum color-scale value for the slice view.
- Returns:
- valfloat
Maximum display value, or None if the field contains invalid input.
- get_vmin_value()[source]#
Get the minimum color-scale value for the slice view.
- Returns:
- valfloat
Minimum display value, or None if the field contains invalid input.
- get_wavelength()[source]#
Get the wavelength range from the min/max line edits.
- Returns:
- wavelengthlist
Two-element [min, max] wavelength in angstroms, or None if either field contains invalid input.
- load_Q_file_dialog(path='')[source]#
Open a dialog to select a Q-space NeXus file to load.
- Parameters:
- pathstr, optional
Initial directory or filename shown in the dialog.
- Returns:
- filenamestr
Path to the selected Q file, or an empty string if the dialog was cancelled.
- load_UB_file_dialog(path='')[source]#
Open a dialog to select a UB matrix file to load.
- Parameters:
- pathstr, optional
Initial directory or filename shown in the dialog.
- Returns:
- filenamestr
Path to the selected UB file, or an empty string if the dialog was cancelled.
- load_detector_cal_dialog(path='')[source]#
Open a dialog to select a detector calibration file to load.
- Parameters:
- pathstr, optional
Initial directory or filename shown in the dialog.
- Returns:
- filenamestr
Path to the selected calibration file, or an empty string if the dialog was cancelled.
- load_goniometer_cal_dialog(path='')[source]#
Open a dialog to select a goniometer calibration file to load.
- Parameters:
- pathstr, optional
Initial directory or filename shown in the dialog.
- Returns:
- filenamestr
Path to the selected goniometer file, or an empty string if the dialog was cancelled.
- load_peaks_file_dialog(path='')[source]#
Open a dialog to select a peaks file to load.
- Parameters:
- pathstr, optional
Initial directory or filename shown in the dialog.
- Returns:
- filenamestr
Path to the selected peaks file, or an empty string if the dialog was cancelled.
- load_tube_cal_dialog(path='')[source]#
Open a dialog to select a tube calibration file to load.
- Parameters:
- pathstr, optional
Initial directory or filename shown in the dialog.
- Returns:
- filenamestr
Path to the selected tube calibration file, or an empty string if the dialog was cancelled.
- modulation_tab()[source]#
Build the “Modulation” tab.
Creates the DBSCAN-style clustering controls (maximum distance, minimum samples), the cluster results table, and the matplotlib canvas showing the h00/0k0/00l offset distributions, then adds the tab to the main tab widget.
- on_press_inst(event)[source]#
Matplotlib button-press handler that picks a detector position.
Fires only if the click is inside the instrument axes and no toolbar navigation mode (zoom/pan) is active. Updates the horizontal/vertical position fields and the ROI guide lines to the clicked position and emits roi_ready to request a refresh of the ROI-integrated scan.
- Parameters:
- eventmatplotlib.backend_bases.MouseEvent
The mouse button-press event.
- on_press_scan(event)[source]#
Matplotlib button-press handler that picks a diffraction value.
Fires only if the click is inside the scan axes and no toolbar navigation mode (zoom/pan) is active. Updates the diffraction field and the scan-plot marker line to the clicked position and emits scan_ready to request a refresh of the instrument view.
- Parameters:
- eventmatplotlib.backend_bases.MouseEvent
The mouse button-press event.
- on_press_slice(event)[source]#
Matplotlib button-press handler that picks an hkl on the slice plot.
Fires only if the click is inside the slice axes and no toolbar navigation mode (zoom/pan) is active. Converts the clicked display coordinates to hkl, updates the check-hkl fields, and, if peak-adding from the slice is enabled, emits slice_ready to request that a peak be added at that hkl.
- Parameters:
- eventmatplotlib.backend_bases.MouseEvent
The mouse button-press event.
- parameters_tab()[source]#
Build the “Parameters” tab containing Q/peaks/UB I/O controls.
Assembles the convert-to-Q, peaks, and UB sub-tabs along with save/load buttons and status labels, and adds the resulting tab to the main tab widget.
- runs_string_to_list(runs_str)[source]#
Convert runs string to list using regex validation. Return None for invalid formats.
- Parameters:
- runs_strstr
Condensed notation for run numbers.
- Returns:
- runslist or None
Integer run numbers or None if the input is invalid.
- save_Q_file_dialog(path='')[source]#
Open a dialog to choose a filename for saving Q-space data.
Appends a
.nxsextension if the chosen filename lacks one.- Parameters:
- pathstr, optional
Initial directory or filename shown in the dialog.
- Returns:
- filenamestr
Path to save the Q file to, or an empty string if the dialog was cancelled.
- save_UB_file_dialog(path='')[source]#
Open a dialog to choose a filename for saving a UB matrix.
Appends a
.matextension if the chosen filename lacks one.- Parameters:
- pathstr, optional
Initial directory or filename shown in the dialog.
- Returns:
- filenamestr
Path to save the UB file to, or an empty string if the dialog was cancelled.
- save_mask_file_dialog(path='')[source]#
Open a dialog to choose a filename for saving a detector mask.
Appends a
.xmlextension if the chosen filename lacks one.- Parameters:
- pathstr, optional
Initial directory or filename shown in the dialog.
- Returns:
- filenamestr
Path to save the mask file to, or an empty string if the dialog was cancelled.
- save_peaks_file_dialog(path='')[source]#
Open a dialog to choose a filename for saving peaks data.
Appends a
.nxsextension if the chosen filename lacks one.- Parameters:
- pathstr, optional
Initial directory or filename shown in the dialog.
- Returns:
- filenamestr
Path to save the peaks file to, or an empty string if the dialog was cancelled.
- set_Q_status(status)[source]#
Update the Q-sample status label text and color.
- Parameters:
- statusint
Status code: 0 for no Q-sample, 1 for files missing, 2 for files existing and calculating, any other value for ready.
- set_UB_status(status)[source]#
Update the UB matrix status label text and color.
- Parameters:
- statusint
Status code: 0 for no UB matrix, 1 for UB matrix available.
- set_cell(row, cell)[source]#
Populate one row of the reduced-cell table with a candidate cell.
- Parameters:
- rowint
Row index in cell_table to fill.
- celltuple
(form, error, bl, params)where form is the Niggli form number, error is the fit error, bl is a sequence of Bravais lattice symbols, and params is(a, b, c, alpha, beta, gamma, vol).
- set_cell_form(form)[source]#
Set the form-number input field.
- Parameters:
- formint
Niggli cell form number to display.
- set_check_hkl(h, k, l)[source]#
Set the hkl to check the detector position for.
- Parameters:
- h, k, lfloat
Miller indices to display in the check-hkl fields.
- set_convert_min_d(min_d)[source]#
Set the minimum d-spacing used when converting to Q-space.
- Parameters:
- min_dfloat
Minimum d-spacing in angstroms.
- set_d_min(val)[source]#
Set the minimum d-spacing for the instrument/ROI view.
- Parameters:
- valfloat
Minimum d-spacing in angstroms.
- set_d_phi(d_1, d_2, phi_12)[source]#
Set the calculated d-spacing and angle fields for the two input HKLs.
- Parameters:
- d_1float or None
D-spacing of the first plane, or None to clear the field.
- d_2float or None
D-spacing of the second plane, or None to clear the field.
- phi_12float or None
Angle between the two planes in degrees, or None to clear the field.
- set_data_list(values)[source]#
Populate the data selection combo box with numbered entries.
- Parameters:
- valueslist or None
Labels for each dataset. Each entry is shown prefixed with its 1-based row number. If None, the combo box is simply cleared.
- set_detector_calibration(filename)[source]#
Set the detector calibration file path.
- Parameters:
- filenamestr
Path to the detector calibration file.
- set_diffraction(val)[source]#
Set the diffraction coordinate for the current detector position.
- Parameters:
- valfloat
Diffraction value (e.g. time-of-flight or wavelength).
- set_find_peaks_distance(val)[source]#
Set the minimum distance between found peaks.
- Parameters:
- valfloat
Minimum peak separation, displayed with two decimal places.
- set_find_peaks_spacing(val)[source]#
Set the maximum d-spacing for peak finding.
- Parameters:
- valfloat
Maximum d-spacing in angstroms, displayed with two decimal places.
- set_goniometer_axes(names)[source]#
Set the goniometer axis name labels in both the peaks and detector view tabs.
- Parameters:
- namesstr
Comma-separated goniometer axis names to display.
- set_goniometer_calibration(filename)[source]#
Set the goniometer calibration file path.
- Parameters:
- filenamestr
Path to the goniometer calibration file.
- set_goniometer_setting(angles)[source]#
Set the goniometer angle readouts in both the peaks and detector view tabs.
- Parameters:
- anglestuple of float or None
The (omega, chi, phi) goniometer angles in degrees, or None to clear the fields.
- set_highlight_phi(phi)[source]#
Set the calculated angle between the two highlighted peaks.
- Parameters:
- phifloat
Angle between the two highlighted peaks’ Q vectors, in degrees.
- set_horizontal(val)[source]#
Set the horizontal detector coordinate.
- Parameters:
- valfloat
Horizontal detector position.
- set_indices(hkl, int_hkl, int_mnp)[source]#
Set the fractional and integer HKL/MNP index fields.
Signals on the index fields are blocked while updating so this does not trigger reindexing callbacks.
- Parameters:
- hkltuple
Fractional
(H, K, L)Miller indices.- int_hkltuple
Integer
(h, k, l)Miller indices.- int_mnptuple
Integer
(m, n, p)satellite indices.
- set_inst_vmax_value(val)[source]#
Set the maximum color-scale value for the instrument view.
- Parameters:
- valfloat
Maximum display value.
- set_inst_vmin_value(val)[source]#
Set the minimum color-scale value for the instrument view.
- Parameters:
- valfloat
Minimum display value.
- set_instrument(instrument)[source]#
Select an instrument in the instrument combo box.
- Parameters:
- instrumentstr
Name of the instrument to select. No change is made if the name is not found.
- set_instrument_goniometer_axes(names)[source]#
Set the goniometer axis name label in the detector view tab, if present.
- Parameters:
- namesstr
Comma-separated goniometer axis names to display.
- set_instrument_goniometer_setting(angles)[source]#
Set the goniometer angle readout in the detector view tab, if present.
- Parameters:
- anglestuple of float or None
The (omega, chi, phi) goniometer angles in degrees, or None to clear the field.
- set_item_value(value)[source]#
Create a numeric, sortable table item.
- Parameters:
- valuestr or float
Value to store, converted to float so the table sorts the column numerically instead of lexicographically.
- Returns:
- itemQTableWidgetItem
Table item with value stored via Qt.DisplayRole.
- set_lattice_constants(params, errors)[source]#
Set the lattice constant fields, each formatted with its error.
- Parameters:
- paramslist
Six lattice parameters [a, b, c, alpha, beta, gamma].
- errorslist
Uncertainties corresponding to each lattice parameter.
- set_modulatation_offsets(params)[source]#
Set the three modulation vector line edits for satellite peaks.
- Parameters:
- paramsarray_like
Three modulation vectors, each a length-3 sequence of [dh, dk, dl] components, displayed to three decimal places.
- set_peak(row, peak)[source]#
Populate one row of the peaks table with a peak’s summary values.
- Parameters:
- rowint
Row index in peaks_table to fill.
- peakdict
Peak information dictionary containing
"hkl","d_spacing","wavelength","intensity","signal_to_noise", and"peak_no"entries.
- set_peak_goniometer_axes(names)[source]#
Set the goniometer axis name label in the peaks tab.
- Parameters:
- namesstr
Comma-separated goniometer axis names to display.
- set_peak_goniometer_setting(angles)[source]#
Set the goniometer angle readout in the peaks tab.
- Parameters:
- anglestuple of float or None
The (omega, chi, phi) goniometer angles in degrees, or None to clear the field.
- set_peak_info(peak)[source]#
Populate the peak-detail fields with a single peak’s information.
- Parameters:
- peakdict
Peak information dictionary containing
"hkl","d_spacing","wavelength","intensity","sigma","int_hkl","int_mnp","run_number","bank","row","col","two_theta","gamma","nu", and"angles"entries.
- set_peaks_status(status)[source]#
Update the peaks table status label text and color.
- Parameters:
- statusint
Status code: 0 for no peaks table, 1 for peaks not indexed, 2 for peaks indexed.
- set_sample_directions(params)[source]#
Set the u, v, w sample orientation direction line edits.
- Parameters:
- paramstuple
Three-element (v, w, u) sequence, each a length-3 vector of HKL components for the corresponding sample direction.
- set_transform_matrix(params)[source]#
Set the 3x3 lattice transformation matrix line edits.
- Parameters:
- paramsarray_like
3x3 transformation matrix; values are displayed rounded to the nearest integer.
- set_tube_calibration(filename)[source]#
Set the tube calibration file path.
- Parameters:
- filenamestr
Path to the tube calibration file.
- set_undo_filter_enabled(enabled)[source]#
Enable or disable the “Undo” filter button.
- Parameters:
- enabledbool
True to enable the undo button, False to disable it.
- set_vertical(val)[source]#
Set the vertical detector coordinate.
- Parameters:
- valfloat
Vertical detector position.
- set_vmax_value(val)[source]#
Set the maximum color-scale value for the slice view.
- Parameters:
- valfloat
Maximum display value.
- set_vmin_value(val)[source]#
Set the minimum color-scale value for the slice view.
- Parameters:
- valfloat
Minimum display value.
- set_wavelength(wavelength)[source]#
Set the wavelength line edit(s) from a single value or a range.
- Parameters:
- wavelengthfloat or list
A single monochromatic wavelength, or a two-element [min, max] range for a polychromatic (Laue/TOF) beam. When a list is given the maximum wavelength field is enabled; otherwise it is set equal to the minimum and disabled.
- setup_slice_slider(z_min, z_max)[source]#
Configure the slice slider for the given axis extent.
- Parameters:
- z_minfloat
Lower bound of the slice axis extent.
- z_maxfloat
Upper bound of the slice axis extent.
- table_tab()[source]#
Build the “Peaks” tab.
Creates the d-spacing/angle calculator between two peaks, the peaks table, and the extended peak-information panel (hkl indices, satellite indices, run/bank/row/col, intensity, and goniometer angles), then adds the tab to the main tab widget.
- update_alignment_runs(peaks)[source]#
Repopulate the alignment run combo box from the indexed peaks.
Enables the run combo box and “calculate alignment” button only if at least one indexed peak with a run number is present; otherwise disables them and shows “None”.
- Parameters:
- peakslist of dict
Peak information dictionaries, each optionally containing
"ind"(indexed flag) and"run_number"entries.
- update_cell_table(cells)[source]#
Repopulate the reduced-cell table from a list of candidate cells.
- Parameters:
- cellslist
Candidate reduced cells, one per row, as produced by the model (see set_cell).
- update_cluster_table(peak_info)[source]#
Repopulate the cluster table with satellite centroid coordinates.
- Parameters:
- peak_infodict
Clustering result containing a
"satellites"entry, an (N, 3) array of fractional satellite modulation vector centroids, one row per cluster.
- update_colorbar_vlims(vmin, vmax)[source]#
Apply new color limits to the slice image and colorbar.
- Parameters:
- vminfloat
Minimum color value.
- vmaxfloat
Maximum color value.
- update_diffraction_label(mono)[source]#
Update the label describing the diffraction axis units.
- Parameters:
- monobool
True if the instrument is monochromatic, in which case the label reads “Angle:”; otherwise it reads “Spacing:”.
- update_filter_description_label(option)[source]#
Update the label describing the selected peak filter variable.
- Parameters:
- optionstr
Selected filter variable, used to look up its description.
- update_instrument_colorbar_vlims(vmin, vmax)[source]#
Apply new color limits to the detector view image.
- Parameters:
- vminfloat
Minimum color value.
- vmaxfloat
Maximum color value.
- update_instrument_display(cmap_key, scale, vmin, vmax)[source]#
Update the colormap and normalization of the instrument view plot.
- Parameters:
- cmap_keystr
Key into the
cmapslookup for the colormap to apply.- scalestr
Color scale name, “log” for logarithmic or any other value for linear normalization.
- vminfloat
Minimum color value.
- vmaxfloat
Maximum color value.
- update_instrument_view(inst_view)[source]#
Redraw the instrument detector (gamma/nu) image.
Preserves the current zoom unless instrument auto-zoom is enabled. Updates the instrument color-limit fields, clears and redraws the instrument axes with the new image, and reconnects the cursor coordinate formatter.
- Parameters:
- inst_viewdict
Instrument view data containing
"img","xedges","yedges","vmin", and"vmax"entries.
- update_peaks_table(peaks)[source]#
Repopulate the peaks table from a list of peak dictionaries.
Clears the current selection and highlight, resizes the table to match peaks, fills each row via set_peak, and updates the indexed/total peak count labels.
- Parameters:
- peakslist of dict
Peak information dictionaries, one per row, as produced by the model (see set_peak).
- update_refine_constraint_label(option)[source]#
Update the label describing the constraints of a refinement option.
- Parameters:
- optionstr
Selected UB refinement option, used to look up the corresponding constraint description.
- update_roi_view(roi_view)[source]#
Draw or update the region-of-interest box on the instrument view.
Reuses existing ROI guide lines if present, otherwise creates them, then reconnects the instrument click handler.
- Parameters:
- roi_viewdict
ROI position data containing
"horz","vert","horz_roi", and"vert_roi"entries.
- update_scan_view(roi_view)[source]#
Redraw the 1D diffraction scan (ROI-integrated intensity) plot.
Reconnects the scan click handler after drawing so the user can pick a new diffraction position.
- Parameters:
- roi_viewdict
Scan data containing
"x"(scan coordinate),"y"(integrated intensity),"val"(current diffraction value), and"label"("d"for d-spacing or otherwise two-theta) entries.
- update_slice(slice_dict)[source]#
Redraw the 2D reciprocal-space slice plot from new slice data.
Rebuilds the slice axes with a curvilinear grid helper so that non-orthogonal reciprocal-lattice axes are displayed correctly, redraws the colorbar, preserves the current zoom (unless slice auto-zoom is enabled or the axis labels changed), and reconnects the click handler and cursor coordinate formatter. Also (re)configures the out-of-plane slice slider if depth limits are provided.
- Parameters:
- slice_dictdict
Slice data containing
"x","y","labels","title","signal","z"(out-of-plane coordinate),"W"(index transform),"transform"(plot affine transform),"aspect", optional"vmin"/"vmax"display limits, and optional"z_min"/"z_max"slider bounds.
- update_slice_color()[source]#
Recompute and apply slice colorbar limits from the current color-bar slider values.
- update_slice_display(cmap_key, scale, vmin, vmax)[source]#
Update the colormap, normalization, and colorbar of the slice plot.
- Parameters:
- cmap_keystr
Key into the
cmapslookup for the colormap to apply.- scalestr
Color scale name, “log” for logarithmic or any other value for linear normalization.
- vminfloat
Minimum color value.
- vmaxfloat
Maximum color value.
- update_symmetry_symbols(symbols)[source]#
Repopulate the symmetry combo box with available symbols.
- Parameters:
- symbolslist
Symmetry symbol strings to show, typically the keys of the lattice transform dictionary for the selected system.
- update_table_index(ind, hkl)[source]#
Update the HKL columns of a single peaks-table row after reindexing.
- Parameters:
- indint
Zero-based peak index whose row should be updated.
- hkltuple
Updated
(h, k, l)Miller indices to display.
- class VolumeSlicerView(parent=None)[source]#
Bases:
NeuXtalVizWidgetView for the volume slicer tool.
Provides the UI for loading a NeXus MDHisto workspace, rendering it as a 3D clipped volume, slicing it into a 2D plane, and cutting a 1D line profile through that slice, together with controls for scaling, colormaps, opacity, and display/color limits.
- Attributes:
- slice_readyqtpy.QtCore.Signal
Emitted when the slice position/parameters are ready to be recomputed (e.g. after dragging the 3D clip plane or slider).
- cut_readyqtpy.QtCore.Signal
Emitted when the cut position/parameters are ready to be recomputed (e.g. after dragging the line cut on the slice plot).
Methods
acceptDrops(self, /)accessibleDescription(self, /)accessibleIdentifier(self, /)accessibleName(self, /)actionEvent(self, event, /)actions(self, /)activateWindow(self, /)addAction(...)addActions(self, actions, /)add_bond_network(geometry[, bond_values])Draw the supercell unit-cell edges in the shared 3D view, plus one point per bond location colored by its sampled ΔPDF correlation strength (if given).
add_cut(cut_dict)Draw the 1D cut plot and its overlay lines on the slice plot.
add_histo(histo_dict, normal, norm, value)Render the 3D clipped volume for the loaded histogram.
add_slice(slice_dict)Draw the 2D slice plot from newly computed slice data.
adjustSize(self, /)append_to_console(text)Append a line of text to the console output widget.
autoFillBackground(self, /)auto_scale_dropdown(combo)Autoscale a combobox width to fit text plus any icons/checks.
axes_show()State of axes.
backgroundRole(self, /)backingStore(self, /)baseSize(self, /)blockSignals(self, b, /)changeEvent(self, event, /)change_projection()Enable or disable parallel projection.
childAt(...)childEvent(self, event, /)children(self, /)childrenRect(self, /)childrenRegion(self, /)clearFocus(self, /)clearMask(self, /)clear_scene()Clear plane widgets and actors from the plotter.
close(self, /)closeEvent(self, event, /)colorCount(self, /)confirm_delete(display_name)Prompt the user to confirm deleting a workspace.
connect(...)connectNotify(self, signal, /)connect_auto_limits(update_limits)Connect a handler to toggling of the "Auto Limits" checkbox.
connect_auto_zoom(update_zoom)Connect a handler to toggling of the "Auto Zoom" checkbox.
connect_az(left, right)Connect Azimuth to presenter handler.
connect_calculate_pdf(calculate_pdf)Connect a handler to the "Transform" button click.
connect_camera_ready(calculate)Connect a callback to the
cam_readysignal.connect_cbar_combo(update_cbar)Connect a handler to changes in the colormap combo box.
connect_clim_combo(update_clim)Connect a handler to changes in the 3D volume color-limit combo box.
connect_combine_workspaces(combine_workspaces)Connect a handler to the "Subtract" button click.
connect_cut_combo(update_cut)Connect a handler to changes in the cut axis combo box.
connect_cut_line(update_cut)Connect a handler to editing of the cut position field.
connect_cut_ready(recut)Connect a handler to the cut_ready signal.
connect_cut_scale_combo(update_cut)Connect a handler to changes in the cut display scale combo box.
connect_cut_thickness_line(update_cut)Connect a handler to editing of the cut thickness field.
connect_delete_workspace(delete_workspace)Connect a handler to the "Delete" button click.
connect_elev(up, down)Connect Elevate to presenter handler.
connect_load_NXS(load_NXS)Connect a handler to the "Load NXS" button click.
connect_load_bond_cif(load_bond_cif)Connect a handler to the bond-network viewer's "Load CIF" button.
connect_manual_axis(view_manual)Manual axis view connection.
connect_manual_up_axis(view_manual)Manual axis up view connection.
connect_max_slider(update_colorbar)No-op placeholder for connecting a maximum colorbar slider.
connect_min_slider(update_colorbar)No-op placeholder for connecting a minimum colorbar slider.
connect_opacity_combo(update_opacity)Connect a handler to changes in the opacity mapping combo box.
Connect a handler to changes in the Transform tab's crystal-system combo box.
connect_plot_bond_network(plot_bond_network)Connect a handler to the "Plot Bond Network" button click.
connect_real_axes(view_a, view_b, view_c)Real axes view connections.
connect_reciprocal_axes(view_a_star, ...)Reciprocal axes view connections.
connect_reciprocal_real_compass(change_lattice)Reciprocal/real axis compass
connect_redraw_workspace(redraw_workspace)Connect a handler to the "Redraw" button click.
connect_rename_workspace(rename_workspace)Connect a handler to the "Rename" button click.
connect_rotate(cww, cw)Connect Roll to presenter handler.
connect_run_blur(run_blur)Connect a handler to the "Blur" button click.
connect_run_bragg_punch(run_bragg_punch)Connect a handler to the "Punch" button click.
connect_run_karen(run_karen)Connect a handler to the "Filter" button click.
connect_save_cut(save_cut)Connect a handler to the "Save Cut" button click.
connect_save_screenshot(save_screenshot)Screenshot connection.
connect_save_slice(save_slice)Connect a handler to the "Save Slice" button click.
connect_save_workspace(save_workspace)Connect a handler to the "Save" button click.
connect_slice_combo(update_slice)Connect handlers to changes in the slice plane combo box.
connect_slice_line(update_slice)Connect a handler to editing of the slice position field.
connect_slice_ready(reslice)Connect a handler to the slice_ready signal.
connect_slice_scale_combo(update_slice)Connect a handler to changes in the slice display scale combo box.
connect_slice_thickness_line(update_slice)Connect a handler to editing of the slice thickness field.
connect_stop(stop)Connect stop button to presenter callback.
connect_symmetric_zero(update_symmetric_zero)Connect a handler to toggling of the "Symmetric About Zero" box.
connect_vlim_combo(update_clim)Connect a handler to changes in the 2D slice value-limit combo box.
connect_vmax_line(update_vals)Connect a handler to editing of the colorbar maximum field.
connect_vmin_line(update_vals)Connect a handler to editing of the colorbar minimum field.
connect_vol_scale_combo(update_vol)Connect a handler to changes in the volume scale combo box.
connect_workspace_combo(activate_workspace)Connect a handler to changes in the active-workspace combo box.
connect_xmax_line(update_vals)Connect a handler to editing of the X-axis maximum field.
connect_xmin_line(update_vals)Connect a handler to editing of the X-axis minimum field.
connect_ymax_line(update_vals)Connect a handler to editing of the Y-axis maximum field.
connect_ymin_line(update_vals)Connect a handler to editing of the Y-axis minimum field.
contentsMargins(self, /)contentsRect(self, /)contextMenuEvent(self, event, /)contextMenuPolicy(self, /)create(self, /[, arg__1, initializeWindow, ...])createWinId(self, /)createWindowContainer(window, /[, parent, flags])cursor(self, /)customEvent(self, event, /)cut_limits(ax)Matplotlib callback that syncs the X/Y fields to the cut zoom.
deleteLater(self, /)depth(self, /)destroy(self, /[, destroyWindow, ...])devType(self, /)devicePixelRatio(self, /)devicePixelRatioF(self, /)devicePixelRatioFScale()disconnect(...)disconnectNotify(self, signal, /)dragEnterEvent(self, event, /)dragLeaveEvent(self, event, /)dragMoveEvent(self, event, /)dropEvent(self, event, /)dumpObjectInfo(self, /)dumpObjectTree(self, /)dynamicPropertyNames(self, /)effectiveWinId(self, /)emit(self, signal, /, *args)encodeMetricF(metric, value, /)ensurePolished(self, /)enterEvent(self, event, /)event(self, event, /)eventFilter(obj, event)Qt event filter handling arrow-key stepping of the slice slider.
find(arg__1, /)findChild(self, type, /[, name, options])findChildren() -> List[~PlaceholderType] ))focusInEvent(self, event, /)focusNextChild(self, /)focusNextPrevChild(self, next, /)focusOutEvent(self, event, /)focusPolicy(self, /)focusPreviousChild(self, /)focusProxy(self, /)focusWidget(self, /)font(self, /)fontInfo(self, /)fontMetrics(self, /)foregroundRole(self, /)frameGeometry(self, /)frameSize(self, /)geometry(self, /)Get the display name of the currently selected workspace.
Get whether automatic display limit calculation is enabled.
Get whether automatic zoom reset on redraw is enabled.
Get the display name selected as input to the blur step.
Get the requested display name for the blurred result.
Get the blur step's NaN-Gaussian blur size, if valid.
Get the display name selected in the ΔPDF-workspace combo.
Get the checked/unchecked state of every row in the atom-site table.
Get the requested supercell extent along each axis.
Get the fractional-coordinate bond-matching tolerance.
get_camera_roll_direction()Get the current camera roll angle and view direction.
get_camera_state()Return the current camera position, focal point, and up vectors.
Get the currently selected color-limit clipping method for the 3D volume display.
Get the colorbar slider percentages used by update_slice_color.
Get the currently selected colormap name.
Get the coefficient
afor the combine operation, if valid.Get the coefficient
bfor the combine operation, if valid.Get the requested display name for the combine result.
Get the display name selected as workspace A for arithmetic.
Get the display name selected as workspace B for arithmetic.
get_cut()Get the currently selected line-cut axis.
Get the currently selected cut display scale, lower-cased.
Get the current cut thickness value, if valid.
Get the current cut position value, if valid.
Get the display name selected as input to the KAREN filter.
Get the requested display name for the KAREN-filtered result.
Get the KAREN step's moving-window size, if valid.
Get the KAREN step's outlier cutoff, if valid.
get_manual_axis_indices()Indices of manually entered direction components.
get_manual_axis_up_indices()Indices of manually entered direction up components.
Get the currently selected opacity mapping type.
Get the crystal system selected in the Transform tab.
Get the display name selected as input to the 3D-ΔPDF transform.
Get the requested display name for the 3D-ΔPDF result.
Get the 3D-ΔPDF padding extent, if valid.
Get the space group selected in the Transform tab.
Get the selected 3D-ΔPDF apodization window.
Get the display name selected as input to the Bragg punch.
Get the Bragg-punch step's IQR outlier scale factor, if valid.
Get the requested display name for the Bragg-punch result.
Get the Bragg-punch step's inner-cut radius, if valid.
Get the Bragg-punch radius, if valid.
get_rotate_step()Return the rotation step in degrees from the rotate tab.
Get the display name currently selected in the management list.
Get the currently selected slice plane.
Get the currently selected slice display scale, lower-cased.
Get the current slice thickness value, if valid.
Get the current slice position value, if valid.
Get whether the slice colorbar limits should be symmetric about zero.
Get the currently selected value-limit clipping method for the 2D slice display.
Get the current colorbar maximum value, if valid.
Get the current colorbar minimum value, if valid.
Get the currently selected 3D volume display scale.
Get the current X-axis maximum value, if valid.
Get the current X-axis minimum value, if valid.
Get the current Y-axis maximum value, if valid.
Get the current Y-axis minimum value, if valid.
grab(self, /[, rectangle])grabGesture(self, type, /[, flags])grabKeyboard(self, /)grabMouse(-> None)grabShortcut(self, key, /[, context])graphicsEffect(self, /)graphicsProxyWidget(self, /)hasFocus(self, /)hasHeightForWidth(self, /)hasMouseTracking(self, /)hasTabletTracking(self, /)height(self, /)heightForWidth(self, arg__1, /)heightMM(self, /)hide(self, /)hideEvent(self, event, /)inherits(self, classname, /)initPainter(self, painter, /)inputMethodEvent(self, event, /)inputMethodHints(self, /)inputMethodQuery(self, arg__1, /)insertAction(self, before, action, /)insertActions(self, before, actions, /)installEventFilter(self, filterObj, /)interaction_callback(caller, event)VTK observer callback fired while the 3D clip plane is dragged.
internalWinId(self, /)isActiveWindow(self, /)isAncestorOf(self, child, /)isEnabled(self, /)isEnabledTo(self, arg__1, /)isFullScreen(self, /)isHidden(self, /)isLeftToRight(self, /)isMaximized(self, /)isMinimized(self, /)isModal(self, /)isQmlExposed(self, /)isQuickItemType(self, /)isRightToLeft(self, /)isSignalConnected(self, signal, /)isTopLevel(self, /)isVisible(self, /)isVisibleTo(self, arg__1, /)isWidgetType(self, /)isWindow(self, /)isWindowModified(self, /)isWindowType(self, /)keyPressEvent(self, event, /)keyReleaseEvent(self, event, /)keyboardGrabber()killTimer(-> None)layout(self, /)layoutDirection(self, /)leaveEvent(self, event, /)Prompt the user for a NeXus (.nxs) file path to load.
Prompt the user for a CIF file path to load for the bond-network viewer.
locale(self, /)logicalDpiX(self, /)logicalDpiY(self, /)lower(self, /)mapFrom(-> PySide6.QtCore.QPoint)mapFromGlobal(-> PySide6.QtCore.QPoint)mapFromParent(-> PySide6.QtCore.QPoint)mapTo(-> PySide6.QtCore.QPoint)mapToGlobal(-> PySide6.QtCore.QPoint)mapToParent(-> PySide6.QtCore.QPoint)mask(self, /)maximumHeight(self, /)maximumSize(self, /)maximumWidth(self, /)metaObject(self, /)metric(self, arg__1, /)minimumHeight(self, /)minimumSize(self, /)minimumSizeHint(self, /)minimumWidth(self, /)mouseDoubleClickEvent(self, event, /)mouseGrabber()mouseMoveEvent(self, event, /)mousePressEvent(self, event, /)mouseReleaseEvent(self, event, /)move(-> None)moveEvent(self, event, /)moveToThread(self, thread, /)nativeEvent(self, eventType, message, /)nativeParentWidget(self, /)nextInFocusChain(self, /)normalGeometry(self, /)objectName(self, /)on_motion(event)Matplotlib motion-notify handler that drags the cut line overlay.
on_press(event)Matplotlib button-press handler that begins dragging the cut line.
on_release(event)Matplotlib button-release handler that ends dragging the cut line.
overrideWindowFlags(self, type, /)overrideWindowState(self, state, /)paintEngine(self, /)paintEvent(self, event, /)paintingActive(self, /)palette(self, /)parent(self, /)parentWidget(self, /)physicalDpiX(self, /)physicalDpiY(self, /)pos(self, /)previousInFocusChain(self, /)prompt_load_name(default_name)Prompt the user for a display name for a newly loaded workspace.
prompt_rename(old_name)Prompt the user for a new display name for a workspace.
property(self, name, /)raise_(self, /)receivers(self, signal, /)reciprocal_lattice()State of reciprocal lattice vectors.
rect(self, /)redirected(self, offset, /)releaseKeyboard(self, /)releaseMouse(self, /)releaseShortcut(self, id, /)removeAction(self, action, /)removeEventFilter(self, obj, /)render(, sourceRegion, renderFlags, renderFlags)repaint(-> None -> None -> None)reset_camera()Reset the camera.
reset_scene()Restore the cached camera position, or reset the view.
Clear the X/Y axis limit fields and any cached zoom state.
No-op placeholder for resetting a colorbar slider.
reset_view([negative])Reset the view to the default isometric orientation.
resize(-> None)resizeEvent(self, event, /)restoreGeometry(self, geometry, /)saveGeometry(self, /)Prompt the user for a CSV file path to save to.
save_md_file_dialog([default_name])Prompt the user for a NeXus (.nxs) file path to save an MD workspace to.
save_screenshot(filename)Save plotter screenshot.
save_screenshot_file_dialog()Prompt the user to choose a PNG file path for a screenshot.
screen(self, /)scroll(-> None)sender(self, /)senderSignalIndex(self, /)setAcceptDrops(self, on, /)setAccessibleDescription(self, description, /)setAccessibleIdentifier(self, identifier, /)setAccessibleName(self, name, /)setAttribute(self, arg__1, /[, on])setAutoFillBackground(self, enabled, /)setBackgroundRole(self, arg__1, /)setBaseSize(-> None)setContentsMargins(-> None)setContextMenuPolicy(self, policy, /)setCursor(self, arg__1, /)setDisabled(self, arg__1, /)setEnabled(self, arg__1, /)setFixedHeight(self, h, /)setFixedSize(-> None)setFixedWidth(self, w, /)setFocus(-> None)setFocusPolicy(self, policy, /)setFocusProxy(self, arg__1, /)setFont(self, arg__1, /)setForegroundRole(self, arg__1, /)setGeometry(-> None)setGraphicsEffect(self, effect, /)setHidden(self, hidden, /)setInputMethodHints(self, hints, /)setLayout(self, arg__1, /)setLayoutDirection(self, direction, /)setLocale(self, locale, /)setMask(-> None)setMaximumHeight(self, maxh, /)setMaximumSize(-> None)setMaximumWidth(self, maxw, /)setMinimumHeight(self, minh, /)setMinimumSize(-> None)setMinimumWidth(self, minw, /)setMouseTracking(self, enable, /)setObjectName(self, name, /)setPalette(self, arg__1, /)setParent(-> None)setProperty(self, name, value, /)setScreen(self, arg__1, /)setShortcutAutoRepeat(self, id, /[, enable])setShortcutEnabled(self, id, /[, enable])setSizeIncrement(-> None)setSizePolicy(-> None)setStatusTip(self, arg__1, /)setStyle(self, arg__1, /)setStyleSheet(self, styleSheet, /)setTabOrder(arg__1, arg__2, /)setTabletTracking(self, enable, /)setToolTip(self, arg__1, /)setToolTipDuration(self, msec, /)setUpdatesEnabled(self, enable, /)setVisible(self, visible, /)setWhatsThis(self, arg__1, /)setWindowFilePath(self, filePath, /)setWindowFlag(self, arg__1, /[, on])setWindowFlags(self, type, /)setWindowIcon(self, icon, /)setWindowIconText(self, arg__1, /)setWindowModality(self, windowModality, /)setWindowModified(self, arg__1, /)setWindowOpacity(self, level, /)setWindowRole(self, arg__1, /)setWindowState(self, state, /)setWindowTitle(self, arg__1, /)set_bond_atom_table(sites)Populate the bond-network viewer's atom-site table.
set_bond_cif_filename(filename)Update the bond-network viewer's loaded-filename display.
set_camera_state(position, focal_point, up)Apply a new camera state to the underlying plotter and refresh.
set_colormap(cmap_key)Set the currently selected colormap.
set_cut_lim(lim)Apply new X-axis limits to the cut plot.
set_cut_thickness(val)Set the cut thickness field.
set_cut_value(val)Set the cut position field.
set_info(status)Update status information.
set_oriented_lattice_parameters(a, b, c, ...)Update the oriented lattice paramters.
set_position(pos)Set the position.
set_slice_lim(xlim, ylim)Apply new X/Y limits to the slice plot and remember them as the current zoom state.
set_slice_thickness(val)Set the slice thickness field.
set_slice_value(val)Set the slice position field and move the slider to match.
set_step(progress)Update progress step.
set_symmetric_zero(checked)Set whether the slice colorbar limits should be symmetric about zero.
set_transform(T)Apply a transform to the axes.
Mirror the minimum field's text into the maximum field, negated.
set_vmax_value(val)Set the colorbar maximum field.
Mirror the maximum field's text into the minimum field, negated.
set_vmin_value(val)Set the colorbar minimum field.
set_xmax_value(val)Set the X-axis maximum field.
set_xmin_value(val)Set the X-axis minimum field.
set_ymax_value(val)Set the Y-axis maximum field.
set_ymin_value(val)Set the Y-axis minimum field.
sharedPainter(self, /)show(self, /)showEvent(self, event, /)showFullScreen(self, /)showMaximized(self, /)showMinimized(self, /)showNormal(self, /)show_axes()Show or hide the coordinate axes actor in the plotter.
show_error(title, message)Show an error dialog.
signalsBlocked(self, /)size(self, /)sizeHint(self, /)sizeIncrement(self, /)sizePolicy(self, /)slice_limits(ax)Matplotlib callback that syncs the X/Y fields to the slice zoom.
Build the "Slice" tab, its widgets, and its layouts.
stackUnder(self, arg__1, /)startTimer(self, interval, /[, timerType])start_worker_pool(worker)Connect a worker's output to the console and start it.
statusTip(self, /)stop_processes()Stop all running worker processes.
stop_processing(stop_event)Check if a stop has been requested.
style(self, /)styleSheet(self, /)tabletEvent(self, event, /)testAttribute(self, arg__1, /)thread(self, /)timerEvent(self, event, /)toggle_console(state)Show or hide the console output widget.
toggle_container(state)Show or hide the collapsible cut section and its line overlay.
toolTip(self, /)toolTipDuration(self, /)topLevelWidget(self, /)tr(self, sourceText, /[, disambiguation, n])Build the "3D-ΔPDF" tab, its widgets, and its layouts.
underMouse(self, /)ungrabGesture(self, type, /)unsetCursor(self, /)unsetLayoutDirection(self, /)unsetLocale(self, /)update(-> None -> None -> None)updateGeometry(self, /)updateMicroFocus(self, /[, query])update_bond_pdf_workspace_combo(display_names)Repopulate the ΔPDF-workspace combo used for bond coloring.
update_camera_display(roll, elevation, azimuth)Update the read-only camera orientation display, if present.
update_clip([origin, normal])Update the 3D volume clip plane's origin and/or normal.
No-op placeholder for updating the maximum colorbar slider.
No-op placeholder for updating the minimum colorbar slider.
update_colorbar_vlims(vmin, vmax)Apply new color limits to the slice image and colorbar.
update_labels()Change the axes labels between Miller and fractional notation.
update_lines(alpha)Set the transparency of the line-cut overlay on the slice plot.
update_pdf_space_groups(space_groups)Repopulate the Transform tab's space-group combo box.
Recompute and apply colorbar limits from the color-bar slider values.
update_slice_display(cmap_key, scale, vmin, vmax)Update the slice image's colormap, normalization, and colorbar.
update_theme()Apply the selected PyVista/matplotlib plot theme to the view.
update_workspace_combos(display_names, ...)Repopulate the active-workspace combo box.
update_workspace_list(display_names)Repopulate the workspace management list (rename/delete).
updatesEnabled(self, /)view_up_vector(vec)Set the camera according to given vector(s).
view_vector(vecs)Set the camera according to given vector(s).
view_xy()View \(xy\)-plane.
view_xz()View \(xz\)-plane.
view_yx()View \(yx\)-plane.
view_yz()View \(yz\)-plane.
view_zx()View \(zx\)-plane.
view_zy()View \(zy\)-plane.
visibleRegion(self, /)whatsThis(self, /)wheelEvent(self, event, /)width(self, /)widthMM(self, /)winId(self, /)window(self, /)windowFilePath(self, /)windowFlags(self, /)windowHandle(self, /)windowIcon(self, /)windowIconText(self, /)windowModality(self, /)windowOpacity(self, /)windowRole(self, /)windowState(self, /)windowTitle(self, /)windowType(self, /)worker(task)Wrap a callable as a background
Workertask.x(self, /)y(self, /)PaintDeviceMetric
RenderFlag
cam_ready
customContextMenuRequested
cut_ready
destroyed
log_output
objectNameChanged
slice_ready
windowIconChanged
windowIconTextChanged
windowTitleChanged
- add_bond_network(geometry, bond_values=None)[source]#
Draw the supercell unit-cell edges in the shared 3D view, plus one point per bond location colored by its sampled ΔPDF correlation strength (if given).
The supercell’s individual atoms are deliberately not rendered – for a supercell with more than a few hundred atoms, that’s both unnecessary for this tool’s purpose (seeing the correlation-colored bond points) and, empirically, far slower to build than the bond points themselves. Bonds themselves are drawn as a true point cloud (a single pv.PolyData, GPU point-sprite rendered via render_points_as_spheres), the same pattern used by experiment_planner.add_peaks – not one glyphed mesh per point, which is far slower for the hundreds of thousands of bonds a modest supercell can produce.
- Parameters:
- geometrydict
Dictionary as returned by VolumeSlicerModel.build_bond_network:
"bond_vectors"((N, 3) array of Cartesian separation vectors, each measured from an implicit origin) and"edges"(list of (p0, p1) Cartesian line segments for the repeated unit-cell wireframe).- bond_valuesarray-like, optional
Signed ΔPDF value per bond (from VolumeSlicerModel.sample_bond_correlations), same length/order as
geometry["bond_vectors"]. A point is drawn at each bond vector’s own position, colored with a diverging (blue/white/red) colormap symmetric about zero and a matching V-shaped opacity (near-zero/white values rendered more translucent, the extremes fully opaque; NaN values drawn gray). If not given, no bond markers are drawn at all – just the unit-cell wireframe.
- add_cut(cut_dict)[source]#
Draw the 1D cut plot and its overlay lines on the slice plot.
Updates or creates the pair of dashed lines on the slice image marking the extent of the cut band, redraws the 1D error-bar cut plot, restores the appropriate axis limits, and (re)connects the mouse callbacks that allow interactively dragging the cut lines as well as the axis limit-change callbacks. Does nothing if no slice has been drawn yet.
- Parameters:
- cut_dictdict
Cut information dictionary (as returned by the model’s get_cut_info) containing ‘x’, ‘y’, ‘e’, ‘value’, ‘label’, and ‘title’.
- add_histo(histo_dict, normal, norm, value)[source]#
Render the 3D clipped volume for the loaded histogram.
Builds a PyVista ImageData grid from the histogram signal, applies the current opacity/colormap/scale settings, adds a clipped volume actor with a movable clip plane at the given origin/normal, configures the bounding-box axes with the crystallographic transform, and resets the camera to fit the scene. Also (re)configures the slice position slider range for the newly selected plane and registers a callback so that interactively moving the clip plane updates the slice position.
- Parameters:
- histo_dictdict
Histogram information dictionary (as returned by the model’s get_histo_info) containing ‘signal’, ‘labels’, ‘min_lim’, ‘max_lim’, ‘spacing’, ‘projection’, ‘transform’, and ‘scales’.
- normalnumpy.ndarray
Plane normal vector (in Cartesian/plot space) used to orient the volume clip plane.
- normarray-like
Normal vector identifying the selected slice plane in crystallographic axis space (e.g. [0, 0, 1]); mutated in place to build the clip plane origin.
- valuefloat
Position along norm at which to place the initial clip plane / slice.
- add_slice(slice_dict)[source]#
Draw the 2D slice plot from newly computed slice data.
Rebuilds the slice axes with a curvilinear grid helper so that the (possibly non-orthogonal) crystallographic axes are drawn correctly, plots the signal with pcolormesh, updates/creates the colorbar, restores or resets the zoom/pan limits depending on the “Auto Zoom” setting and prior view state, and reconnects the axis limit-change callbacks used to keep the min/max fields in sync.
- Parameters:
- slice_dictdict
Slice information dictionary (as returned by the model’s get_slice_info) containing ‘x’, ‘y’, ‘labels’, ‘title’, ‘signal’, ‘z’, ‘W’, ‘space’, ‘transform’, ‘aspect’, and optionally ‘vmin’/’vmax’.
- confirm_delete(display_name)[source]#
Prompt the user to confirm deleting a workspace.
- Parameters:
- display_namestr
Display name of the workspace to be deleted.
- Returns:
- confirmedbool
True if the user confirmed the deletion.
- connect_auto_limits(update_limits)[source]#
Connect a handler to toggling of the “Auto Limits” checkbox.
- Parameters:
- update_limitscallable
Slot invoked when the auto limits checkbox is toggled.
- connect_auto_zoom(update_zoom)[source]#
Connect a handler to toggling of the “Auto Zoom” checkbox.
- Parameters:
- update_zoomcallable
Slot invoked when the auto zoom checkbox is toggled.
- connect_calculate_pdf(calculate_pdf)[source]#
Connect a handler to the “Transform” button click.
- Parameters:
- calculate_pdfcallable
Slot invoked when the “Transform” button is clicked.
- connect_cbar_combo(update_cbar)[source]#
Connect a handler to changes in the colormap combo box.
- Parameters:
- update_cbarcallable
Slot invoked when the colormap selection changes.
- connect_clim_combo(update_clim)[source]#
Connect a handler to changes in the 3D volume color-limit combo box.
- Parameters:
- update_climcallable
Slot invoked when the volume color-limit method selection changes.
- connect_combine_workspaces(combine_workspaces)[source]#
Connect a handler to the “Subtract” button click.
- Parameters:
- combine_workspacescallable
Slot invoked when the “Subtract” button is clicked.
- connect_cut_combo(update_cut)[source]#
Connect a handler to changes in the cut axis combo box.
- Parameters:
- update_cutcallable
Slot invoked when the cut axis selection changes.
- connect_cut_line(update_cut)[source]#
Connect a handler to editing of the cut position field.
- Parameters:
- update_cutcallable
Slot invoked when editing of the cut position line finishes.
- connect_cut_ready(recut)[source]#
Connect a handler to the cut_ready signal.
- Parameters:
- recutcallable
Slot invoked when cut_ready is emitted.
- connect_cut_scale_combo(update_cut)[source]#
Connect a handler to changes in the cut display scale combo box.
- Parameters:
- update_cutcallable
Slot invoked when the cut scale (Linear/Log) selection changes.
- connect_cut_thickness_line(update_cut)[source]#
Connect a handler to editing of the cut thickness field.
- Parameters:
- update_cutcallable
Slot invoked when editing of the cut thickness line finishes.
- connect_delete_workspace(delete_workspace)[source]#
Connect a handler to the “Delete” button click.
- Parameters:
- delete_workspacecallable
Slot invoked when the “Delete” button is clicked.
- connect_load_NXS(load_NXS)[source]#
Connect a handler to the “Load NXS” button click.
- Parameters:
- load_NXScallable
Slot invoked when the “Load NXS” button is clicked.
- connect_load_bond_cif(load_bond_cif)[source]#
Connect a handler to the bond-network viewer’s “Load CIF” button.
- Parameters:
- load_bond_cifcallable
Slot invoked when the “Load CIF…” button is clicked.
- connect_max_slider(update_colorbar)[source]#
No-op placeholder for connecting a maximum colorbar slider.
This view does not expose a maximum colorbar slider widget; the method exists to satisfy the interface expected by the presenter.
- Parameters:
- update_colorbarcallable
Slot that would be invoked on slider changes (unused).
- connect_min_slider(update_colorbar)[source]#
No-op placeholder for connecting a minimum colorbar slider.
This view does not expose a minimum colorbar slider widget; the method exists to satisfy the interface expected by the presenter.
- Parameters:
- update_colorbarcallable
Slot that would be invoked on slider changes (unused).
- connect_opacity_combo(update_opacity)[source]#
Connect a handler to changes in the opacity mapping combo box.
- Parameters:
- update_opacitycallable
Slot invoked when the opacity mapping selection changes.
- connect_pdf_crystal_system_combo(update_space_groups)[source]#
Connect a handler to changes in the Transform tab’s crystal-system combo box.
- Parameters:
- update_space_groupscallable
Slot invoked when the crystal-system selection changes.
- connect_plot_bond_network(plot_bond_network)[source]#
Connect a handler to the “Plot Bond Network” button click.
- Parameters:
- plot_bond_networkcallable
Slot invoked when the “Plot Bond Network” button is clicked.
- connect_redraw_workspace(redraw_workspace)[source]#
Connect a handler to the “Redraw” button click.
- Parameters:
- redraw_workspacecallable
Slot invoked when the “Redraw” button is clicked.
- connect_rename_workspace(rename_workspace)[source]#
Connect a handler to the “Rename” button click.
- Parameters:
- rename_workspacecallable
Slot invoked when the “Rename” button is clicked.
- connect_run_blur(run_blur)[source]#
Connect a handler to the “Blur” button click.
- Parameters:
- run_blurcallable
Slot invoked when the “Blur” button is clicked.
- connect_run_bragg_punch(run_bragg_punch)[source]#
Connect a handler to the “Punch” button click.
- Parameters:
- run_bragg_punchcallable
Slot invoked when the “Punch” button is clicked.
- connect_run_karen(run_karen)[source]#
Connect a handler to the “Filter” button click.
- Parameters:
- run_karencallable
Slot invoked when the “Filter” button is clicked.
- connect_save_cut(save_cut)[source]#
Connect a handler to the “Save Cut” button click.
- Parameters:
- save_cutcallable
Slot invoked when the “Save Cut” button is clicked.
- connect_save_slice(save_slice)[source]#
Connect a handler to the “Save Slice” button click.
- Parameters:
- save_slicecallable
Slot invoked when the “Save Slice” button is clicked.
- connect_save_workspace(save_workspace)[source]#
Connect a handler to the “Save” button click.
- Parameters:
- save_workspacecallable
Slot invoked when the “Save” button is clicked.
- connect_slice_combo(update_slice)[source]#
Connect handlers to changes in the slice plane combo box.
Also connects an internal handler that resets the slice position to zero and reconfigures the slider whenever the plane changes.
- Parameters:
- update_slicecallable
Slot invoked when the slice plane selection changes.
- connect_slice_line(update_slice)[source]#
Connect a handler to editing of the slice position field.
- Parameters:
- update_slicecallable
Slot invoked when editing of the slice position line finishes.
- connect_slice_ready(reslice)[source]#
Connect a handler to the slice_ready signal.
- Parameters:
- reslicecallable
Slot invoked when slice_ready is emitted.
- connect_slice_scale_combo(update_slice)[source]#
Connect a handler to changes in the slice display scale combo box.
- Parameters:
- update_slicecallable
Slot invoked when the slice scale (Linear/Log) selection changes.
- connect_slice_thickness_line(update_slice)[source]#
Connect a handler to editing of the slice thickness field.
- Parameters:
- update_slicecallable
Slot invoked when editing of the slice thickness line finishes.
- connect_symmetric_zero(update_symmetric_zero)[source]#
Connect a handler to toggling of the “Symmetric About Zero” box.
- Parameters:
- update_symmetric_zerocallable
Slot invoked when the checkbox is toggled.
- connect_vlim_combo(update_clim)[source]#
Connect a handler to changes in the 2D slice value-limit combo box.
- Parameters:
- update_climcallable
Slot invoked when the slice value-limit method selection changes.
- connect_vmax_line(update_vals)[source]#
Connect a handler to editing of the colorbar maximum field.
- Parameters:
- update_valscallable
Slot invoked when editing of the vmax line finishes.
- connect_vmin_line(update_vals)[source]#
Connect a handler to editing of the colorbar minimum field.
- Parameters:
- update_valscallable
Slot invoked when editing of the vmin line finishes.
- connect_vol_scale_combo(update_vol)[source]#
Connect a handler to changes in the volume scale combo box.
- Parameters:
- update_volcallable
Slot invoked when the volume scale selection changes.
- connect_workspace_combo(activate_workspace)[source]#
Connect a handler to changes in the active-workspace combo box.
- Parameters:
- activate_workspacecallable
Slot invoked when a different loaded/derived workspace is selected for slicing/cutting.
- connect_xmax_line(update_vals)[source]#
Connect a handler to editing of the X-axis maximum field.
- Parameters:
- update_valscallable
Slot invoked when editing of the xmax line finishes.
- connect_xmin_line(update_vals)[source]#
Connect a handler to editing of the X-axis minimum field.
- Parameters:
- update_valscallable
Slot invoked when editing of the xmin line finishes.
- connect_ymax_line(update_vals)[source]#
Connect a handler to editing of the Y-axis maximum field.
- Parameters:
- update_valscallable
Slot invoked when editing of the ymax line finishes.
- connect_ymin_line(update_vals)[source]#
Connect a handler to editing of the Y-axis minimum field.
- Parameters:
- update_valscallable
Slot invoked when editing of the ymin line finishes.
- cut_limits(ax)[source]#
Matplotlib callback that syncs the X/Y fields to the cut zoom.
Invoked when the cut axes’ x limits change (e.g. via toolbar pan/zoom); writes the new limits into the X or Y min/max fields depending on which axis is currently being cut, without re-triggering their edit signals.
- Parameters:
- axmatplotlib.axes.Axes
The cut axes whose limits changed.
- eventFilter(obj, event)[source]#
Qt event filter handling arrow-key stepping of the slice slider.
While the slice canvas has focus, Left/Right key presses step the slice slider by one position; the corresponding key release emits slice_ready to trigger a re-slice. All other events are passed to the base class implementation.
- Parameters:
- objQObject
The object the event is being filtered for (the slice canvas or the slice slider).
- eventQEvent
The Qt event being processed.
- Returns:
- handledbool
True if the event was handled here, otherwise the result of the base class eventFilter.
- get_active_workspace()[source]#
Get the display name of the currently selected workspace.
- Returns:
- display_namestr or None
Display name selected in the active-workspace combo box, or None if no workspace is loaded.
- get_auto_limits()[source]#
Get whether automatic display limit calculation is enabled.
- Returns:
- auto_limitsbool
True if the “Auto Limits” checkbox is checked.
- get_auto_zoom()[source]#
Get whether automatic zoom reset on redraw is enabled.
- Returns:
- auto_zoombool
True if the “Auto Zoom” checkbox is checked.
- get_blur_input_workspace()[source]#
Get the display name selected as input to the blur step.
- Returns:
- display_namestr or None
Selected display name, or None if no workspace is loaded.
- get_blur_output_name()[source]#
Get the requested display name for the blurred result.
- Returns:
- output_namestr or None
Text entered in the output-name field, or None if empty.
- get_blur_q_blur()[source]#
Get the blur step’s NaN-Gaussian blur size, if valid.
- Returns:
- Q_blurfloat or None
Blur size (Å⁻¹) parsed from the field, or None if the field does not currently contain acceptable input.
- get_bond_pdf_workspace()[source]#
Get the display name selected in the ΔPDF-workspace combo.
- Returns:
- display_namestr or None
Currently selected display name, or None if the combo is empty (no real-space workspace registered yet).
- get_bond_site_enabled()[source]#
Get the checked/unchecked state of every row in the atom-site table.
- Returns:
- enabledlist of bool
One flag per site, in table order.
- get_bond_supercell_extent()[source]#
Get the requested supercell extent along each axis.
- Returns:
- nx, ny, nzint
Number of unit cells to show along a, b, c – see VolumeSlicerModel.build_bond_network for how this maps to translations.
- get_bond_tolerance()[source]#
Get the fractional-coordinate bond-matching tolerance.
- Returns:
- tolerancefloat
Value of the tolerance field, or 1e-3 if it does not currently hold valid input.
- get_clim_clip_type()[source]#
Get the currently selected color-limit clipping method for the 3D volume display.
- Returns:
- clip_typestr
One of ‘Min/Max’, ‘μ±3×σ’, or ‘Q₃/Q₁±1.5×IQR’.
- get_color_bar_values()[source]#
Get the colorbar slider percentages used by update_slice_color.
This view does not expose interactive colorbar sliders, so a fixed full-range value is always returned.
- Returns:
- min_sliderint
Lower slider percentage (always 0).
- max_sliderint
Upper slider percentage (always 100).
- get_colormap()[source]#
Get the currently selected colormap name.
- Returns:
- cmap_keystr
Key into the module-level cmaps mapping (e.g. ‘Sequential’, ‘Rainbow’, ‘Binary’, ‘Diverging’, ‘Modified’).
- get_combine_coeff_a()[source]#
Get the coefficient
afor the combine operation, if valid.- Returns:
- coefffloat or None
Coefficient parsed from the field, or None if the field does not currently contain acceptable input.
- get_combine_coeff_b()[source]#
Get the coefficient
bfor the combine operation, if valid.- Returns:
- coefffloat or None
Coefficient parsed from the field, or None if the field does not currently contain acceptable input.
- get_combine_output_name()[source]#
Get the requested display name for the combine result.
- Returns:
- output_namestr or None
Text entered in the output-name field, or None if empty.
- get_combine_ws_a()[source]#
Get the display name selected as workspace A for arithmetic.
- Returns:
- display_namestr or None
Selected display name, or None if no workspace is loaded.
- get_combine_ws_b()[source]#
Get the display name selected as workspace B for arithmetic.
- Returns:
- display_namestr or None
Selected display name, or None if no workspace is loaded.
- get_cut()[source]#
Get the currently selected line-cut axis.
- Returns:
- line_cutstr
‘Axis 1’ or ‘Axis 2’.
- get_cut_scale()[source]#
Get the currently selected cut display scale, lower-cased.
- Returns:
- scalestr
‘linear’ or ‘log’.
- get_cut_thickness()[source]#
Get the current cut thickness value, if valid.
- Returns:
- thicknessfloat or None
Cut thickness parsed from the field, or None if the field does not currently contain acceptable input.
- get_cut_value()[source]#
Get the current cut position value, if valid.
- Returns:
- valuefloat or None
Cut position parsed from the cut line edit, or None if the field does not currently contain acceptable input.
- get_karen_input_workspace()[source]#
Get the display name selected as input to the KAREN filter.
- Returns:
- display_namestr or None
Selected display name, or None if no workspace is loaded.
- get_karen_output_name()[source]#
Get the requested display name for the KAREN-filtered result.
- Returns:
- output_namestr or None
Text entered in the output-name field, or None if empty.
- get_karen_width()[source]#
Get the KAREN step’s moving-window size, if valid.
- Returns:
- widthfloat or None
Window size (Å⁻¹) parsed from the field, or None if the field does not currently contain acceptable input.
- get_karen_z_score()[source]#
Get the KAREN step’s outlier cutoff, if valid.
- Returns:
- z_scorefloat or None
Outlier cutoff (estimated standard deviations from the local median) parsed from the field, or None if the field does not currently contain acceptable input.
- get_opacity()[source]#
Get the currently selected opacity mapping type.
- Returns:
- opacitystr
One of ‘Linear Ascending’, ‘Linear Descending’, ‘Geometric Ascending’, ‘Geometric Descending’, ‘Sigmoid Ascending’, ‘Sigmoid Descending’, ‘Linear Symmetric’, ‘Sigmoid Symmetric’, or ‘Geometric Symmetric’.
- get_pdf_crystal_system()[source]#
Get the crystal system selected in the Transform tab.
- Returns:
- systemstr
Name of the selected crystal system.
- get_pdf_input_workspace()[source]#
Get the display name selected as input to the 3D-ΔPDF transform.
- Returns:
- display_namestr or None
Selected display name, or None if no workspace is loaded.
- get_pdf_output_name()[source]#
Get the requested display name for the 3D-ΔPDF result.
- Returns:
- output_namestr or None
Text entered in the output-name field, or None if empty.
- get_pdf_q_outer()[source]#
Get the 3D-ΔPDF padding extent, if valid.
- Returns:
- Q_outerfloat or None
Padding extent (Å⁻¹) parsed from the field, or None if the field does not currently contain acceptable input.
- get_pdf_space_group()[source]#
Get the space group selected in the Transform tab.
- Returns:
- space_groupstr or None
Space group formatted as
"{number}: {symbol}", or None if the combo box is currently empty.
- get_pdf_window()[source]#
Get the selected 3D-ΔPDF apodization window.
- Returns:
- windowstr
One of
"None","Lorch", or"Hann".
- get_punch_input_workspace()[source]#
Get the display name selected as input to the Bragg punch.
- Returns:
- display_namestr or None
Selected display name, or None if no workspace is loaded.
- get_punch_outlier()[source]#
Get the Bragg-punch step’s IQR outlier scale factor, if valid.
- Returns:
- outlierfloat or None
Tukey’s-fences scale factor parsed from the field, or None if the field does not currently contain acceptable input.
- get_punch_output_name()[source]#
Get the requested display name for the Bragg-punch result.
- Returns:
- output_namestr or None
Text entered in the output-name field, or None if empty.
- get_punch_q_inner()[source]#
Get the Bragg-punch step’s inner-cut radius, if valid.
- Returns:
- Q_innerfloat or None
Inner-cut radius (Å⁻¹) parsed from the field, or None if the field does not currently contain acceptable input.
- get_punch_q_size()[source]#
Get the Bragg-punch radius, if valid.
- Returns:
- Q_sizefloat or None
Punch radius (Å⁻¹) parsed from the field, or None if the field does not currently contain acceptable input.
- get_selected_workspace_for_management()[source]#
Get the display name currently selected in the management list.
- Returns:
- display_namestr or None
Selected display name, or None if no item is selected.
- get_slice()[source]#
Get the currently selected slice plane.
- Returns:
- slice_planestr
One of ‘Axis 1/2’, ‘Axis 1/3’, or ‘Axis 2/3’.
- get_slice_scale()[source]#
Get the currently selected slice display scale, lower-cased.
- Returns:
- scalestr
‘linear’, ‘log’, or ‘symlog’.
- get_slice_thickness()[source]#
Get the current slice thickness value, if valid.
- Returns:
- thicknessfloat or None
Slice thickness parsed from the field, or None if the field does not currently contain acceptable input.
- get_slice_value()[source]#
Get the current slice position value, if valid.
- Returns:
- valuefloat or None
Slice position parsed from the slice line edit, or None if the field does not currently contain acceptable input.
- get_symmetric_zero()[source]#
Get whether the slice colorbar limits should be symmetric about zero.
- Returns:
- symmetric_zerobool
True if the “Symmetric About Zero” box is checked.
- get_vlim_clip_type()[source]#
Get the currently selected value-limit clipping method for the 2D slice display.
- Returns:
- clip_typestr
One of ‘Min/Max’, ‘μ±3×σ’, or ‘Q₃/Q₁±1.5×IQR’.
- get_vmax_value()[source]#
Get the current colorbar maximum value, if valid.
- Returns:
- vmaxfloat or None
Colorbar maximum parsed from the field, or None if the field does not currently contain acceptable input.
- get_vmin_value()[source]#
Get the current colorbar minimum value, if valid.
- Returns:
- vminfloat or None
Colorbar minimum parsed from the field, or None if the field does not currently contain acceptable input.
- get_vol_scale()[source]#
Get the currently selected 3D volume display scale.
- Returns:
- scalestr
‘Linear’ or ‘Log’, as displayed in the volume scale combo box.
- get_xmax_value()[source]#
Get the current X-axis maximum value, if valid.
- Returns:
- xmaxfloat or None
X-axis maximum parsed from the field, or None if the field does not currently contain acceptable input.
- get_xmin_value()[source]#
Get the current X-axis minimum value, if valid.
- Returns:
- xminfloat or None
X-axis minimum parsed from the field, or None if the field does not currently contain acceptable input.
- get_ymax_value()[source]#
Get the current Y-axis maximum value, if valid.
- Returns:
- ymaxfloat or None
Y-axis maximum parsed from the field, or None if the field does not currently contain acceptable input.
- get_ymin_value()[source]#
Get the current Y-axis minimum value, if valid.
- Returns:
- yminfloat or None
Y-axis minimum parsed from the field, or None if the field does not currently contain acceptable input.
- interaction_callback(caller, event)[source]#
VTK observer callback fired while the 3D clip plane is dragged.
Converts the clip plane’s current origin back into slice-position units, updates the slice position field without re-triggering its edit signal, and emits slice_ready to request a re-slice.
- Parameters:
- callervtkImplicitPlaneWidget or similar
The VTK widget/actor that raised the interaction event; its GetOrigin() is used to obtain the new clip plane origin.
- eventstr
The VTK event name (unused, required by the observer signature).
- load_NXS_file_dialog()[source]#
Prompt the user for a NeXus (.nxs) file path to load.
- Returns:
- filenamestr
Selected file path, or an empty string if the dialog was cancelled.
- load_bond_cif_file_dialog()[source]#
Prompt the user for a CIF file path to load for the bond-network viewer.
- Returns:
- filenamestr
Selected file path, or an empty string if the dialog was cancelled.
- on_motion(event)[source]#
Matplotlib motion-notify handler that drags the cut line overlay.
While dragging, converts the cursor position from display space into crystallographic axis coordinates, updates the cut position field (without re-triggering its edit signal), and moves the overlay lines to follow the cursor.
- Parameters:
- eventmatplotlib.backend_bases.MouseEvent
The mouse motion event.
- on_press(event)[source]#
Matplotlib button-press handler that begins dragging the cut line.
Starts a drag only if the click is inside the slice axes, no toolbar navigation mode (zoom/pan) is active, and the line-cut overlay is currently shown.
- Parameters:
- eventmatplotlib.backend_bases.MouseEvent
The mouse button-press event.
- on_release(event)[source]#
Matplotlib button-release handler that ends dragging the cut line.
Clears the dragging flag and emits cut_ready to request that the cut be recomputed at its final dragged position.
- Parameters:
- eventmatplotlib.backend_bases.MouseEvent
The mouse button-release event.
- prompt_load_name(default_name)[source]#
Prompt the user for a display name for a newly loaded workspace.
- Parameters:
- default_namestr
Suggested display name, pre-filled in the prompt (the sequential
"data"/"data_2"/… name that would otherwise be auto-assigned).
- Returns:
- display_namestr or None
The confirmed display name, or None if the user cancelled or cleared the field (in which case the load should be aborted).
- prompt_rename(old_name)[source]#
Prompt the user for a new display name for a workspace.
- Parameters:
- old_namestr
Current display name of the workspace being renamed.
- Returns:
- new_namestr or None
New display name, or None if the user cancelled or entered an empty name.
- reset_slice_cut()[source]#
Clear the X/Y axis limit fields and any cached zoom state.
Blocks signals while clearing the fields so no update handlers fire, then clears the remembered slice zoom limits so the next slice draw recomputes the view extent from scratch.
- reset_slider()[source]#
No-op placeholder for resetting a colorbar slider.
This view does not expose colorbar slider widgets; the method exists to satisfy the interface expected elsewhere.
- save_file_dialog()[source]#
Prompt the user for a CSV file path to save to.
- Returns:
- filenamestr
Selected file path, or an empty string if the dialog was cancelled.
- save_md_file_dialog(default_name='')[source]#
Prompt the user for a NeXus (.nxs) file path to save an MD workspace to.
- Parameters:
- default_namestr, optional
Display name to pre-fill as the suggested filename.
- Returns:
- filenamestr
Selected file path, or an empty string if the dialog was cancelled.
- set_bond_atom_table(sites)[source]#
Populate the bond-network viewer’s atom-site table.
- Parameters:
- siteslist of dict
One entry per asymmetric-unit site, as returned by VolumeSlicerModel.load_bond_cif (keys
"label","element","x","y","z"). Every row starts checked (enabled).
- set_bond_cif_filename(filename)[source]#
Update the bond-network viewer’s loaded-filename display.
- Parameters:
- filenamestr
Path of the loaded CIF file, or a falsy value to show the “no file loaded” placeholder.
- set_colormap(cmap_key)[source]#
Set the currently selected colormap.
- Parameters:
- cmap_keystr
Key into the module-level cmaps mapping (e.g. ‘Diverging’).
- set_cut_lim(lim)[source]#
Apply new X-axis limits to the cut plot.
Does nothing if no slice has been drawn yet (no colorbar).
- Parameters:
- limsequence of float
New (min, max) limits for the cut plot’s X axis.
- set_cut_thickness(val)[source]#
Set the cut thickness field.
- Parameters:
- valfloat
New cut thickness value.
- set_slice_lim(xlim, ylim)[source]#
Apply new X/Y limits to the slice plot and remember them as the current zoom state.
Converts the given crystallographic-axis limits into display space via the current transform before applying them. Does nothing if no slice has been drawn yet (no colorbar).
- Parameters:
- xlimsequence of float
New (xmin, xmax) limits in crystallographic axis coordinates.
- ylimsequence of float
New (ymin, ymax) limits in crystallographic axis coordinates.
- set_slice_thickness(val)[source]#
Set the slice thickness field.
- Parameters:
- valfloat
New slice thickness value.
- set_slice_value(val)[source]#
Set the slice position field and move the slider to match.
- Parameters:
- valfloat
New slice position value.
- set_symmetric_zero(checked)[source]#
Set whether the slice colorbar limits should be symmetric about zero.
- Parameters:
- checkedbool
Whether to check the “Symmetric About Zero” box.
- set_vmax_from_vmin()[source]#
Mirror the minimum field’s text into the maximum field, negated.
Used for “Symmetric About Zero”: flips the sign of vmin’s raw text rather than reformatting the numeric value, so a typed notation (e.g. “1e-4”) is preserved instead of flip-flopping to a different format (e.g. “0.0001”) each time either field is edited.
- Parameters:
- None
- set_vmax_value(val)[source]#
Set the colorbar maximum field.
- Parameters:
- valfloat
New colorbar maximum value.
- set_vmin_from_vmax()[source]#
Mirror the maximum field’s text into the minimum field, negated.
See
set_vmax_from_vmin()– preserves vmax’s typed notation instead of reformatting it.- Parameters:
- None
- set_vmin_value(val)[source]#
Set the colorbar minimum field.
- Parameters:
- valfloat
New colorbar minimum value.
- set_xmax_value(val)[source]#
Set the X-axis maximum field.
- Parameters:
- valfloat
New X-axis maximum value.
- set_xmin_value(val)[source]#
Set the X-axis minimum field.
- Parameters:
- valfloat
New X-axis minimum value.
- set_ymax_value(val)[source]#
Set the Y-axis maximum field.
- Parameters:
- valfloat
New Y-axis maximum value.
- set_ymin_value(val)[source]#
Set the Y-axis minimum field.
- Parameters:
- valfloat
New Y-axis minimum value.
- show_error(title, message)[source]#
Show an error dialog.
- Parameters:
- titlestr
Dialog title.
- messagestr
Error message to display.
- slice_limits(ax)[source]#
Matplotlib callback that syncs the X/Y fields to the slice zoom.
Invoked when the slice axes’ x/y limits change (e.g. via toolbar pan/zoom); converts the new display-space limits back into crystallographic axis coordinates and writes them into the min/max fields without re-triggering their edit signals. Also toggles “Auto Zoom”: resetting the view via the toolbar’s “Home” button re-enables it, while any other interactive pan/zoom disables it.
- Parameters:
- axmatplotlib.axes.Axes
The slice axes whose limits changed.
- slice_tab()[source]#
Build the “Slice” tab, its widgets, and its layouts.
Creates the volume/opacity/colormap controls, slice and cut position/thickness controls, axis limit fields, the 2D slice and 1D cut matplotlib canvases, and wires up the toggle/auto-zoom checkboxes.
- toggle_container(state)[source]#
Show or hide the collapsible cut section and its line overlay.
- Parameters:
- statebool
Whether the collapsible container (cut plot and controls) should be visible, and the alpha state passed to update_lines for the line-cut overlay.
- transform_tab()[source]#
Build the “3D-ΔPDF” tab, its widgets, and its layouts.
Creates the workspace management list (rename/delete), the arithmetic panel (
a*ws_a - b*ws_b), the crystal-system/ space-group cascade, the Bragg-punch controls, the blur controls, and the 3D-ΔPDF calculation controls.
- update_bond_pdf_workspace_combo(display_names)[source]#
Repopulate the ΔPDF-workspace combo used for bond coloring.
- Parameters:
- display_nameslist of str
Display names of registered real-space (3D-ΔPDF) workspaces only – see VolumeSlicerModel.workspace_registry.
- update_clip(origin=None, normal=None)[source]#
Update the 3D volume clip plane’s origin and/or normal.
- Parameters:
- originarray-like, optional
New origin point for the clip plane (default None, meaning unchanged).
- normalarray-like, optional
New normal vector for the clip plane (default None, meaning unchanged).
- update_colorbar_max()[source]#
No-op placeholder for updating the maximum colorbar slider.
This view does not expose a maximum colorbar slider widget; the method exists to satisfy the interface expected elsewhere.
- update_colorbar_min()[source]#
No-op placeholder for updating the minimum colorbar slider.
This view does not expose a minimum colorbar slider widget; the method exists to satisfy the interface expected elsewhere.
- update_colorbar_vlims(vmin, vmax)[source]#
Apply new color limits to the slice image and colorbar.
Updates the vmin/vmax display fields, sets the new color limits on the slice image, refreshes the colorbar, and redraws the canvas. Does nothing if the colorbar or slice image has not been created yet.
- Parameters:
- vminfloat
New lower color limit.
- vmaxfloat
New upper color limit.
- update_lines(alpha)[source]#
Set the transparency of the line-cut overlay on the slice plot.
- Parameters:
- alphabool or float
Alpha value applied to the cut overlay lines (0/False hides them, 1/True shows them fully opaque).
- update_pdf_space_groups(space_groups)[source]#
Repopulate the Transform tab’s space-group combo box.
- Parameters:
- space_groupslist of str
Space groups formatted as
"{number}: {symbol}".
- update_slice_color()[source]#
Recompute and apply colorbar limits from the color-bar slider values.
Uses get_color_bar_values (percentages of the [vmin, vmax] range) to derive new display limits and applies them via update_colorbar_vlims. Does nothing if the colorbar has not been created yet.
- update_slice_display(cmap_key, scale, vmin, vmax)[source]#
Update the slice image’s colormap, normalization, and colorbar.
Does nothing if no slice image has been drawn yet.
- Parameters:
- cmap_keystr
Key into the module-level cmaps mapping identifying the colormap to apply (e.g. ‘Sequential’, ‘Rainbow’).
- scalestr
Display scale, ‘log’ or ‘linear’, passed to _create_norm.
- vminfloat
Lower display/color limit.
- vmaxfloat
Upper display/color limit.
- class CommandBrowser[source]#
Bases:
QMainWindowView for browsing and executing commands in NeuXtalViz.
Provides user interface elements for searching, selecting, and running available commands, as well as viewing command details.
- Attributes:
paintersushort
Methods
acceptDrops(self, /)accessibleDescription(self, /)accessibleIdentifier(self, /)accessibleName(self, /)actionEvent(self, event, /)actions(self, /)activateWindow(self, /)addAction(...)addActions(self, actions, /)addDockWidget(-> None)addToolBar(-> None -> None)addToolBarBreak(self, /[, area])adjustSize(self, /)autoFillBackground(self, /)backgroundRole(self, /)backingStore(self, /)baseSize(self, /)blockSignals(self, b, /)centralWidget(self, /)changeEvent(self, event, /)childAt(...)childEvent(self, event, /)children(self, /)childrenRect(self, /)childrenRegion(self, /)clearFocus(self, /)clearMask(self, /)close(self, /)closeEvent(self, event, /)colorCount(self, /)connect(...)connectNotify(self, signal, /)contentsMargins(self, /)contentsRect(self, /)contextMenuEvent(self, event, /)contextMenuPolicy(self, /)corner(self, corner, /)create(self, /[, arg__1, initializeWindow, ...])createPopupMenu(self, /)createWinId(self, /)createWindowContainer(window, /[, parent, flags])cursor(self, /)customEvent(self, event, /)deleteLater(self, /)depth(self, /)destroy(self, /[, destroyWindow, ...])devType(self, /)devicePixelRatio(self, /)devicePixelRatioF(self, /)devicePixelRatioFScale()disconnect(...)disconnectNotify(self, signal, /)dockOptions(self, /)dockWidgetArea(self, dockwidget, /)documentMode(self, /)dragEnterEvent(self, event, /)dragLeaveEvent(self, event, /)dragMoveEvent(self, event, /)dropEvent(self, event, /)dumpObjectInfo(self, /)dumpObjectTree(self, /)dynamicPropertyNames(self, /)effectiveWinId(self, /)emit(self, signal, /, *args)encodeMetricF(metric, value, /)ensurePolished(self, /)enterEvent(self, event, /)event(self, event, /)eventFilter(self, watched, event, /)find(arg__1, /)findChild(self, type, /[, name, options])findChildren() -> List[~PlaceholderType] ))focusInEvent(self, event, /)focusNextChild(self, /)focusNextPrevChild(self, next, /)focusOutEvent(self, event, /)focusPolicy(self, /)focusPreviousChild(self, /)focusProxy(self, /)focusWidget(self, /)font(self, /)fontInfo(self, /)fontMetrics(self, /)foregroundRole(self, /)frameGeometry(self, /)frameSize(self, /)geometry(self, /)grab(self, /[, rectangle])grabGesture(self, type, /[, flags])grabKeyboard(self, /)grabMouse(-> None)grabShortcut(self, key, /[, context])graphicsEffect(self, /)graphicsProxyWidget(self, /)hasFocus(self, /)hasHeightForWidth(self, /)hasMouseTracking(self, /)hasTabletTracking(self, /)height(self, /)heightForWidth(self, arg__1, /)heightMM(self, /)hide(self, /)hideEvent(self, event, /)iconSize(self, /)inherits(self, classname, /)initPainter(self, painter, /)init_ui()Build and lay out the widgets, menus, and tooltips for the window.
inputMethodEvent(self, event, /)inputMethodHints(self, /)inputMethodQuery(self, arg__1, /)insertAction(self, before, action, /)insertActions(self, before, actions, /)insertToolBar(self, before, toolbar, /)insertToolBarBreak(self, before, /)installEventFilter(self, filterObj, /)internalWinId(self, /)isActiveWindow(self, /)isAncestorOf(self, child, /)isAnimated(self, /)isDockNestingEnabled(self, /)isEnabled(self, /)isEnabledTo(self, arg__1, /)isFullScreen(self, /)isHidden(self, /)isLeftToRight(self, /)isMaximized(self, /)isMinimized(self, /)isModal(self, /)isQmlExposed(self, /)isQuickItemType(self, /)isRightToLeft(self, /)isSeparator(self, pos, /)isSignalConnected(self, signal, /)isTopLevel(self, /)isVisible(self, /)isVisibleTo(self, arg__1, /)isWidgetType(self, /)isWindow(self, /)isWindowModified(self, /)isWindowType(self, /)keyPressEvent(self, event, /)keyReleaseEvent(self, event, /)keyboardGrabber()killTimer(-> None)layout(self, /)layoutDirection(self, /)leaveEvent(self, event, /)load_file(item)Load the selected file's contents into the text editor.
Clear the file list widget and repopulate it from directory_path.
locale(self, /)logicalDpiX(self, /)logicalDpiY(self, /)lower(self, /)mapFrom(-> PySide6.QtCore.QPoint)mapFromGlobal(-> PySide6.QtCore.QPoint)mapFromParent(-> PySide6.QtCore.QPoint)mapTo(-> PySide6.QtCore.QPoint)mapToGlobal(-> PySide6.QtCore.QPoint)mapToParent(-> PySide6.QtCore.QPoint)mask(self, /)maximumHeight(self, /)maximumSize(self, /)maximumWidth(self, /)menuBar(self, /)menuWidget(self, /)metaObject(self, /)metric(self, arg__1, /)minimumHeight(self, /)minimumSize(self, /)minimumSizeHint(self, /)minimumWidth(self, /)mouseDoubleClickEvent(self, event, /)mouseGrabber()mouseMoveEvent(self, event, /)mousePressEvent(self, event, /)mouseReleaseEvent(self, event, /)move(-> None)moveEvent(self, event, /)moveToThread(self, thread, /)nativeEvent(self, eventType, message, /)nativeParentWidget(self, /)nextInFocusChain(self, /)normalGeometry(self, /)objectName(self, /)Prompt the user to select a directory and load its file list.
overrideWindowFlags(self, type, /)overrideWindowState(self, state, /)paintEngine(self, /)paintEvent(self, event, /)paintingActive(self, /)palette(self, /)parent(self, /)parentWidget(self, /)physicalDpiX(self, /)physicalDpiY(self, /)pos(self, /)previousInFocusChain(self, /)property(self, name, /)raise_(self, /)receivers(self, signal, /)rect(self, /)redirected(self, offset, /)releaseKeyboard(self, /)releaseMouse(self, /)releaseShortcut(self, id, /)removeAction(self, action, /)removeDockWidget(self, dockwidget, /)removeEventFilter(self, obj, /)removeToolBar(self, toolbar, /)removeToolBarBreak(self, before, /)render(, sourceRegion, renderFlags, renderFlags)repaint(-> None -> None -> None)resize(-> None)resizeDocks(self, docks, sizes, orientation, /)resizeEvent(self, event, /)restoreDockWidget(self, dockwidget, /)restoreGeometry(self, geometry, /)restoreState(self, state, /[, version])Run the active command on the current file in a system terminal.
saveGeometry(self, /)saveState(self, /[, version])Write the text editor's contents back to the current file, if any.
screen(self, /)scroll(-> None)sender(self, /)senderSignalIndex(self, /)setAcceptDrops(self, on, /)setAccessibleDescription(self, description, /)setAccessibleIdentifier(self, identifier, /)setAccessibleName(self, name, /)setAnimated(self, enabled, /)setAttribute(self, arg__1, /[, on])setAutoFillBackground(self, enabled, /)setBackgroundRole(self, arg__1, /)setBaseSize(-> None)setCentralWidget(self, widget, /)setContentsMargins(-> None)setContextMenuPolicy(self, policy, /)setCorner(self, corner, area, /)setCursor(self, arg__1, /)setDisabled(self, arg__1, /)setDockNestingEnabled(self, enabled, /)setDockOptions(self, options, /)setDocumentMode(self, enabled, /)setEnabled(self, arg__1, /)setFixedHeight(self, h, /)setFixedSize(-> None)setFixedWidth(self, w, /)setFocus(-> None)setFocusPolicy(self, policy, /)setFocusProxy(self, arg__1, /)setFont(self, arg__1, /)setForegroundRole(self, arg__1, /)setGeometry(-> None)setGraphicsEffect(self, effect, /)setHidden(self, hidden, /)setIconSize(self, iconSize, /)setInputMethodHints(self, hints, /)setLayout(self, arg__1, /)setLayoutDirection(self, direction, /)setLocale(self, locale, /)setMask(-> None)setMaximumHeight(self, maxh, /)setMaximumSize(-> None)setMaximumWidth(self, maxw, /)setMenuBar(self, menubar, /)setMenuWidget(self, menubar, /)setMinimumHeight(self, minh, /)setMinimumSize(-> None)setMinimumWidth(self, minw, /)setMouseTracking(self, enable, /)setObjectName(self, name, /)setPalette(self, arg__1, /)setParent(-> None)setProperty(self, name, value, /)setScreen(self, arg__1, /)setShortcutAutoRepeat(self, id, /[, enable])setShortcutEnabled(self, id, /[, enable])setSizeIncrement(-> None)setSizePolicy(-> None)setStatusBar(self, statusbar, /)setStatusTip(self, arg__1, /)setStyle(self, arg__1, /)setStyleSheet(self, styleSheet, /)setTabOrder(arg__1, arg__2, /)setTabPosition(self, areas, tabPosition, /)setTabShape(self, tabShape, /)setTabletTracking(self, enable, /)setToolButtonStyle(self, toolButtonStyle, /)setToolTip(self, arg__1, /)setToolTipDuration(self, msec, /)setUnifiedTitleAndToolBarOnMac(self, set, /)setUpdatesEnabled(self, enable, /)setVisible(self, visible, /)setWhatsThis(self, arg__1, /)setWindowFilePath(self, filePath, /)setWindowFlag(self, arg__1, /[, on])setWindowFlags(self, type, /)setWindowIcon(self, icon, /)setWindowIconText(self, arg__1, /)setWindowModality(self, windowModality, /)setWindowModified(self, arg__1, /)setWindowOpacity(self, level, /)setWindowRole(self, arg__1, /)setWindowState(self, state, /)setWindowTitle(self, arg__1, /)sharedPainter(self, /)show(self, /)showEvent(self, event, /)showFullScreen(self, /)showMaximized(self, /)showMinimized(self, /)showNormal(self, /)signalsBlocked(self, /)size(self, /)sizeHint(self, /)sizeIncrement(self, /)sizePolicy(self, /)splitDockWidget(self, after, dockwidget, ...)stackUnder(self, arg__1, /)startTimer(self, interval, /[, timerType])statusBar(self, /)statusTip(self, /)style(self, /)styleSheet(self, /)switch_command(command)Set the active command and update the run button's label.
Set the active command to
discus_suitewith a"{}"template.Set the active command to
shelxlwith a"{} {}"template.Set the active command to
shelxtwith a"{} {}"template.Set the active command to
xprepwith a"{} {}"template.tabPosition(self, area, /)tabShape(self, /)tabifiedDockWidgets(self, dockwidget, /)tabifyDockWidget(self, first, second, /)tabletEvent(self, event, /)takeCentralWidget(self, /)testAttribute(self, arg__1, /)thread(self, /)timerEvent(self, event, /)toolBarArea(self, toolbar, /)toolBarBreak(self, toolbar, /)toolButtonStyle(self, /)toolTip(self, /)toolTipDuration(self, /)topLevelWidget(self, /)tr(self, sourceText, /[, disambiguation, n])underMouse(self, /)ungrabGesture(self, type, /)unifiedTitleAndToolBarOnMac(self, /)unsetCursor(self, /)unsetLayoutDirection(self, /)unsetLocale(self, /)update(-> None -> None -> None)updateGeometry(self, /)updateMicroFocus(self, /[, query])updatesEnabled(self, /)visibleRegion(self, /)whatsThis(self, /)wheelEvent(self, event, /)width(self, /)widthMM(self, /)winId(self, /)window(self, /)windowFilePath(self, /)windowFlags(self, /)windowHandle(self, /)windowIcon(self, /)windowIconText(self, /)windowModality(self, /)windowOpacity(self, /)windowRole(self, /)windowState(self, /)windowTitle(self, /)windowType(self, /)x(self, /)y(self, /)DockOption
PaintDeviceMetric
RenderFlag
customContextMenuRequested
destroyed
iconSizeChanged
objectNameChanged
tabifiedDockWidgetActivated
toolButtonStyleChanged
windowIconChanged
windowIconTextChanged
windowTitleChanged
- load_file(item)[source]#
Load the selected file’s contents into the text editor.
- Parameters:
- itemQListWidgetItem
List item whose text is the file name (relative to directory_path) to load.
- load_files_in_directory()[source]#
Clear the file list widget and repopulate it from directory_path.
- open_directory()[source]#
Prompt the user to select a directory and load its file list.
Opens a directory selection dialog; if a directory is chosen, stores it in directory_path and populates the file list widget with its contents.
- run_command()[source]#
Run the active command on the current file in a system terminal.
Formats the command using terminal and command, then tries a series of common terminal emulators until one successfully launches. Shows a status bar message if no suitable terminal is found.
- class EmittingStream(emit_func, *args, **kwargs)[source]#
Bases:
StringIOIn-memory text stream that forwards written text to a callback.
Used to redirect stdout/stderr from a background task so that the written text can be relayed to the GUI via a Qt signal.
- Attributes:
- closed
encodingEncoding of the text stream.
errorsThe error setting of the decoder or encoder.
- line_buffering
newlinesLine endings translated so far.
Methods
close(/)Close the IO object.
detach(/)Separate the underlying buffer from the TextIOBase and return it.
fileno(/)Return underlying file descriptor if one exists.
flush()Do nothing; flushing is a no-op for this stream.
getvalue(/)Retrieve the entire contents of the object.
isatty(/)Return whether this is an 'interactive' stream.
read([size])Read at most size characters, returned as a string.
readable(/)Returns True if the IO object can be read.
readline([size])Read until newline or EOF.
readlines([hint])Return a list of lines from the stream.
seek(pos[, whence])Change stream position.
seekable(/)Returns True if the IO object can be seeked.
tell(/)Tell the current file position.
truncate([pos])Truncate size to pos.
writable(/)Returns True if the IO object can be written.
write(s)Write text to the underlying buffer and forward it to the callback.
writelines(lines, /)Write a list of lines to stream.
- class SignalLogHandler(emit_func)[source]#
Bases:
HandlerLogging handler that forwards formatted log records to a callback.
Used to relay log messages emitted during a background task to the GUI via a Qt signal.
- Attributes:
- name
Methods
acquire()Acquire the I/O thread lock.
addFilter(filter)Add the specified filter to this handler.
close()Tidy up any resources used by the handler.
createLock()Acquire a thread lock for serializing access to the underlying I/O.
emit(record)Format a log record and forward it to the callback.
filter(record)Determine if a record is loggable by consulting all the filters.
flush()Ensure all logging output has been flushed.
format(record)Format the specified record.
handle(record)Conditionally emit the specified logging record.
handleError(record)Handle errors which occur during an emit() call.
release()Release the I/O thread lock.
removeFilter(filter)Remove the specified filter from this handler.
setFormatter(fmt)Set the formatter for this handler.
setLevel(level)Set the logging level of this handler.
get_name
set_name
- class ThreadPool[source]#
Bases:
QThreadPoolThread pool for managing worker threads.
Tracks active workers and provides functionality to stop all running processes.
Methods
activeThreadCount(self, /)blockSignals(self, b, /)childEvent(self, event, /)children(self, /)clear(self, /)connect(...)connectNotify(self, signal, /)contains(self, thread, /)customEvent(self, event, /)deleteLater(self, /)disconnect(...)disconnectNotify(self, signal, /)dumpObjectInfo(self, /)dumpObjectTree(self, /)dynamicPropertyNames(self, /)emit(self, signal, /, *args)event(self, event, /)eventFilter(self, watched, event, /)expiryTimeout(self, /)findChild(self, type, /[, name, options])findChildren() -> List[~PlaceholderType] ))globalInstance()inherits(self, classname, /)installEventFilter(self, filterObj, /)isQmlExposed(self, /)isQuickItemType(self, /)isSignalConnected(self, signal, /)isWidgetType(self, /)isWindowType(self, /)killTimer(-> None)maxThreadCount(self, /)metaObject(self, /)moveToThread(self, thread, /)objectName(self, /)parent(self, /)property(self, name, /)receivers(self, signal, /)releaseThread(self, /)removeEventFilter(self, obj, /)remove_worker(worker)Remove worker from active list when finished.
reserveThread(self, /)sender(self, /)senderSignalIndex(self, /)serviceLevel(self, /)setExpiryTimeout(self, expiryTimeout, /)setMaxThreadCount(self, maxThreadCount, /)setObjectName(self, name, /)setParent(self, parent, /)setProperty(self, name, value, /)setServiceLevel(self, serviceLevel, /)setStackSize(self, stackSize, /)setThreadPriority(self, priority, /)signalsBlocked(self, /)stackSize(self, /)start(-> None)startOnReservedThread(self, runnable, /)startTimer(self, interval, /[, timerType])start_worker_pool(worker)Start a worker and track it in the active workers list.
Stop all active workers by setting their stop events.
thread(self, /)threadPriority(self, /)timerEvent(self, event, /)tr(self, sourceText, /[, disambiguation, n])tryStart(-> bool)tryTake(self, runnable, /)waitForDone(-> bool)destroyed
objectNameChanged
- remove_worker(worker)[source]#
Remove worker from active list when finished.
- Parameters:
- workerWorker
Worker to remove from active_workers, if present.
- class Worker(task, *args, **kwargs)[source]#
Bases:
QRunnableWorker thread for running tasks in the background.
The worker automatically passes ‘progress’ and ‘stop_event’ to the task function.
Example task function that can be stopped:
- def my_task(progress=None, stop_event=None, **kwargs):
- for i in range(100):
# Check if stop was requested if stop_event and stop_event.is_set():
print(“Task stopped by user”) return None
# Do work… time.sleep(0.1)
# Report progress if progress:
progress(f”Processing step {i+1}”, (i+1))
return result
Methods
autoDelete(self, /)connect_finished(process)Connect a callback to the worker's finished signal.
connect_progress(process)Connect a callback to the worker's progress signal.
connect_result(process)Connect a callback to the worker's result signal.
create(functionToRun, /)emit_progress(message, progress)Emit a progress update via the worker's progress signal.
Check if stop has been requested.
run()Run the task, redirecting stdout/stderr/logging to Qt signals.
setAutoDelete(self, autoDelete, /)stop()Request the worker to stop by setting the stop event.
- connect_finished(process)[source]#
Connect a callback to the worker’s finished signal.
- Parameters:
- processcallable
Function called with no arguments when the finished signal is emitted.
- connect_progress(process)[source]#
Connect a callback to the worker’s progress signal.
- Parameters:
- processcallable
Function called with the status message and progress value when the progress signal is emitted.
- connect_result(process)[source]#
Connect a callback to the worker’s result signal.
- Parameters:
- processcallable
Function called with the task’s return value when the result signal is emitted.
- emit_progress(message, progress)[source]#
Emit a progress update via the worker’s progress signal.
- Parameters:
- messagestr
Status message describing the current progress.
- progressint
Progress value (e.g. percent complete or step count).
- run()[source]#
Run the task, redirecting stdout/stderr/logging to Qt signals.
Executes self.task with the stored arguments, capturing any printed output and log records and relaying them via
self.signals.output. Emitsself.signals.resultwith the task’s return value on success,self.signals.errorwith exception information on failure, and always emitsself.signals.finishedafterward.
- class WorkerSignals[source]#
Bases:
QObjectCollection of signals used to communicate
Workerstate.- Attributes:
- finishedSignal
Emitted with no arguments when the worker’s task has finished running, regardless of success or failure.
- errorSignal(tuple)
Emitted with a
(exctype, value, traceback_str)tuple when the task raises an exception.- progressSignal(str, int)
Emitted with a status message and a progress value as the task reports progress.
- resultSignal(object)
Emitted with the return value of the task once it completes successfully.
- outputSignal(str)
Emitted with captured stdout/stderr/log text produced by the task.
Methods
blockSignals(self, b, /)childEvent(self, event, /)children(self, /)connect(...)connectNotify(self, signal, /)customEvent(self, event, /)deleteLater(self, /)disconnect(...)disconnectNotify(self, signal, /)dumpObjectInfo(self, /)dumpObjectTree(self, /)dynamicPropertyNames(self, /)emit(self, signal, /, *args)event(self, event, /)eventFilter(self, watched, event, /)findChild(self, type, /[, name, options])findChildren() -> List[~PlaceholderType] ))inherits(self, classname, /)installEventFilter(self, filterObj, /)isQmlExposed(self, /)isQuickItemType(self, /)isSignalConnected(self, signal, /)isWidgetType(self, /)isWindowType(self, /)killTimer(-> None)metaObject(self, /)moveToThread(self, thread, /)objectName(self, /)parent(self, /)property(self, name, /)receivers(self, signal, /)removeEventFilter(self, obj, /)sender(self, /)senderSignalIndex(self, /)setObjectName(self, name, /)setParent(self, parent, /)setProperty(self, name, value, /)signalsBlocked(self, /)startTimer(self, interval, /[, timerType])thread(self, /)timerEvent(self, event, /)tr(self, sourceText, /[, disambiguation, n])destroyed
error
finished
objectNameChanged
output
progress
result