Commit 571d32fd authored by Whitfield, Ross's avatar Whitfield, Ross
Browse files

Update omega_scan/omega_scan_integration.py

parent 77d60a94
import numpy as np
peaks = mtd['peaks']
data = mtd['NaCl'].getSignalArray()
dx = dy = 20
lines = []
for p in range(peaks.getNumberPeaks()):
peak = peaks.getPeak(p)
g = peak.getGoniometerMatrix()
detID = peak.getDetectorID()
x=detID//(4*4*128)-1
y=detID%(4*128)//4-1
print(detID, peak.getQSampleFrame(), np.mod(np.arctan(g[0,2]/g[0,0])*180/np.pi,-180), x, y)
line = IntegrateMDHistoWorkspace('NaCl',
P1Bin='{},{}'.format(y-dy, y+dy),
P2Bin='{},{}'.format(x-dx, x+dx))
lines.append(line.getSignalArray().flatten())
lines = np.array(lines)
output = CreateWorkspace(DataY=lines,DataX=range(len(lines[0])), NSpec=len(lines))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment