NeuXtalViz package#

NeuXtalViz is a toolkit for single-crystal diffraction analysis and visualization.

Features#

  • UB matrix calculation

  • Peak indexing and integration

  • Volume slicing

  • Experiment planning

Submodules#

NeuXtalViz.application module#

class NeuXtalViz[source]#

Bases: QMainWindow

Main application window for NeuXtalViz.

Implements a singleton QMainWindow that hosts the UB Calculator, Experiment Planner, Reciprocal Space Volume Slicer, and Structure Factor Calculator tools in a stacked widget, and provides menu actions for launching external reduction/analysis GUIs (TOPAZ, garnet, ShelXle, Olex2, FullProf, VESTA) and internal helpers such as the experiment browser and structure/diffuse interface.

Attributes:
painters

ushort

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(event)

Explicitly close each tool's PyVista plotter before the window and its child widgets are destroyed.

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, /)

experiment_browser_GUI()

Launch the external SNS experiment browser script.

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, /)

fullprof_GUI()

Launch the external FullProf application.

garnet_reduction_GUI()

Launch the external garnet reduction script.

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, /)

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, /)

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, /)

olex2_GUI()

Launch the external Olex2 application.

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])

saveGeometry(self, /)

saveState(self, /[, version])

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, /)

shelxle_GUI()

Launch the external ShelXle application.

show(self, /)

showEvent(self, event, /)

showFullScreen(self, /)

showMaximized(self, /)

showMinimized(self, /)

showNormal(self, /)

show_about_dialog()

Display the "About NeuXtalViz" information dialog.

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, /)

structdiff_GUI()

Launch the command browser interface as a separate process.

style(self, /)

styleSheet(self, /)

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, /)

topaz_reduction_GUI()

Prompt for a TOPAZ reduction directory and launch its main.py.

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, /)

vesta_GUI()

Launch the external VESTA application.

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

closeEvent(event)[source]#

Explicitly close each tool’s PyVista plotter before the window and its child widgets are destroyed.

BasePlotter.__del__ calls close() on garbage collection if a plotter was never explicitly closed. If that happens after Qt has already destroyed the underlying C++ QtInteractor object (e.g. as part of normal window teardown), it raises a shiboken “already deleted” RuntimeError. Closing each plotter here, while the widgets are still alive, avoids that.

experiment_browser_GUI()[source]#

Launch the external SNS experiment browser script.

Shows a critical error dialog if /SNS/software/scd/experiment.sh cannot be launched.

fullprof_GUI()[source]#

Launch the external FullProf application.

Shows a critical error dialog if the fullprof executable cannot be launched.

garnet_reduction_GUI()[source]#

Launch the external garnet reduction script.

Shows a critical error dialog if /SNS/software/scd/garnet.sh cannot be launched.

olex2_GUI()[source]#

Launch the external Olex2 application.

Shows a critical error dialog if /SNS/software/scd/olex2/olex2 cannot be launched.

shelxle_GUI()[source]#

Launch the external ShelXle application.

Shows a critical error dialog if the shelxle executable cannot be launched.

show_about_dialog()[source]#

Display the “About NeuXtalViz” information dialog.

structdiff_GUI()[source]#

Launch the command browser interface as a separate process.

Runs views/command_browser.py (located next to this module) with the python interpreter. Shows a critical error dialog if the script cannot be launched.

topaz_reduction_GUI()[source]#

Prompt for a TOPAZ reduction directory and launch its main.py.

Opens a directory selection dialog (starting from the last used TOPAZ path), and if the chosen directory contains a main.py script, launches it with mantidpython. Shows a warning if main.py is missing, or a critical error dialog if launching fails.

vesta_GUI()[source]#

Launch the external VESTA application.

Shows a critical error dialog if the VESTA executable cannot be launched.

gui()[source]#

Create and run the NeuXtalViz Qt application.

Installs a global exception handler, creates the QApplication, detects whether the system palette is dark or light to select a matching qdarkstyle theme (and PyVista plot theme), then creates and shows the main NeuXtalViz window and starts the Qt event loop. This is the console-script entry point installed as neuxtalviz.

handle_exception(exc_type, exc_value, exc_traceback)[source]#

Display an uncaught exception in a critical message dialog.

Intended to be installed as sys.excepthook so that unhandled exceptions are shown to the user in a Qt dialog with the full traceback available as detailed text, instead of only being printed to the console.

Parameters:
exc_typetype

The class of the raised exception.

exc_valueBaseException

The exception instance that was raised.

exc_tracebacktraceback

The traceback object associated with the exception.

Module contents#

Module to load the version created by versioningit

Will fall back to a default if NeuXtalViz is not installed