Exemplo n.º 1
0
from mantid.simpleapi import Load, Integration
import numpy as np

ws_list = np.genfromtxt('/SNS/users/rwp/corelli/tube_calibration/list',
                        delimiter=',',
                        dtype=[('runs', '|S11'), ('banks', '5i8'),
                               ('height', 'i8')])

for run, banks, height in ws_list:
    banks = np.asarray(banks)
    banks = banks[np.nonzero(banks)]
    bank_names = ','.join('bank' + str(b) for b in banks)
    print(run)
    print(banks)
    print('CORELLI_' + run)
    for bank in banks:
        data = Load(Filename='CORELLI_' + run, BankName='bank' + str(bank))
        data = Integration(data)
        data_Y = data.extractY() * -1
        for tube in range(16):
            filename = 'COR_{}_{}_{}'.format(run, bank, tube + 1)
            np.savetxt(
                filename + '.txt',
                np.concatenate((np.array(range(256), ndmin=2).T, data_Y[range(
                    256 * tube, 256 * (tube + 1))]),
                               axis=1))
Exemplo n.º 2
0
from mantid.simpleapi import Load, Integration
import numpy as np

run1 = 'CORELLI_48505'
run2 = 'CORELLI_48513'

ws1 = Load(run1)
ws2 = Load(run2)
ws1 = Integration(ws1)
ws2 = Integration(ws2)

ws1y = ws1.extractY().reshape((-1, 256))
ws2y = ws2.extractY().reshape((-1, 256))

ws1ysum = ws1y.sum(axis=1)
ws2ysum = ws2y.sum(axis=1)

import matplotlib.pyplot as plt
plt.imshow(ws1y, vmax=1000)
plt.show()

plt.plot(ws1ysum)
plt.plot(ws2ysum)
plt.show()

w1 = ws1ysum[480:912]
w2 = ws2ysum[480:912]

plt.plot(w1)
plt.plot(w2)
plt.show()