Skip to content

Commit

Permalink
Added changes of main algo. This refs #4303
Browse files Browse the repository at this point in the history
  • Loading branch information
JeanBilheux committed Jan 30, 2012
1 parent 52c7354 commit 93585e8
Showing 1 changed file with 34 additions and 40 deletions.
74 changes: 34 additions & 40 deletions Code/Mantid/Framework/PythonAPI/PythonAlgorithms/RefLReduction.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,31 +172,20 @@ def PyExec(self):
#background range (along the y-axis) and of only the pixel
#of interest along the x-axis (to avoid the frame effect)
theta = tthd_rad - ths_rad
mt2 = wks_utility.createIntegratedWorkspace(mtd[ws_histo_data],
"IntegratedDataWks1",
fromXpixel=Xrange[0],
toXpixel=Xrange[1],
fromYpixel=BackfromYpixel,
toYpixel=BacktoYpixel,
maxX=maxX,
maxY=maxY,
cpix=data_cpix,
source_to_detector=dMD,
sample_to_detector=dSD,
theta=theta,
geo_correction=False,
Qrange=q_binning)


#_tof_axis = mt2.readX(0)[:]
########## This was used to test the R(Q)
##Convert the data without background subtraction to R(Q)
#q_array = wks_utility.convertToRvsQ(dMD=dMD,
# theta=theta,
# tof=_tof_axis)
#q_array_reversed = q_array[::-1]

# Background
wks_utility.createIntegratedWorkspace(mtd[ws_histo_data],
"IntegratedDataWks1",
fromXpixel=Xrange[0],
toXpixel=Xrange[1],
fromYpixel=BackfromYpixel,
toYpixel=BacktoYpixel,
maxX=maxX,
maxY=maxY,
cpix=data_cpix,
source_to_detector=dMD,
sample_to_detector=dSD,
theta=theta,
geo_correction=True,
Qrange=Qrange)

ConvertToHistogram(InputWorkspace='IntegratedDataWks1',
OutputWorkspace='IntegratedDataWks')
Expand All @@ -206,7 +195,7 @@ def PyExec(self):

ConvertToHistogram(InputWorkspace='TransposedID',
OutputWorkspace='TransposedID')

if subtract_data_bck:
FlatBackground(InputWorkspace='TransposedID',
OutputWorkspace='TransposedID',
Expand All @@ -222,7 +211,7 @@ def PyExec(self):
RebinToWorkspace(WorkspaceToRebin="DataBckWks", WorkspaceToMatch="IntegratedDataWks", OutputWorkspace="DataBckWks")

Minus("IntegratedDataWks", "DataBckWks", OutputWorkspace="DataWks")

# Work on Normalization file #########################################
# Find full path to event NeXus data file
f = FileFinder.findRuns("REF_L%d" %normalization_run)
Expand Down Expand Up @@ -255,19 +244,19 @@ def PyExec(self):
#Create a new event workspace of only the range of pixel of interest
#background range (along the y-axis) and of only the pixel
#of interest along the x-axis (to avoid the frame effect)
mt3_norm = wks_utility.createIntegratedWorkspace(mtd[ws_norm_histo_data],
"IntegratedNormWks",
fromXpixel=Xrange[0],
toXpixel=Xrange[1],
fromYpixel=BackfromYpixel,
toYpixel=BacktoYpixel,
maxX=maxX,
maxY=maxY,
cpix=data_cpix,
source_to_detector=dMD,
sample_to_detector=dSD,
theta=theta,
geo_correction=False)
wks_utility.createIntegratedWorkspace(mtd[ws_norm_histo_data],
"IntegratedNormWks",
fromXpixel=Xrange[0],
toXpixel=Xrange[1],
fromYpixel=BackfromYpixel,
toYpixel=BacktoYpixel,
maxX=maxX,
maxY=maxY,
cpix=data_cpix,
source_to_detector=dMD,
sample_to_detector=dSD,
theta=theta,
geo_correction=False)

Transpose(InputWorkspace='IntegratedNormWks',
OutputWorkspace='TransposedID')
Expand All @@ -287,9 +276,14 @@ def PyExec(self):
OutputWorkspace='NormBckWks')

ConvertToHistogram("NormBckWks", OutputWorkspace="NormBckWks")
# RebinToWorkspace(WorkspaceToRebin="NormBckWks", WorkspaceToMatch="IntegratedNormWks", OutputWorkspace="NormBckWks")
RebinToWorkspace(WorkspaceToRebin="NormBckWks", WorkspaceToMatch="IntegratedNormWks", OutputWorkspace="NormBckWks")

Minus("IntegratedNormWks", "NormBckWks", OutputWorkspace="NormWks")

RebinToWorkspace(WorkspaceToRebin="NormWks",
WorkspaceToMatch='DataWks',
OutputWorkspace='NormWks')

#perform the integration myself
mt_temp = mtd['NormWks']
Expand Down

0 comments on commit 93585e8

Please sign in to comment.