Ticket #9030: compare_errors.py

File compare_errors.py, 2.0 KB (added by Gesner Passos, 7 years ago)

File that highlight the systemtests that will change with the new error propagation

Line 
1test_num = 1
2testnames =['EQSANSTransmissionDC',
3'EQSANSTransmissionEvent',
4'EQSANSTransmission',
5'JumpCETest',
6'JumpFickTest',
7'JumpSSTest',
8'LOQCentreNoGravDefineCentre',
9'LOQCentreNoGrav',
10'LOQMinimalBatchReduction',
11'LOQReductionOnLoadedWorkspaceMustProduceTheSameResult_1',
12'LOQReductionOnLoadedWorkspaceMustProduceTheSameResult_2',
13'LOQTransFitWorkspace2D',
14'LOQTransFitWorkspace2DWithLoadedWorkspace',
15'SANS2DWaveloops',
16'SANS2DWaveloopsReloadWorkspace',
17'SANSLOQBatch',
18'VesuvioFittingTest',
19'VesuvioFittingWithKFreeTest',
20'VesuvioFittingWithQuadraticBackgroundTest'
21]
22print len(testnames)
23testname = testnames[test_num]
24print testname
25original_name = testname
26current_name = testname+'-mismatch'
27
28
29new_matches = {'SANS2DWaveloopsReloadWorkspace':'SANS2DWaveloops.nxs',
30'LOQTransFitWorkspace2DWithLoadedWorkspace':'LOQTransFitWorkspace2D.nxs',
31'LOQReductionOnLoadedWorkspaceMustProduceTheSameResult_2':'LOQCentreNoGrav.nxs',
32'LOQCentreNoGravDefineCentre': 'LOQCentreNoGrav.nxs',
33'LOQReductionOnLoadedWorkspaceMustProduceTheSameResult_1':'LOQCentreNoGravSearchCentreFixed.nxs',
34'LOQMinimalBatchReduction':'LOQReductionMergedData.nxs',
35'JumpSSTest':'ISISIndirectBayes_JumpSSTest.nxs', 
36'JumpCETest':'ISISIndirectBayes_JumpCETest.nxs', 
37'JumpFickTest':'ISISIndirectBayes_JumpFickTest.nxs', 
38'EQSANSTransmission':'EQSANSTrans.nxs',
39'EQSANSTransmissionEvent':'EQSANSTransEvent.nxs'
40}
41
42for k,v in new_matches.items():
43        if testname == k: original_name = v
44
45
46mtd.clear()
47
48ws1 = Load(original_name)
49ws2 =  Load(current_name)
50
51
52
53def compareErrors(ws1, ws2, index):
54  axisX = range(len(ws1.readE(index)))
55  original = CreateWorkspace(axisX, ws1.readE(index), OutputWorkspace='original'+str(index))
56  new_err = CreateWorkspace(axisX, ws2.readE(index), OutputWorkspace='new_err'+str(index))
57  a = plotSpectrum(original, 0)
58  plotSpectrum(new_err, 0, window=a)
59  b = plotSpectrum(ws1, index, True)
60  plotSpectrum(ws2, index, True, window=b)
61
62
63for i in range(ws1.getNumberHistograms()):
64        compareErrors(ws1, ws2, i)
65