Ticket #8702: rebin_full_bins_only_test.py

File rebin_full_bins_only_test.py, 405 bytes (added by Arturs Bekasovs, 7 years ago)
Line 
1import numpy as np
2
3ws = WorkspaceFactory.create("Workspace2D", 1, 10, 9)
4
5xValues = np.array(range(1,11)) * 0.5 # 0.5 1.0 1.5 2.0 2.5 ...
6yValues = np.empty(9); yValues.fill(3.0) # 3.0 3.0 3.0 ....
7
8ws.setX(0, xValues)
9ws.setY(0, yValues)
10
11mtd.addOrReplace("ws", ws)
12
13result = Rebin("ws", "0.5,2.0,5.0", FullBinsOnly=True)
14# result = Rebin("ws", "0.5,2.0,5.0") - this would include the smaller last bin
15