Skip to content

Commit

Permalink
refs #8643. Inserting the polarisation correction routines.
Browse files Browse the repository at this point in the history
Appears to be working for PNR and PA cases. System test for multi detector runs is failing as a result of these changes. This will need fixing.
  • Loading branch information
OwenArnold committed Jan 7, 2014
1 parent 16fdc63 commit d61dcd2
Show file tree
Hide file tree
Showing 3 changed files with 284 additions and 43 deletions.
Expand Up @@ -16,6 +16,14 @@ def sum_workspaces(cls, workspaces):
"""
return sum(workspaces)

@classmethod
def to_single_workspace(cls, candidate):
ws = ConvertToWavelength.to_workspace(candidate)
if isinstance(ws, mantid.api.WorkspaceGroup):
return ws[0]
else:
return ws

@classmethod
def to_workspace(cls, candidate):
workspace = None
Expand Down
5 changes: 3 additions & 2 deletions Code/Mantid/scripts/Reflectometry/isis_reflectometry/l2q.py
Expand Up @@ -3,7 +3,7 @@
from mantid.simpleapi import * # New API
from mantid.geometry import ReferenceFrame

def l2q(ws,whichDet,theta):
def l2q(ws,whichDet,theta, sample_component_name):
'''
call signature::call signature::
Expand All @@ -15,6 +15,7 @@ def l2q(ws,whichDet,theta):
ws : run to be converted into Q.
whichDet : Name of the component detector
theta : final theta angle to use.
sample_component_name: Name of the component that corresponds to the sample
TODO:
1) This is currently a point detector only function. This will either need
Expand All @@ -30,7 +31,7 @@ def l2q(ws,whichDet,theta):
else:
inst = ws.getInstrument()

sampleLocation=inst.getComponentByName('some-surface-holder').getPos()
sampleLocation=inst.getComponentByName(sample_component_name).getPos()
detLocation=inst.getComponentByName(whichDet).getPos()
sample2detector=detLocation-sampleLocation # meters

Expand Down

0 comments on commit d61dcd2

Please sign in to comment.