Skip to content

Commit

Permalink
Refs #9042 Theta is now retrieved or calculated if not supplied
Browse files Browse the repository at this point in the history
Quick had a problem where it required theta as the way it was retrieving it didn't work.

In the case where it doesn't have theta it'll first try and retrieve theta from the sample logs, and failing that, calculate it manually

The function now uses the _sample_ws loaded earlier to retrieve from. The problem stemmed from the way we've been changing how parameters to quick are provided, as run_ws was an old variable that had been forgotten about in the midst of these changes.
  • Loading branch information
keithnbrown committed Mar 7, 2014
1 parent c10fb42 commit d3e75a0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Code/Mantid/scripts/Reflectometry/isis_reflectometry/quick.py
Expand Up @@ -195,12 +195,13 @@ def quick_explicit(run, i0_monitor_index, lambda_min, lambda_max, background_mi
source=inst.getSource()
beamPos = sampleLocation - source.getPos()
PI = 3.1415926535
theta = inst.getComponentByName(detector_component_name).getTwoTheta(sampleLocation, beamPos)*180.0/PI/2.0
theta = groupGet(str(_sample_ws),'samp','theta')
if not theta:
theta = inst.getComponentByName(detector_component_name).getTwoTheta(sampleLocation, beamPos)*180.0/PI/2.0
print "Det location: ", detLocation, "Calculated theta = ",theta
if correct_positions: # detector is not in correct place
# Get detector angle theta from NeXuS
logger.information('The detectorlocation is not at Y=0')
theta = groupGet(run_ws,'samp','theta')
print 'Nexus file theta =', theta
IvsQ = l2q(IvsLam, detector_component_name, theta, sample_component_name)
else:
Expand Down

0 comments on commit d3e75a0

Please sign in to comment.