peaks_to_detID_omega.py 369 Bytes
Newer Older
1
from mantid.simpleapi import LoadNexus
2
import numpy as np
3
4
5
6
7

peaks = LoadNexus('peaks.nxs')

for p in range(peaks.getNumberPeaks()):
    peak = peaks.getPeak(p)
8
    g = peak.getGoniometerMatrix()
9
10
11
12
    detID = peak.getDetectorID()
    x=detID//(4*4*128)
    y=detID%(4*128)//4
    print(detID, peak.getQSampleFrame(), np.mod(np.arctan(g[0,2]/g[0,0])*180/np.pi,-180), x, y)