diff --git a/scripts/DGSPlanner/LoadNexusUB.py b/scripts/DGSPlanner/LoadNexusUB.py index 46ca24ef8d064827ac3eb4b97df05d079ea908ed..f6dd5e015ced98369f81a576f81c34577670bfe2 100644 --- a/scripts/DGSPlanner/LoadNexusUB.py +++ b/scripts/DGSPlanner/LoadNexusUB.py @@ -3,13 +3,13 @@ from __future__ import (absolute_import, division, print_function) import numpy as np from mantid.simpleapi import * -def LoadNexusUB(fname): - raw=LoadEventNexus(Filename=fname) - run = raw.getRun() - run_keys = run.keys() - for test_key in run_keys: - if test_key[-8:] == 'UBMatrix': - UBMatrix_key = test_key - UB=np.array( eval(raw.run()[UBMatrix_key].value[0].strip(')').split('(')[1])) - return UB +def LoadNexusUB(fname): + raw=LoadEventNexus(Filename=fname) + run = raw.getRun() + run_keys = run.keys() + for test_key in run_keys: + if test_key[-8:] == 'UBMatrix': + UBMatrix_key = test_key + UB=np.array( eval(raw.run()[UBMatrix_key].value[0].strip(')').split('(')[1])) + return UB diff --git a/scripts/DGSPlanner/MatrixUBInputWidget.py b/scripts/DGSPlanner/MatrixUBInputWidget.py index 98fc7cb4fbb6265ea7aee1c9a695fc61b1a5fb8d..1e02bab0a4731d41571a7c70dab43e313725d1bb 100644 --- a/scripts/DGSPlanner/MatrixUBInputWidget.py +++ b/scripts/DGSPlanner/MatrixUBInputWidget.py @@ -115,11 +115,12 @@ class MatrixUBInputWidget(QtGui.QWidget): except: mantid.logger.error("Could not open the file, or not a valid UB matrix") - def loadNexusUBDialog(self): # pylint: disable=bare-except try: - fname = QtGui.QFileDialog.getOpenFileName(self, 'Open Nexus file to extract UB matrix',filter=QString('Nexus file (*.nxs.h5);;All Files (*)')) + fname = QtGui.QFileDialog.getOpenFileName(\ + self, 'Open Nexus file to extract UB matrix',\ + filter=QString('Nexus file (*.nxs.h5);;All Files (*)')) this_here_UB = LoadNexusUB(str(fname)) UB00 = self.UBmodel.createIndex(0,0) UB01 = self.UBmodel.createIndex(0,1)