Skip to content

Commit

Permalink
refs #7319. Move l2q to new API, but make callable from quick.
Browse files Browse the repository at this point in the history
  • Loading branch information
OwenArnold committed Jun 20, 2013
1 parent e6f5006 commit 39429d7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
10 changes: 5 additions & 5 deletions Code/Mantid/scripts/Reflectometry/l2q.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import math
from mantidsimple import *
#from mantid.simpleapi import * # New API
from mantid.simpleapi import *

def l2q(ws,whichDet,theta):
'''
Expand All @@ -26,7 +25,8 @@ def l2q(ws,whichDet,theta):
#ws = mantid.getMatrixWorkspace(ws)

# pick up the sample to detector distance
if ws.isGroup():
from mantid.api import WorkspaceGroup # (only required as while the old API still exists.)
if isinstance(ws, WorkspaceGroup):
wsg = ws.getName() + '_1'
inst = mtd[wsg].getInstrument()
else:
Expand All @@ -46,10 +46,10 @@ def l2q(ws,whichDet,theta):
print x, y, z
print whichDet
# Move the detector ianto the correct spot
MoveInstrumentComponent(ws,ComponentName=whichDet,X=x,Y=y,Z=z,RelativePosition=False)
MoveInstrumentComponent(Workspace=mtd[ws.name()],ComponentName=whichDet,X=x,Y=y,Z=z,RelativePosition=False)

# Now convert to momentum transfer
ConvertUnits(InputWorkspace=ws,OutputWorkspace="IvsQ",Target="MomentumTransfer",AlignBins="1")
ConvertUnits(InputWorkspace=mtd[ws.name()],OutputWorkspace="IvsQ",Target="MomentumTransfer",AlignBins="1")
return mtd["IvsQ"]


Expand Down
1 change: 0 additions & 1 deletion Code/Mantid/scripts/Reflectometry/quick.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from mantidsimple import * # Old API
#from mantid.simpleapi import * # New API
#from mantidplot import *
from PyQt4 import QtCore, uic
import math


Expand Down

0 comments on commit 39429d7

Please sign in to comment.