Skip to content

Commit

Permalink
Edit ToFConverter functionality
Browse files Browse the repository at this point in the history
edited the .py file associated with functionality
so that pylint would accept it

Refs #12701
  • Loading branch information
MattKing06 committed Jul 20, 2015
1 parent e9b8007 commit 35a0d39
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions Code/Mantid/scripts/TofConverter/converterGUI.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#pylint: disable=invalid-name
from TofConverter.ui_converter import Ui_MainWindow #import line for the UI python class
from ui_converter import Ui_MainWindow #import line for the UI python class
from PyQt4 import QtCore, QtGui
import math

Expand Down Expand Up @@ -65,7 +65,6 @@ def helpClicked(self):
# Temporary import while method is in the wrong place
from pymantidplot.proxies import showCustomInterfaceHelp
showCustomInterfaceHelp("TOF_Converter") #need to find a way to import this module

def convert(self):
if self.ui.InputVal.text() == "":
return
Expand All @@ -83,14 +82,14 @@ def convert(self):

self.ui.convertedVal.clear()
self.ui.convertedVal.insert(str(self.stage2output))
except Exception, e:
except ArithmeticError, e:
QtGui.QMessageBox.warning(self, "TofConverter", str(e))
return

def input2energy(self, inputval, inOption):
e2lam = 81.787 #using lambda=h/p p: momentum, h: planck's const, lambda: wavelength
e2nu = 4.139 # using h/(m*lambda^2) m: mass of neutron
e2v = 0.0000052276 # using v = h/(m*lambda)
e2v = 0.0000052276 # using v = h/(m*lambda)
e2k = 2.717 #using k = 2*pi/(lambda) k:momentum
e2t = 0.086165 #using t = (m*v^2)/(2kb) kb: Boltzmann const
e2cm = 0.123975 #cm = 8.06554465*E E:energy
Expand Down Expand Up @@ -140,11 +139,10 @@ def input2energy(self, inputval, inOption):
def energy2output(self, Energy, inOption):
e2lam = 81.787 #using lambda=h/p p: momentum, h: planck's const, lambda: wavelength
e2nu = 4.139 # using h/(m*lambda^2) m: mass of neutron
e2v = 0.0000052276 # using v = h/(m*lambda)
e2v = 0.0000052276 # using v = h/(m*lambda)
e2k = 2.717 #using k = 2*pi/(lambda) k:momentum
e2t = 0.086165 #using t = (m*v^2)/(2kb) kb: Boltzmann const
e2cm = 0.123975 #cm = 8.06554465*E E:energy
iv2 = inputval ** 2

if inOption == 'Wavelength (Angstroms)':
OutputVal = (e2lam/ Energy)**0.5
Expand Down

0 comments on commit 35a0d39

Please sign in to comment.