Skip to content

Commit

Permalink
Re #8592. Copied over Art's changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
peterfpeterson committed Dec 10, 2013
1 parent 82332bf commit e4bd618
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
7 changes: 7 additions & 0 deletions Code/Mantid/scripts/SCD_Reduction/ReduceSCD.config
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@ calibration_file_2 None
data_directory None
output_directory /SNS/TOPAZ/IPTS-9890/shared/SPAnH

#
# If use_monitor_counts is True, then the integrated beam monitor
# counts will be used for scaling. If use_monitor_counts is False,
# then the integrated proton charge will be used for scaling. These
# values will be listed under MONCNT in the integrate file.
use_monitor_counts False

#
# Min & max tof determine the range of events loaded.
# Max Q determines the range of Q values that will be mapped to
Expand Down
19 changes: 15 additions & 4 deletions Code/Mantid/scripts/SCD_Reduction/ReduceSCD_OneRun.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,16 @@
# This version now includes the posibility to use the 1D cylindrical integration method
# and the posibility to load a UB matrix which will be used for integration of the individual
# runs and to index the combined file (Code from Xiapoing).
#

#
# _v2: December 3rd 2013. Mads Joergensen
# Adds the posibility to optimize the loaded UB for each run for a better peak prediction
# It is also possible to find the common UB by using lattice parameters of the first
# run or the loaded matirix instead of the default FFT method
#
# _v3: December 5 2013. A. J. Schultz
# This version includes the Boolean parameter use_monitor_counts to allow
# the use of either monitor counts (True) or proton charge (False) for
# scaling.

import os
import sys
Expand Down Expand Up @@ -161,13 +163,15 @@
Filename=calibration_file_1, Filename2=calibration_file_2 )

monitor_ws = LoadNexusMonitors( Filename=full_name )
proton_charge = monitor_ws.getRun().getProtonCharge() * 1000.0 # get proton charge
print "\n", run, " has integrated proton charge x 1000 of", proton_charge, "\n"

integrated_monitor_ws = Integration( InputWorkspace=monitor_ws,
RangeLower=min_monitor_tof, RangeUpper=max_monitor_tof,
StartWorkspaceIndex=monitor_index, EndWorkspaceIndex=monitor_index )

monitor_count = integrated_monitor_ws.dataY(0)[0]
print "\n", run, " has calculated monitor count", monitor_count, "\n"
print "\n", run, " has integrated monitor count", monitor_count, "\n"

minVals= "-"+max_Q +",-"+max_Q +",-"+max_Q
maxVals = max_Q +","+max_Q +","+ max_Q
Expand Down Expand Up @@ -234,7 +238,14 @@
num_peaks = peaks_ws.getNumberPeaks()
for i in range(num_peaks):
peak = peaks_ws.getPeak(i)
peak.setMonitorCount( monitor_count )
if use_monitor_counts:
peak.setMonitorCount( monitor_count )
else:
peak.setMonitorCount( proton_charge )
if use_monitor_counts:
print '\n*** Beam monitor counts used for scaling.'
else:
print '\n*** Proton charge x 1000 used for scaling.\n'

if use_sphere_integration:
#
Expand Down

0 comments on commit e4bd618

Please sign in to comment.