Ticket #8899: rebin_test.py

File rebin_test.py, 462 bytes (added by Arturs Bekasovs, 7 years ago)

Failing script

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