Ticket #8899: rebin_test.py
File rebin_test.py, 462 bytes (added by Arturs Bekasovs, 7 years ago) |
---|
Line | |
---|---|
1 | import math |
2 | import numpy as np |
3 | |
4 | ws = WorkspaceFactory.create("Workspace2D", 1, 10, 9) |
5 | |
6 | ws.setX(0, np.array([0.5,1.25,2,2.75,3.5, 4.25, 5, 5.75, 6.5, 7.25])) |
7 | |
8 | yVal = np.empty(9); yVal.fill(3.0) |
9 | ws.setY(0, yVal) |
10 | |
11 | eVal = np.empty(9); eVal.fill( math.sqrt(3.0) ) |
12 | ws.setE(0, eVal) |
13 | |
14 | mtd.addOrReplace("ws", ws) |
15 | mtd.addOrReplace("ws", ws) # That works fine |
16 | |
17 | binnedWs = Rebin(ws, "2.0") # binnedWs is added to the ADS |
18 | mtd.addOrReplace("binnedWs", binnedWs) # Crashes here |